Regarding the deep thinking switch in the process #21454

Closed
opened 2026-02-21 20:12:37 -05:00 by yindo · 1 comment
Owner

Originally created by @heishidehei on GitHub (Jan 5, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

In Chatflow, how to customize the switch for deep thinking (supporting the model that can disable deep thinking), and enable/disable it through parameters in the front-end interface.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @heishidehei on GitHub (Jan 5, 2026). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. In Chatflow, how to customize the switch for deep thinking (supporting the model that can disable deep thinking), and enable/disable it through parameters in the front-end interface. ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement🙋‍♂️ question labels 2026-02-21 20:12:37 -05:00
yindo closed this issue 2026-02-21 20:12:37 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 5, 2026):

Hi @heishidehei! I'm Dosu and I’m helping the dify team.

目前 Dify 的流程(chatflow)没有内置“深度思考”开关,最近的相关功能是 LLM 节点的 reasoning format 配置(可以分离推理内容和最终输出),以及通过参数切换模型(如普通模型和支持深度思考的模型)参考

实现自定义深度思考开关的思路如下:

  1. 前端:在 LLM 节点配置面板(如 panel.tsx)或 chatflow 输入区添加一个类似 ReasoningFormatConfig 的 UI 开关(Switch),用于设置“深度思考”参数。
  2. 后端:在工作流/模型调用逻辑中,读取该参数,根据开关状态选择不同模型或调整 agent/prompt 配置(比如启用/禁用 标签、切换到支持深度思考的模型)。
  3. 输出处理:参考 reasoning format 的处理方式,确保根据开关状态显示或隐藏推理内容(如 标签包裹的内容),或将其分离到独立字段。

注意:切换模型后,历史会话不会自动迁移到新模型,历史内容仍然绑定原模型,无法无缝继承上下文。如果需要类似 DeepSeek 的会话体验,需要自定义后端接口实现参考

相关代码可参考:

  • LLM 节点配置面板:web/app/components/workflow/nodes/llm/panel.tsx
  • reasoning format 开关:web/app/components/workflow/nodes/llm/components/reasoning-format-config.tsx
  • 推理内容渲染与定时器:web/app/components/base/markdown-blocks/think-block.tsx

