mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-21 18:05:30 -04:00
[PR #228] feat: add reasoning_content field to LLMResultChunkDelta #239
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/228
Author: @ultramancode
Created: 10/27/2025
Status: 🔄 Open
Base:
main← Head:feat/add-reasoning-content-field📝 Commits (1)
2148efefeat: add reasoning_content field to LLMResultChunkDelta📊 Changes
1 file changed (+1 additions, -0 deletions)
View changed files
📝
python/dify_plugin/entities/model/llm.py(+1 -0)📄 Description
Summary
Add optional
reasoning_contentfield toLLMResultChunkDeltafor structured streaming of LLM reasoning/thinking processes.Relates to #227 (issue)
Follow-up to langgenius/dify#23313
Changes
Why
Currently, plugins merge reasoning into
message.contentwith<think>tags, requiring Main to parse them back out. This adds:Compatibility
None), no breaking changes for existing plugins.Next Steps
This is Phase 1(SDK) of a multi-repo rollout:
Phase 2 (Plugins): Add defensive
pop("_dify_supports_reasoning_content", False)in all LLM plugins to prevent vendor API errors when Main sends capability flagsPhase 3 (Main): Read
reasoning_contentfrom plugins and usedelta.reasoning_contentdirectly if present (with fallback to_split_reasoning()), then send capability flag viamodel_parametersfor plugin optimization.Phase 4 (Plugins): Provider-by-provider opt-in to emit
reasoning_contentdeltasSee #227 for full plan.
Pull Request Checklist
Thank you for your contribution! Before submitting your PR, please make sure you have completed the following checks:
Compatibility Check
README.mdREADME.mdREADME.mdREADME.mdAvailable Checks
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.