Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using the dify API, it is impossible to conduct multi-round conversations correctly. #14298

Open
5 tasks done
SodrSnne opened this issue Feb 25, 2025 · 4 comments
Open
5 tasks done
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited

Comments

@SodrSnne
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I have built a job using the dify chatflow.

And set memory in llm node

Image

When I use the web page provided by dify itself, I can normally load the historical messages to the large model.

Image

However, when I used my own developed webpage to call dify's API, it failed to work properly.

Image

api:

Image

✔️ Expected Behavior

No response

❌ Actual Behavior

The checks that I have already completed :

  1. Each time an API request is made, the conversation ID is always included.
    Image
  2. check log :

Image

Image

Image

Image

@dosubot dosubot bot added 🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited labels Feb 25, 2025
@SodrSnne
Copy link
Author

What additional information do I still need to provide?

Copy link

dosubot bot commented Feb 25, 2025

I found a similar unsolved discussion titled "DIY API interface call, unable to parse context" which might be related to your issue [1].

To resolve the issue of conducting multi-round conversations correctly using the Dify API on your own developed webpage, ensure you are using the updated version of Dify that includes the fix from PR #7955. This update ensures that the 'inputs' field in the /chat-messages API is properly updated with each request, even when using a conversation_id for multiple rounds of conversation.

When starting a new conversation, leave the conversation_id field empty to generate a new one. For subsequent interactions, include the conversation_id to maintain the continuity of the conversation. Ensure that your API calls correctly handle the conversation_id to manage ongoing sessions effectively.

Additionally, be aware that once a conversation_id is generated, future calls to the API should include this conversation_id to ensure the conversation continuity. When a previous conversation_id is passed, any new inputs will be ignored, and only the query is processed for the ongoing conversation. You can also manage dynamic variables during the session using conversation variables to adjust the bot's behavior or responses [2][3][4].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@SodrSnne
Copy link
Author

I saw this post which stated that doify version needs to be rolled back to 0.10.2? But I'm currently using the updated version 0.15.3.

@crazywoola
Copy link
Member

@SodrSnne The new configuration only applies for the new conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🤔 cant-reproduce We can not reproduce it or the information is limited
Projects
None yet
Development

No branches or pull requests

2 participants