mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
When the response format is JSON, invalid JSON data is returned in the tongyi plugin #79
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MBP888 on GitHub (Mar 14, 2025).
Self Checks
Dify version
1.0.1
Plugin version
0.0.11
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
When using the qwen model, if the response format is set to JSON, there is a probability that the resulting JSON string will be missing quotes, rendering the generated JSON string unparsable.
The issue occurs in the method: _handle_generate_stream_response. The problematic code is as follows:
Because when constructing the request earlier, during streaming output, it was already set to incremental response:
So should
full_text = resp_contentbe changed tofull_text += resp_contentOr should
be changed to:
✔️ Error log
No response
@dosubot[bot] commented on GitHub (Aug 16, 2025):
Hi, @MBP888. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
_handle_generate_stream_responsemethod updates thefull_textvariable.full_textor adjust content assignment to fix JSON formatting.Next Steps:
Thank you for your understanding and contribution!