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 🙂