summarize-endpoint can be used to generate summaries for longer texts.
from aleph_alpha_client import Client, Document, SummarizationRequest
# If you are using a Windows machine, you must install the python-dotenv package and run the two below lines as well.
# from dotenv import load_dotenv
client = Client(token=os.getenv("AA_TOKEN"))
document_text = "The gray wolf (Canis lupus) is a species of placental mammal of the carnivore order. The earliest fossil record dates back eight hundred thousand years. Wolves are native to North America and Eurasia, where they were once widely distributed and abundant. Today, they inhabit only a very limited portion of their former territory."
request = SummarizationRequest(document=Document.from_text(document_text))
response = client.summarize(request=request)
summary = response.summary
# Document: [...]
# Summary: Wolves are native to North America and Eurasia, but are now only found in a very limited portion of their former territory.
If you need more information on the parameters you can use, please checkout our HTTP API.