Hello everyone. I am going through Dust documentation, but unable to crack on how to Send a prompt and get response from claude-3.7 agent using Dust api clients. Can someone assist here on how to do it?
It works for me, e.g. using Postman to test. Take a look at https://docs.dust.tt/reference/post_api-v1-w-wid-assistant-conversations-cid-messages, which tells you what to pass. For Claude 3.7, use "configurationId": "claude-3-7-sonnet"
Can you give me a working cURL David Ebbo ofcourse after anonymysing personal data. I am still facing issue. My region is EU.
Try something like this:
curl --location 'https://dust.tt/api/v1/w/YourwId/assistant/conversations/YourcId/messages' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer [removed]' \
--data '{
"content": "This is a test message",
"mentions": [
{
"configurationId": "claude-3-7-sonnet"
}
],
"context": {
"username": "david.ebbo",
"timezone": "Europe/Paris",
"fullName": "David Ebbo",
"email": "<email>",
"profilePictureUrl": "<profilePictureUrl>",
"origin": "someorigin"
}
}'
David Ebbo What is this YourcId. I want to start a new conversation so how to grab this value
What I gave you is to continue an existing conversation. To start a new one, it's different. I can give you that as well if you like.
yes sure .that would help
curl --location 'https://dust.tt/api/v1/w/0jDjHU9Gv6/assistant/conversations' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer [removed]' \
--data '{
"message": {
"content": "Conversation created from API",
"mentions": [
{
"configurationId": "claude-3-7-sonnet"
}
],
"context": {
"username": "david.ebbo",
"timezone": "Europe/Paris",
"fullName": "<string>",
"email": "<string>",
"profilePictureUrl": "<string>",
"origin": "davidtest"
}
},
"blocking": true,
"title": "Convo title",
"visibility": "workspace"
}'
But then if you want to continue it, you'd grab the cId from the response, and use the previous one I gave you.
Sure. That works
However, I am not seeing the answer from model in the API response. It did triggered the request and I can see it in Dust Client, but I need the answer to the prompt in the API response as well
Is it possible David Ebbo?
It's strange, because in my case, I do see the model response in the response. Did you keep "blocking": true? The other strange thing is that in my case, this conversation does not appear on the web site, and apparently it's not supposed to. This relates to the other thread we're having with Samy and Philippe Rolet. https://dustcommunity.slack.com/archives/C06SHT0F20G/p1744119200015459
On my side, I don’t use as many parameters in my call, and I do get the response from the API. This “blocking” parameter seems strange to me indeed.
Samy Some params are optional. The Blocking flag works as you'd expect. If you pass false, you won't get the LLM message in the response, but you can get it later with a different call. And stop insulting Claude! 😂
Yes, we agree. Haha I’m not insulting him, it’s a reference to Kaamelott and Perceval 🙂
I misunderstood, but the route used is only for creating the message and not getting the response. Logically, we should use “https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}” to retrieve the entire conversation and therefore the response from the last message sent. There is also this route https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}/events which, if I understand the documentation correctly, could do the job (to be tested).
"I misunderstood, but the route used is only for creating the message and not getting the response": yes, but it does get the first response if blocking. Indeed, you can then retrieve the whole conversation with conversations/{cId}. And conversations/{cId}/events is s streaming endpoint that tells you when anything happens in the conversations. I just tested it with curl, and then added a message through the UI, which instantly added some events.
Hi everyone, the blocking:true param doesnt seem to be working for me, no matter how I configure my call, I am not able to get the feedback from the agent.
Hugo Duverdier and if you follow up with GET https://dust.tt/api/v1/w/{wId}/assistant/conversations/{cId}, does that have it?
I get informations about the conversation, but the "content": [ ]," is empty
Do you have a mention in your create request so you can use an agent? e.g.
"mentions": [
{
"configurationId": "claude-3-7-sonnet"
}
],
I should add that in my case:
If I don't have a mention, I still get a content with one entry, which is my message
If I do, then content has two entries, mine and the agent response
So I'm not sure what's going on in your case to get nothing at all...
Yes, i do, here's the full body i am sending
{
"messages": [
{
"content": "bonjour l'ami",
"mentions": [
{
"configurationId": "<bot id>",
"name": "<name of my bot>"
}
]
}
],
"context": {
"timezone": "Europe/Paris",
"email": "<email>",
"username": "<myname>"
},
"blocking": true
}
Try this instead:
{
"message": {
"content": "bonjour l'ami",
"mentions": [
{
"configurationId": "<bot id>",
"name": "<name of my bot>"
}
],
"context": {
"timezone": "Europe/Paris",
"email": "<email>",
"username": "<myname>"
}
},
"blocking": true
}
It worked 😂 thank you very much David Ebbo, can't believe its just because of this little S haha !!