如果需要更细致的参数控制,可以参考插件实现方式,比如通过 enable_thinkingthinking 参数在模型配置和 API 调用中切换深度思考模式。

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 5, 2026): <!-- Greeting --> Hi @heishidehei! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> 目前 Dify 的流程(chatflow)没有内置“深度思考”开关,最近的相关功能是 LLM 节点的 reasoning format 配置(可以分离推理内容和最终输出),以及通过参数切换模型(如普通模型和支持深度思考的模型)[参考](https://github.com/langgenius/dify/issues/15621)。 实现自定义深度思考开关的思路如下: 1. 前端:在 LLM 节点配置面板(如 panel.tsx)或 chatflow 输入区添加一个类似 ReasoningFormatConfig 的 UI 开关(Switch),用于设置“深度思考”参数。 2. 后端:在工作流/模型调用逻辑中,读取该参数,根据开关状态选择不同模型或调整 agent/prompt 配置(比如启用/禁用 <think> 标签、切换到支持深度思考的模型)。 3. 输出处理:参考 reasoning format 的处理方式,确保根据开关状态显示或隐藏推理内容(如 <think> 标签包裹的内容),或将其分离到独立字段。 注意:切换模型后,历史会话不会自动迁移到新模型,历史内容仍然绑定原模型,无法无缝继承上下文。如果需要类似 DeepSeek 的会话体验,需要自定义后端接口实现[参考](https://github.com/langgenius/dify/issues/15621)。 相关代码可参考: - LLM 节点配置面板:`web/app/components/workflow/nodes/llm/panel.tsx` - reasoning format 开关:`web/app/components/workflow/nodes/llm/components/reasoning-format-config.tsx` - 推理内容渲染与定时器:`web/app/components/base/markdown-blocks/think-block.tsx` 如果需要更细致的参数控制,可以参考插件实现方式,比如通过 `enable_thinking` 或 `thinking` 参数在模型配置和 API 调用中切换深度思考模式。 <!-- 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/b3dd8f13-377e-446a-8c77-82ffa3ba7b42?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b3dd8f13-377e-446a-8c77-82ffa3ba7b42?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b3dd8f13-377e-446a-8c77-82ffa3ba7b42?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b3dd8f13-377e-446a-8c77-82ffa3ba7b42?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b3dd8f13-377e-446a-8c77-82ffa3ba7b42?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b3dd8f13-377e-446a-8c77-82ffa3ba7b42?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b3dd8f13-377e-446a-8c77-82ffa3ba7b42?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=%E7%9B%AE%E5%89%8D%20Dify%20%E7%9A%84%E6%B5%81%E7%A8%8B%EF%BC%88chatflow%EF%BC%89%E6%B2%A1%E6%9C%89%E5%86%85%E7%BD%AE%E2%80%9C%E6%B7%B1%E5%BA%A6%E6%80%9D%E8%80%83%E2%80%9D%E5%BC%80%E5%85%B3%EF%BC%8C%E6%9C%80%E8%BF%91%E7%9A%84%E7%9B%B8%E5%85%B3%E5%8A%9F%E8%83%BD%E6%98%AF%20LLM%20%E8%8A%82%E7%82%B9%E7%9A%84%20reasoning%20format%20%E9%85%8D%E7%BD%AE%EF%BC%88%E5%8F%AF%E4%BB%A5%E5%88%86%E7%A6%BB%E6%8E%A8%E7%90%86%E5%86%85%E5%AE%B9%E5%92%8C%E6%9C%80%E7%BB%88%E8%BE%93%E5%87%BA%EF%BC%89%EF%BC%8C%E4%BB%A5%E5%8F%8A%E9%80%9A%E8%BF%87%E5%8F%82%E6%95%B0%E5%88%87%E6%8D%A2%E6%A8%A1%E5%9E%8B%EF%BC%88%E5%A6%82%E6%99%AE%E9%80%9A%E6%A8%A1%E5%9E%8B%E5%92%8C%E6%94%AF%E6%8C%81%E6%B7%B1%E5%BA%A6%E6%80%9D%E8%80%83%E7%9A%84%E6%A8%A1%E5%9E%8B%EF%BC%89%5B%E5%8F%82%E8%80%83%5D%28https%3A//github.com/langgenius/dify/issues/15621%29%E3%80%82%0A%0A%E5%AE%9E%E7%8E%B0%E8%87%AA%E5%AE%9A%E4%B9%89%E6%B7%B1%E5%BA%A6%E6%80%9D%E8%80%83%E5%BC%80%E5%85%B3%E7%9A%84%E6%80%9D%E8%B7%AF%E5%A6%82%E4%B8%8B%EF%BC%9A%0A%0A1.%20%E5%89%8D%E7%AB%AF%EF%BC%9A%E5%9C%A8%20LLM%20%E8%8A%82%E7%82%B9%E9%85%8D%E7%BD%AE%E9%9D%A2%E6%9D%BF%EF%BC%88%E5%A6%82%20panel.tsx%EF%BC%89%E6%88%96%20chatflow%20%E8%BE%93%E5%85%A5%E5%8C%BA%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E7%B1%BB%E4%BC%BC%20ReasoningFormatConfig%20%E7%9A%84%20UI%20%E5%BC%80%E5%85%B3%EF%BC%88Switch%EF%BC%89%EF%BC%8C%E7%94%A8%E4%BA%8E%E8%AE%BE%E7%BD%AE%E2%80%9C%E6%B7%B1%E5%BA%A6%E6%80%9D%E8%80%83%E2%80%9D%E5%8F%82%E6%95%B0%E3%80%82%0A2.%20%E5%90%8E%E7%AB%AF%EF%BC%9A%E5%9C%A8%E5%B7%A5%E4%BD%9C%E6%B5%81/%E6%A8%A1%E5%9E%8B%E8%B0%83%E7%94%A8%E9%80%BB%E8%BE%91%E4%B8%AD%EF%BC%8C%E8%AF%BB%E5%8F%96%E8%AF%A5%E5%8F%82%E6%95%B0%EF%BC%8C%E6%A0%B9%E6%8D%AE%E5%BC%80%E5%85%B3%E7%8A%B6%E6%80%81%E9%80%89%E6%8B%A9%E4%B8%8D%E5%90%8C%E6%A8%A1%E5%9E%8B%E6%88%96%E8%B0%83%E6%95%B4%20agent/prompt%20%E9%85%8D%E7%BD%AE%EF%BC%88%E6%AF%94%E5%A6%82%E5%90%AF%E7%94%A8/%E7%A6%81%E7%94%A8%20%3Cthink%3E%20%E6%A0%87%E7%AD%BE%E3%80%81%E5%88%87%E6%8D%A2%E5%88%B0%E6%94%AF%E6%8C%81%E6%B7%B1%E5%BA%A6%E6%80%9D%E8%80%83%E7%9A%84%E6%A8%A1%E5%9E%8B%EF%BC%89%E3%80%82%0A3.%20%E8%BE%93%E5%87%BA%E5%A4%84%E7%90%86%EF%BC%9A%E5%8F%82%E8%80%83%20reasoning%20format%20%E7%9A%84%E5%A4%84%E7%90%86%E6%96%B9%E5%BC%8F%EF%BC%8C%E7%A1%AE%E4%BF%9D%E6%A0%B9%E6%8D%AE%E5%BC%80%E5%85%B3%E7%8A%B6%E6%80%81%E6%98%BE%E7%A4%BA%E6%88%96%E9%9A%90%E8%97%8F%E6%8E%A8%E7%90%86%E5%86%85%E5%AE%B9%EF%BC%88%E5%A6%82%20%3Cthink%3E%20%E6%A0%87%E7%AD%BE%E5%8C%85%E8%A3%B9%E7%9A%84%E5%86%85%E5%AE%B9%EF%BC%89%EF%BC%8C%E6%88%96%E5%B0%86%E5%85%B6%E5%88%86%E7%A6%BB%E5%88%B0%E7%8B%AC%E7%AB%8B%E5%AD%97%E6%AE%B5%E3%80%82%0A%0A%E6%B3%A8%E6%84%8F%EF%BC%9A%E5%88%87%E6%8D%A2%E6%A8%A1%E5%9E%8B%E5%90%8E%EF%BC%8C%E5%8E%86%E5%8F%B2%E4%BC%9A%E8%AF%9D%E4%B8%8D%E4%BC%9A%E8%87%AA%E5%8A%A8%E8%BF%81%E7%A7%BB%E5%88%B0%E6%96%B0%E6%A8%A1%E5%9E%8B%EF%BC%8C%E5%8E%86%E5%8F%B2%E5%86%85%E5%AE%B9%E4%BB%8D%E7%84%B6%E7%BB%91%E5%AE%9A%E5%8E%9F%E6%A8%A1%E5%9E%8B%EF%BC%8C%E6%97%A0%E6%B3%95%E6%97%A0%E7%BC%9D%E7%BB%A7%E6%89%BF%E4%B8%8A%E4%B8%8B%E6%96%87%E3%80%82%E5%A6%82%E6%9E%9C%E9%9C%80%E8%A6%81%E7%B1%BB%E4%BC%BC%20DeepSeek%20%E7%9A%84%E4%BC%9A%E8%AF%9D%E4%BD%93%E9%AA%8C%EF%BC%8C%E9%9C%80%E8%A6%81%E8%87%AA%E5%AE%9A%E4%B9%89%E5%90%8E%E7%AB%AF%E6%8E%A5%E5%8F%A3%E5%AE%9E%E7%8E%B0%5B%E5%8F%82%E8%80%83%5D%28https%3A//github.com/langgenius/dify/issues/15621%29%E3%80%82%0A%0A%E7%9B%B8%E5%85%B3%E4%BB%A3%E7%A0%81%E5%8F%AF%E5%8F%82%E8%80%83%EF%BC%9A%0A-%20LLM%20%E8%8A%82%E7%82%B9%E9%85%8D%E7%BD%AE%E9%9D%A2%E6%9D%BF%EF%BC%9A%60web/app/components/workflow/nodes/llm/panel.tsx%60%0A-%20reasoning%20format%20%E5%BC%80%E5%85%B3%EF%BC%9A%60web/app/components/workflow/nodes/llm/components/reasoning-format-config.tsx%60%0A-%20%E6%8E%A8%E7%90%86%E5%86%85%E5%AE%B9%E6%B8%B2%E6%9F%93%E4%B8%8E%E5%AE%9A%E6%97%B6%E5%99%A8%EF%BC%9A%60web/app/components/base/markdown-blocks/think-block.tsx%60%0A%0A%E5%A6%82%E6%9E%9C%E9%9C%80%E8%A6%81%E6%9B%B4%E7%BB%86%E8%87%B4%E7%9A%84%E5%8F%82%E6%95%B0%E6%8E%A7%E5%88%B6%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%8F%82%E8%80%83%E6%8F%92%E4%BB%B6%E5%AE%9E%E7%8E%B0%E6%96%B9%E5%BC%8F%EF%BC%8C%E6%AF%94%E5%A6%82%E9%80%9A%E8%BF%87%20%60enable_thinking%60%20%E6%88%96%20%60thinking%60%20%E5%8F%82%E6%95%B0%E5%9C%A8%E6%A8%A1%E5%9E%8B%E9%85%8D%E7%BD%AE%E5%92%8C%20API%20%E8%B0%83%E7%94%A8%E4%B8%AD%E5%88%87%E6%8D%A2%E6%B7%B1%E5%BA%A6%E6%80%9D%E8%80%83%E6%A8%A1%E5%BC%8F%E3%80%82)&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/issues/30600)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21454