Hey Dust community,
I have been trying to interact with an Assistant I created using a python program. But I can’t get to understand how to work with the API to do so.
So far I created a conversation (below) but how can I send a message to the assistant and retrieve its response ?
Thanks for your help
import requests
url = "https://dust.tt/api/v1/w/0O3VJLXuWk/assistant/conversations"
payload = {
"message": {
"context": { "origin": "api", "email" : "c.lacaille@ogmentia.ai", "fullName" : "clem", "profilePictureUrl" : "www.test.html", "timezone" : "CET", "username" : "clem"},
"content": "Can you check if John Doe is still working at Acme? If yes, tell me his current position and department within the company. If not, provide details about his new company, his role, department, and experience level.",
"mentions": [{ "configurationId": "s7L113jYOJ" }]
},
"blocking": True,
"title": "My conversation",
"visibility": "unlisted"
}
headers = {
"accept": "application/json",
"content-type": "application/json",
"authorization": "Bearer sk-e4a458c1cb9c1e08bc6afa5384bc9678"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)