mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
support baidu/ERNIE-4.5-21B-A3B-Thinking ENDTHINKFLAG #662
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 @medisean on GitHub (Sep 21, 2025).
Self Checks
Dify version
1.8.1
Cloud or Self Hosted
Cloud
Steps to reproduce
not support model on huggingface: baidu:ERNIE-4.5-21B-A3B-Thinking
Demo:
input: 你好
output:
用户现在发来了“你好”,我需要回应他。首先,用户可能是在打招呼,我需要友好地回应,同时保持亲切。用户可能是任何场景,比如日常聊天、寻求帮助或者只是想闲聊。所以回应要温暖,鼓励用户继续交流。
首先,我应该用同样的礼貌方式回应,比如“你好呀~有什么需要帮忙的,或者想聊的,我都在这儿哦~”这样既回应了问候,又表达了愿意陪伴的态度。同时保持语气亲切,让用户感到被重视。
另外,用户可能希望得到进一步的互动,所以需要保持开放,邀请用户分享更多。这样用户会更愿意继续交流。需要避免过于正式,保持自然,符合日常对话的风格。
总结来说,回应需要友好、温暖,鼓励用户继续沟通。所以合适的回答应该是“你好呀~今天有什么特别的事情想聊吗?或者有什么需要我帮忙的,尽管说~”这样既回应了问候,又提供了帮助的意愿,符合用户可能的需求。
[ENDTHINKFLAG]
你好呀~今天有什么想分享的,或者需要帮忙的,随时告诉我哦~🌹
problem:
before ENDTHINKFLAG content not fold
✔️ Expected Behavior
before ENDTHINKFLAG content can fold
❌ Actual Behavior
before ENDTHINKFLAG content not fold
@dosubot[bot] commented on GitHub (Sep 21, 2025):
Dify's folding (collapsing) behavior for model output is currently implemented for
<think>tags in the frontend, using thepreprocessThinkTagfunction and a customThinkBlockcomponent that renders collapsible sections via HTML<details>tags. There is no built-in support for folding content based on custom markers likeENDTHINKFLAG—the code does not recognize or process this marker for folding, so content beforeENDTHINKFLAGwill not be collapsed by default in the UI [source].To achieve folding for sections before
ENDTHINKFLAG, you would need to add custom logic to the frontend Markdown rendering component to detect this marker and wrap the relevant content in a collapsible block, similar to how<think>tags are handled. The backend does not perform any folding/collapsing for this marker; it's a frontend concern.Recent updates have focused on reasoning format options for
<think>tags, but there is no mention of support forENDTHINKFLAGor the baidu/ERNIE-4.5-21B-A3B-Thinking model in the latest pull requests [source].If you need folding for custom markers, consider extending the frontend logic to support it, using the existing
<think>tag handling as a template.To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@dosubot[bot] commented on GitHub (Sep 21, 2025):
Dify's folding/collapsing feature in the chat UI is currently limited to recognized tags like
<think>and<details>. Custom markers such asENDTHINKFLAGare not supported for folding by default. The folding logic is implemented in the frontend (web/app/components/base/markdown.tsx) using regex and custom React components to wrap content between these tags in collapsible panels.To support folding for
ENDTHINKFLAG, the frontend code would need to be updated to recognize this marker and wrap the preceding content in a collapsible container, similar to how it handles<think>or<details>tags. This change is technically straightforward due to the plugin-based architecture of the markdown rendering logic.There are no existing workarounds or configuration options for folding with custom markers, so code modification is required for this feature. If you need this urgently, you can consider preprocessing the model output to replace your custom marker with a supported tag like
<details>as a temporary workaround.For more details on how folding is handled and the relevant code location, see this discussion.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
