The session name changes automatically and it is not a session issue.
Self Checks
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Pleas do not modify this template :) and fill in all the required fields.
Dify version
0.5.2
Cloud or Self Hosted
Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
When the conversational assistant is opened for the first time, the session is labeled '新的对话'. After the first question is asked and a response is received, the session name changes to 'New conversation'. The function auto_generate_name located in dify/api/services/conversation_service.py does not work. Can you help solve this problem?
Note that we have already set the default language to Chinese.
-
The first time it is opened, it looks like this.
-
After I ask the first question, it looks like this.
✔️ Expected Behavior
The session correctly displays the question name.
❌ Actual Behavior
The session cannot correctly display the question name.
🤖
Hey @Mxk-1, nice to see you here again! How's everything going?
Based on the information you've provided, it seems like the issue is related to the auto_generate_name function in dify/api/services/conversation_service.py and the LLMGenerator.generate_conversation_name method in api/core/generator/llm_generator.py. These functions are responsible for generating the conversation name based on the first message of the conversation.
There are a few things you could check:
-
Check if the
auto_generate_namefunction is being called correctly: This function should be called whenever a new conversation is created or a new message is added to a conversation. If it's not being called correctly, the conversation name might not be generated or updated as expected. -
Check the
LLMGenerator.generate_conversation_namemethod: This method uses a language model to generate the conversation name based on the first message of the conversation. If there's an issue with the language model or the way it's being invoked, it could result in incorrect conversation names. -
Check the language settings: You mentioned that you've set the default language to Chinese. However, based on the similar issues you've found, it seems like there might be an issue with the language settings. Specifically, the language might be switching back to English after the first round of Q&A, despite being set to Chinese. You could try the solution suggested in the issue #2338, which involves changing the initial language setting in the i18n configuration.
-
Pull the latest code: According to the issue #2249, this issue has been fixed in the latest code. If you're not using the latest version of the code, you could try pulling the latest code and see if that resolves the issue.
If none of these suggestions work, could you please provide more information about your setup and the steps you're taking when you encounter this issue? This could help in identifying the cause of the issue.
Sources
- chat conversation name does not generated as expected
- 设置为中文,但是一轮回答之后自动切英文
- The conversation name automatically changes from Chinese to English after refreshing.
- api/services/conversation_service.py
- api/core/generator/llm_generator.py
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.