Can not get output when useing tongyi DeepSeek3.1 #606

Closed
opened 2026-02-16 10:19:52 -05:00 by yindo · 3 comments
Owner

Originally created by @Once2012 on GitHub (Aug 31, 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 Dify issues & Dify Official Plugins, 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

1.7.1 to 1.8.0

Plugin version

langgenius / tongyi 0.0.43

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I created a ChatFlow and used the DeepSeek V3.1 model in an LLM Node. However, after running it, there was no output at all. When I reduce the size of the prompt (<1200), there will be an output. However, if it exceeds this value, there is a high probability that there will be no output. In the debugging information, it can be seen that the text field in the output information is empty.
Additionally, if I directly write the code to call the API of Aliyun Tongyi's DeepSeek V3.1, with the same prompt, the correct output will be obtained.

✔️ Error log

No response

Originally created by @Once2012 on GitHub (Aug 31, 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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 1.7.1 to 1.8.0 ### Plugin version langgenius / tongyi 0.0.43 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I created a ChatFlow and used the DeepSeek V3.1 model in an LLM Node. However, after running it, there was no output at all. When I reduce the size of the prompt (<1200), there will be an output. However, if it exceeds this value, there is a high probability that there will be no output. In the debugging information, it can be seen that the text field in the output information is empty. Additionally, if I directly write the code to call the API of Aliyun Tongyi's DeepSeek V3.1, with the same prompt, the correct output will be obtained. ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:19:52 -05:00
yindo closed this issue 2026-02-16 10:19:52 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 31, 2025):

Hi @Once2012! I'm Dosu and I’m helping the dify-official-plugins team.

This issue is likely caused by how the tongyi plugin processes streamed output for DeepSeek V3.1. The plugin uses a replace method to extract incremental deltas, which can result in character loss or empty output if the prompt is large or if the output and accumulated text don't align perfectly. This is a known bug for DeepSeek models in the tongyi plugin, especially with longer prompts source.

There are no hardcoded prompt size limits in Dify or the plugin for DeepSeek V3.1; the model's config allows very large prompts (context_size: 131072), and you can adjust max_tokens (default 4096, up to 65536) to control output length source. However, if the underlying API returns success but no content, Dify will show an empty output field with no error source.

Workarounds:

  • Try increasing the max_tokens parameter in your model config to see if output is truncated.
  • If possible, reduce prompt size or split your input into smaller chunks.
  • Monitor for plugin updates that address the output processing bug, or consider patching the plugin to avoid using replace for streamed output (see suggested fixes).

If direct API calls work but Dify does not, the issue is almost certainly in the plugin's output handling logic.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 31, 2025): <!-- Greeting --> Hi @Once2012! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> This issue is likely caused by how the tongyi plugin processes streamed output for DeepSeek V3.1. The plugin uses a `replace` method to extract incremental deltas, which can result in character loss or empty output if the prompt is large or if the output and accumulated text don't align perfectly. This is a known bug for DeepSeek models in the tongyi plugin, especially with longer prompts [source](https://github.com/langgenius/dify-official-plugins/issues/957). There are no hardcoded prompt size limits in Dify or the plugin for DeepSeek V3.1; the model's config allows very large prompts (context_size: 131072), and you can adjust `max_tokens` (default 4096, up to 65536) to control output length [source](https://github.com/langgenius/dify-official-plugins/blob/f5a8c9e26c2fe1c19e6026320f3509a4c74f0709/models/tongyi/models/llm/deepseek-v3.1.yaml). However, if the underlying API returns success but no content, Dify will show an empty output field with no error [source](https://github.com/langgenius/dify/blob/9f528d23d442c04805d4fef3e2a2326f6b109a5b/api/core/workflow/nodes/llm/node.py). **Workarounds:** - Try increasing the `max_tokens` parameter in your model config to see if output is truncated. - If possible, reduce prompt size or split your input into smaller chunks. - Monitor for plugin updates that address the output processing bug, or consider patching the plugin to avoid using `replace` for streamed output (see [suggested fixes](https://github.com/langgenius/dify-official-plugins/issues/957)). If direct API calls work but Dify does not, the issue is almost certainly in the plugin's output handling logic. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1621)
Author
Owner

@Once2012 commented on GitHub (Aug 31, 2025):

Hi @Once2012! I'm Dosu and I’m helping the dify-official-plugins team.

This issue is likely caused by how the tongyi plugin processes streamed output for DeepSeek V3.1. The plugin uses a replace method to extract incremental deltas, which can result in character loss or empty output if the prompt is large or if the output and accumulated text don't align perfectly. This is a known bug for DeepSeek models in the tongyi plugin, especially with longer prompts source.

There are no hardcoded prompt size limits in Dify or the plugin for DeepSeek V3.1; the model's config allows very large prompts (context_size: 131072), and you can adjust max_tokens (default 4096, up to 65536) to control output length source. However, if the underlying API returns success but no content, Dify will show an empty output field with no error source.

Workarounds:

  • Try increasing the max_tokens parameter in your model config to see if output is truncated.
  • If possible, reduce prompt size or split your input into smaller chunks.
  • Monitor for plugin updates that address the output processing bug, or consider patching the plugin to avoid using replace for streamed output (see suggested fixes).

If direct API calls work but Dify does not, the issue is almost certainly in the plugin's output handling logic.

To reply, just mention @dosu.

How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

"This is a known bug for DeepSeek models in the tongyi", NONONO, DeepSeek V3 or R1 in tongyi is always OK
In the subsequent tests, even with just a few lines of prompts in DeepSeek V3.1, there was still no response. I'm unable to determine at this moment when there will be a return and when there won't.
The DeepSeek V3.1 parameters I used were: temperature=0 and top_p=1

@Once2012 commented on GitHub (Aug 31, 2025): > Hi [@Once2012](https://github.com/Once2012)! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. > > This issue is likely caused by how the tongyi plugin processes streamed output for DeepSeek V3.1. The plugin uses a `replace` method to extract incremental deltas, which can result in character loss or empty output if the prompt is large or if the output and accumulated text don't align perfectly. This is a known bug for DeepSeek models in the tongyi plugin, especially with longer prompts [source](https://github.com/langgenius/dify-official-plugins/issues/957). > > There are no hardcoded prompt size limits in Dify or the plugin for DeepSeek V3.1; the model's config allows very large prompts (context_size: 131072), and you can adjust `max_tokens` (default 4096, up to 65536) to control output length [source](https://github.com/langgenius/dify-official-plugins/blob/f5a8c9e26c2fe1c19e6026320f3509a4c74f0709/models/tongyi/models/llm/deepseek-v3.1.yaml). However, if the underlying API returns success but no content, Dify will show an empty output field with no error [source](https://github.com/langgenius/dify/blob/9f528d23d442c04805d4fef3e2a2326f6b109a5b/api/core/workflow/nodes/llm/node.py). > > **Workarounds:** > > * Try increasing the `max_tokens` parameter in your model config to see if output is truncated. > * If possible, reduce prompt size or split your input into smaller chunks. > * Monitor for plugin updates that address the output processing bug, or consider patching the plugin to avoid using `replace` for streamed output (see [suggested fixes](https://github.com/langgenius/dify-official-plugins/issues/957)). > > If direct API calls work but Dify does not, the issue is almost certainly in the plugin's output handling logic. > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6f78d049-6d57-4da3-b445-dd8a32b4430e?feedback_type=other)  [![Join Discord](https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![Share on X](https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1621) "This is a known bug for DeepSeek models in the tongyi", NONONO, DeepSeek V3 or R1 in tongyi is always OK In the subsequent tests, even with just a few lines of prompts in DeepSeek V3.1, there was still no response. I'm unable to determine at this moment when there will be a return and when there won't. The DeepSeek V3.1 parameters I used were: temperature=0 and top_p=1
Author
Owner

@dosubot[bot] commented on GitHub (Aug 31, 2025):

You're right—DeepSeek V3 and R1 work fine in the tongyi plugin; the output bug is specific to DeepSeek V3.1. The root cause is the plugin's streamed output handling: it uses a replace method to build the response, which can lose characters or result in empty output, even with small prompts and regardless of parameters like temperature or top_p. This bug is confirmed for V3.1 and not present in V3 or R1 details.

There are no hardcoded prompt size limits in the config; the issue is with how the plugin accumulates streamed output config reference. Workarounds like increasing max_tokens or reducing prompt size may help with truncation, but won't fix the root bug.

The recommended fix is to patch the plugin to use string appending instead of replace, for example:

full_text += resp_content[len(full_text):]

This prevents character loss and empty output suggested fix.

If you want step-by-step patch instructions, let me know!

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 31, 2025): <!-- Answer --> You're right—DeepSeek V3 and R1 work fine in the tongyi plugin; the output bug is specific to DeepSeek V3.1. The root cause is the plugin's streamed output handling: it uses a `replace` method to build the response, which can lose characters or result in empty output, even with small prompts and regardless of parameters like temperature or top_p. This bug is confirmed for V3.1 and not present in V3 or R1 [details](https://github.com/langgenius/dify-official-plugins/issues/957). There are no hardcoded prompt size limits in the config; the issue is with how the plugin accumulates streamed output [config reference](https://github.com/langgenius/dify-official-plugins/issues/1621). Workarounds like increasing `max_tokens` or reducing prompt size may help with truncation, but won't fix the root bug. The recommended fix is to patch the plugin to use string appending instead of `replace`, for example: ```python full_text += resp_content[len(full_text):] ``` This prevents character loss and empty output [suggested fix](https://github.com/langgenius/dify-official-plugins/issues/957). If you want step-by-step patch instructions, let me know! <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/5dc2df47-0474-4632-adbf-553ed44b8fc5?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5dc2df47-0474-4632-adbf-553ed44b8fc5?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5dc2df47-0474-4632-adbf-553ed44b8fc5?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5dc2df47-0474-4632-adbf-553ed44b8fc5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5dc2df47-0474-4632-adbf-553ed44b8fc5?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5dc2df47-0474-4632-adbf-553ed44b8fc5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5dc2df47-0474-4632-adbf-553ed44b8fc5?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1621)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#606