fix(issue #1265): [Bug]: 意图识别模块,构造messages时,里面只有 system_prompt,没有 user_prompt,这会导致llm接口兼容问 - #172
Open
openjiuwen-sync-bot[bot] wants to merge 1 commit into
Open
Conversation
…r_prompt,这会导致llm接口兼容问
|
|
1 similar comment
|
|
|
head_sha:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paired: GitHub #172 ↔ GitCode !1761
Fixes #1265
机器人基于 issue 分析自动修复。
根因
Bug 根因分析:
意图识别模块在构造 LLM 请求的 messages 数组时,仅包含 system_prompt 角色的消息,未添加 user_prompt 角色的消息。这导致部分 LLM API(如 GLM 系列)因缺少 user 角色消息而报错,而 DeepSeek 等宽松实现的 API 可以正常处理。
受影响的代码路径:
agent-runtime/jiuwen/common/intent_detection/adapt/intent.py—Intent类(第134行),通过build方法实例化,负责意图识别的 LLM 调用agent_builder/nl_to_agent/下多个子模块(clarifier/prompt.py、designer/prompt.py、generate_json_workflow/prompt.py、agent_designer/prompt.py)均定义了SYSTEM_PROMPT常量,调用链中仅引用 system prompt,未见构造 user prompt由 issues-robot auto-fix 生成,复核后可合并。
Linked Closing Issues: