Suggestions in English, although the message is in Chinese #7227

Closed
opened 2026-02-21 18:19:32 -05:00 by yindo · 4 comments
Owner

Originally created by @yz00000000 on GitHub (Dec 16, 2024).

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.14.0

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

Chat with the agent...
image

I think there is an issue with "SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT" in this code (https://github.com/langgenius/dify/blob/0.14.0/api/core/llm_generator/prompts.py), it should be written this.
SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT = ( "Please help me predict the three most likely questions that human would ask, " "and keeping each question under 20 characters.\n" "MAKE SURE your output is the SAME language as the Assistant's latest response" "You must answer in {language}, in a style that is clear and detailed in {language}." "The output must be an array in JSON format following the specified schema:\n" '["question1","question2","question3"]\n' )

✔️ Expected Behavior

Suggestions in Chinese

Actual Behavior

Suggestions in English

Originally created by @yz00000000 on GitHub (Dec 16, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.14.0 ### Cloud or Self Hosted Cloud, Self Hosted (Docker) ### Steps to reproduce Chat with the agent... ![image](https://github.com/user-attachments/assets/42900c36-e828-420d-8dfc-dd9fca7eb98c) I think there is an issue with "SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT" in this code (https://github.com/langgenius/dify/blob/0.14.0/api/core/llm_generator/prompts.py), it should be written this. `SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT = ( "Please help me predict the three most likely questions that human would ask, " "and keeping each question under 20 characters.\n" "MAKE SURE your output is the SAME language as the Assistant's latest response" "You must answer in {language}, in a style that is clear and detailed in {language}." "The output must be an array in JSON format following the specified schema:\n" '["question1","question2","question3"]\n' )` ### ✔️ Expected Behavior Suggestions in Chinese ### ❌ Actual Behavior Suggestions in English
yindo added the 🐞 bug label 2026-02-21 18:19:32 -05:00
yindo closed this issue 2026-02-21 18:19:32 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 16, 2024):

Hey @yz00000000! I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together while we wait for a human maintainer.

I found some similar discussions regarding language issues with suggested questions in Dify:

  1. How to set the next question into Chinese? - This discussion is unsolved and addresses setting the language for the next question to Chinese [1].

  2. The “suggested” interface defaults to returning questions in English. - Another unsolved discussion about the default language being English for suggested questions [2].

  3. Next Question Suggestions - This unsolved discussion also touches on the topic of language settings for suggested questions [3].

For your specific issue, the SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT variable in Dify version 0.14.0 is implemented as follows:

SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT = (
    "Please help me predict the three most likely questions that human would ask, "
    "and keeping each question under 20 characters.\n"
    "MAKE SURE your output is the SAME language as the Assistant's latest response"
    "The output must be an array in JSON format following the specified schema:\n"
    '["question1","question2","question3"]\n'
)

The issue you're experiencing, where suggestions are in English instead of Chinese, might be due to the language detection mechanism not functioning as expected. The prompt is designed to ensure the output matches the language of the assistant's latest response, but if this isn't happening, it could be a bug or a configuration issue.

To address this, you might consider checking if the language detection or configuration settings are correctly set up to handle Chinese. Additionally, you could modify the prompt to explicitly specify the language, as you suggested, by including a placeholder for the language:

"You must answer in {language}, in a style that is clear and detailed in {language}."

This change would require ensuring that the {language} variable is correctly set to "Chinese" based on the context of the conversation.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Dec 16, 2024): <!-- Greeting --> Hey @yz00000000! I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together while we wait for a human maintainer. <!-- Answer --> I found some similar discussions regarding language issues with suggested questions in Dify: 1. [How to set the next question into Chinese?](https://github.com/langgenius/dify/discussions/5944) - This discussion is unsolved and addresses setting the language for the next question to Chinese <sup>[[1]](https://github.com/langgenius/dify/discussions/5944)</sup>. 2. [The “suggested” interface defaults to returning questions in English.](https://github.com/langgenius/dify/discussions/4774) - Another unsolved discussion about the default language being English for suggested questions <sup>[[2]](https://github.com/langgenius/dify/discussions/4774)</sup>. 3. [Next Question Suggestions](https://github.com/langgenius/dify/discussions/4046) - This unsolved discussion also touches on the topic of language settings for suggested questions <sup>[[3]](https://github.com/langgenius/dify/discussions/4046)</sup>. For your specific issue, the `SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT` variable in Dify version 0.14.0 is implemented as follows: ```python SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT = ( "Please help me predict the three most likely questions that human would ask, " "and keeping each question under 20 characters.\n" "MAKE SURE your output is the SAME language as the Assistant's latest response" "The output must be an array in JSON format following the specified schema:\n" '["question1","question2","question3"]\n' ) ``` The issue you're experiencing, where suggestions are in English instead of Chinese, might be due to the language detection mechanism not functioning as expected. The prompt is designed to ensure the output matches the language of the assistant's latest response, but if this isn't happening, it could be a bug or a configuration issue. To address this, you might consider checking if the language detection or configuration settings are correctly set up to handle Chinese. Additionally, you could modify the prompt to explicitly specify the language, as you suggested, by including a placeholder for the language: ```python "You must answer in {language}, in a style that is clear and detailed in {language}." ``` This change would require ensuring that the `{language}` variable is correctly set to "Chinese" based on the context of the conversation. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/fea4cd6c-9997-4146-a8d3-e196a9cd0b72?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/fea4cd6c-9997-4146-a8d3-e196a9cd0b72?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/fea4cd6c-9997-4146-a8d3-e196a9cd0b72?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/fea4cd6c-9997-4146-a8d3-e196a9cd0b72?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fea4cd6c-9997-4146-a8d3-e196a9cd0b72?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/fea4cd6c-9997-4146-a8d3-e196a9cd0b72?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Dec 16, 2024):

Duplicated

@crazywoola commented on GitHub (Dec 16, 2024): Duplicated
Author
Owner

@yz00000000 commented on GitHub (Dec 17, 2024):

@crazywoola
Duplicated? Two commits https://github.com/langgenius/dify/commit/8cc9e683631e155e9c7c1c282e91f9933f2858ba https://github.com/langgenius/dify/commit/c013086e64033366d1c7baa84498c6ecfdf14965 but the problem still exists.

@yz00000000 commented on GitHub (Dec 17, 2024): @crazywoola Duplicated? Two commits [https://github.com/langgenius/dify/commit/8cc9e683631e155e9c7c1c282e91f9933f2858ba](url) [https://github.com/langgenius/dify/commit/c013086e64033366d1c7baa84498c6ecfdf14965](url) but the problem still exists.
Author
Owner

@crazywoola commented on GitHub (Feb 12, 2025):

By saying duplicated means this issue has been raised before for more than 1 times. Please search the existing issue. This is a known issue, currently we do not have a solution for it.

@crazywoola commented on GitHub (Feb 12, 2025): By saying duplicated means this issue has been raised before for more than 1 times. Please search the existing issue. This is a known issue, currently we do not have a solution for it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7227