Empty json_object response (DeepSeek-chat) #7705

Closed
opened 2026-02-21 18:21:58 -05:00 by yindo · 2 comments
Owner

Originally created by @juniorsereno on GitHub (Jan 13, 2025).

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

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Put a LLM on chatflow
Select deepseek-chat
Active response format and select json_object
Put instructions on prompt
Active window memory with 5 interactions
Interact six times
And you will see the response empty in the six interaction

✔️ Expected Behavior

Normal response with json_objetc

Actual Behavior

Empty response after hit the memory window config.
Capturar_select-area_20250103125451

Originally created by @juniorsereno on GitHub (Jan 13, 2025). ### 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.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Put a LLM on chatflow Select deepseek-chat Active response format and select json_object Put instructions on prompt Active window memory with 5 interactions Interact six times And you will see the response empty in the six interaction ### ✔️ Expected Behavior Normal response with json_objetc ### ❌ Actual Behavior Empty response after hit the memory window config. ![Capturar_select-area_20250103125451](https://github.com/user-attachments/assets/d0a9915f-72f9-4152-af2c-2ff38659e491)
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:21:58 -05:00
yindo closed this issue 2026-02-21 18:21:58 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 13, 2025):

The issue you're experiencing with the 'deepseek-chat' feature in Dify, where the response becomes empty after hitting the memory window limit, might be related to how the memory window is configured and managed. In Dify, the memory window is controlled by the TokenBufferMemory and MemoryConfig, which determine how much historical conversation data is included in the prompt for the language model. The memory_config.window.size parameter specifies the size of the memory window, and if this limit is reached, it might affect the response generation [1].

To address this issue, you might want to check the following:

  1. Memory Configuration: Ensure that the memory window size is set appropriately. The default size is 50, but it can be adjusted between 1 and 100. If the window size is too small, it might not retain enough context for generating a meaningful response.

  2. Prompt and Instructions: Verify that the instructions in the prompt are clear and that the model is configured to handle the json_object response format correctly. There might be an issue with how the model processes the prompt when the memory window is exceeded.

  3. Model Configuration: Double-check the model's configuration settings, such as max_tokens and other parameters, to ensure they align with your expected output format and length.

If these steps do not resolve the issue, it might require further investigation into the specific implementation of the json_object response format in the Dify codebase, which I couldn't find detailed information on.

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 (Jan 13, 2025): <!-- Answer --> The issue you're experiencing with the 'deepseek-chat' feature in Dify, where the response becomes empty after hitting the memory window limit, might be related to how the memory window is configured and managed. In Dify, the memory window is controlled by the `TokenBufferMemory` and `MemoryConfig`, which determine how much historical conversation data is included in the prompt for the language model. The `memory_config.window.size` parameter specifies the size of the memory window, and if this limit is reached, it might affect the response generation <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/llm/node.py)</sup>. To address this issue, you might want to check the following: 1. **Memory Configuration**: Ensure that the memory window size is set appropriately. The default size is 50, but it can be adjusted between 1 and 100. If the window size is too small, it might not retain enough context for generating a meaningful response. 2. **Prompt and Instructions**: Verify that the instructions in the prompt are clear and that the model is configured to handle the `json_object` response format correctly. There might be an issue with how the model processes the prompt when the memory window is exceeded. 3. **Model Configuration**: Double-check the model's configuration settings, such as `max_tokens` and other parameters, to ensure they align with your expected output format and length. If these steps do not resolve the issue, it might require further investigation into the specific implementation of the `json_object` response format in the Dify codebase, which I couldn't find detailed information on. <!-- 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/aa7b468b-76c3-400a-bb5b-3e1043d74ef6?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/aa7b468b-76c3-400a-bb5b-3e1043d74ef6?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/aa7b468b-76c3-400a-bb5b-3e1043d74ef6?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/aa7b468b-76c3-400a-bb5b-3e1043d74ef6?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/aa7b468b-76c3-400a-bb5b-3e1043d74ef6?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/aa7b468b-76c3-400a-bb5b-3e1043d74ef6?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Jan 13, 2025):

Revert "fix:deepseek tool call not working correctly" (#12463).

See this PR and related issues.

@crazywoola commented on GitHub (Jan 13, 2025): Revert "fix:deepseek tool call not working correctly" (#12463). See this PR and related issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7705