Summary
This feature is in beta. Please email us at sounho@weavel.ai to gain access.
Use to summarize a conversation.
Start by enabling the Summary API in the Weavel dashboard (for instructions, visit overview). A unique endpoint ID will be generated for you to use in the API request.
POST
https://api.weavel.ai/extract/:endpoint_id
Send a request
To send the request, add:
messages
(required): A list of messages. Each should be a JSON with a role (user or assistant) and content.
[
{"role": "assistant", "content": "hello there"},
{"role": "user", "content": "hi"},
{"role": "assistant", "content": "how are you doing?"}
{"role": "user", "content": "i'm doing fine"},
]
Example Usage
import requests
url = 'https://api.weavel.ai/extract/your_endpoint_id'
headers = {
'accept': 'application/json',
'Authorization': 'Bearer YOUR_WEAVEL_API_KEY',
'Content-Type': 'application/json
}
data = {
"messages": [
{"role": "assistant", "content": "example message"},
{"role": "user", "content": "example message"},
{"role": "assistant", "content": "example message"}
{"role": "user", "content": "example message"},
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Returns
A JSON object with the summary of the conversation.
{
"summary": "example summary of the conversation"
}
View the API logs
Weavel's APIs are automatically connected to your analytics dashboard for tracking usage and logs.
Check your usage and logs in the Weavel dashboard. For instructions, visit the API Overview (Logs and Usage).