mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 02:15:22 -04:00
[PR #57] [MERGED] fix: bypass _code_block_mode_wrapper if response_format is not JSON or XML #111
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?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/57
Author: @kurokobo
Created: 3/20/2025
Status: ✅ Merged
Merged: 3/24/2025
Merged by: @Yeuoly
Base:
main← Head:json_xml📝 Commits (1)
05a9bf4fix: bypass _code_block_mode_wrapper if response_format is not JSON or XML📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
python/dify_plugin/interfaces/model/large_language_model.py(+2 -2)📄 Description
This is regression of #8451, and re-application of #9148 by @hjlarry.
Related issues and PRs:
In the current implementation,
self._code_block_mode_wrapperis executed when theresponse_formatisjson_schema, but this method is intended to force output format toJSONorXMLthat is independently implemented by Dify itself, and not for the Structured Output feature that the LLM model possesses.When this method is called when the
response_formatis neitherJSONnorXMLsuch asjson_schema, themodel_parametersand prompts can be formatted in an unintended way by the LLM, leading to errors in subsequent processing.Closes #28
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.