Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 780 Bytes

File metadata and controls

25 lines (17 loc) · 780 Bytes
title metaTitle metaDescription
Code Samples: Using Magic-Summary in Python
Docs: Using Magic-Summary in Python
Documentation on summarising text with the Magic-Summary AI model delivered via Computational Magic

Replace API key and content with your own

Please be sure to replace the placeholder API key with your API key and pass in your own strings for summarisation.

Using Requests

import requests
 
url = "https://beta.eu-north.computational-magic.com/api/v1"

headers = {'x-api-key': 'INSERT YOUR API KEY HERE!', 'Content-Type': 'application/json'}
 
query = """{summary(input: "INSERT YOUR LONG STRING HERE.")}"""

response = requests.post(url, headers=headers, json={'query': query})
print(response.status_code)
print(response.text)