Open evertonresende opened 1 day ago
Hey @evertonresende! I'm here to assist you with any bugs, questions, or contributions. Let's work together to resolve the issue.
The "Conversation does not exist" error for a valid conversation_id
in the second request could occur if the conversation_id
is not being correctly maintained or passed in subsequent API calls. According to the documentation:
conversation_id
: When starting a new conversation, leave the conversation_id
field empty. The system will generate and return a new conversation_id
, which you will use in future interactions to continue the dialogue.conversation_id
in Existing Sessions: Once a conversation_id
is generated, future calls to the API should include this conversation_id
to ensure the conversation continuity with the Dify bot. If the previous conversation_id
is passed, new inputs
will be ignored, and only the query
will be processed in the ongoing conversation.Ensure that the conversation_id
is correctly captured from the initial response and consistently used in all subsequent requests. Here is an example of how to correctly use the conversation_id
in a Python request:
import requests
import json
url = 'https://api.dify.ai/v1/chat-messages'
headers = {
'Authorization': 'Bearer ENTER-YOUR-SECRET-KEY',
'Content-Type': 'application/json',
}
data = {
"inputs": {},
"query": "Tell me more about the iPhone's camera?",
"response_mode": "streaming",
"conversation_id": "30082f1d-0a67-4bc7-9e5a-7907d1835cd2", # Ensure this is the correct conversation_id
"user": "user-id-example"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Ensure that the conversation_id
is correctly captured from the initial response and consistently used in all subsequent requests [1][2].
To continue talking to Dosu, mention @dosu.
Still can not reproduce it. I am using both postman and curl command.
Still can not reproduce it. I am using both postman and curl command.
I tested the call in postman and unfortunately it doesn't work.
Self Checks
Dify version
0.8.3
Cloud or Self Hosted
Cloud
Steps to reproduce
Steps to Reproduce
conversation_id
, and I successfully receive a response with a validconversation_id
.conversation_id
and use it in a second request to continue the conversation.conversation_id
is visible in the Dify dashboard.First Request (works as expected):
Response from First Request:
Second Request (returns error):
Response from Second Request:
✔️ Expected Behavior
The conversation_id should allow the conversation to continue, with the response based on the previous context.
❌ Actual Behavior
The API returns a 404 - Conversation does not exist error, even though the conversation_id is valid and visible in the Dify dashboard.