refactor(agent): remove final_answer tool references and update related logic

- Eliminated all instances of the final_answer tool from the agent's configuration and logic, transitioning to a model where the agent concludes responses with plain text instead.
- Updated event handling and response analysis to reflect this change, ensuring that the agent's output is now directly delivered as text without relying on a dedicated final answer tool.
- Adjusted localization strings across multiple languages to remove references to final_answer, enhancing clarity and consistency in user-facing messages.
- Improved the overall structure of the agent's response handling to streamline the process and reduce potential confusion regarding tool usage.

refactor(agent): streamline answer handling and preamble logic

- Updated the agent's response handling to treat any text streamed before a tool call as a preamble, ensuring it is not included in the final answer.
- Removed the superseded marker logic from the event emission process, simplifying the flow of answer content and enhancing clarity in the UI.
- Adjusted the event handling to ensure that preamble segments are correctly retracted and relocated into the steps tree, improving the overall user experience.
- Enhanced the agent's internal logic to better manage answer segments and their states during streaming, leading to a more coherent response structure.
This commit is contained in:
wizardchen
2026-06-04 02:35:54 +08:00
committed by lyingbug
parent b9dde2abe8
commit d38a6efd87
31 changed files with 722 additions and 663 deletions
+4 -2
View File
@@ -1726,6 +1726,10 @@ export default {
toolFallback: "工具",
stepsCompleted: "已完成 <strong>{steps}</strong> 个步骤",
stepsCompletedWithDuration: "已完成 <strong>{steps}</strong> 个步骤,耗时 <strong>{duration}</strong>",
reasoningRounds: "思考 <strong>{rounds}</strong> 轮",
toolCalls: "调用 <strong>{tools}</strong> 次工具",
durationSuffix: "耗时 <strong>{duration}</strong>",
stepSummarySeparator: " · ",
title: "智能体",
subtitle: "配置和管理您的智能体,自定义对话行为和能力",
createAgent: "创建智能体",
@@ -4519,7 +4523,6 @@ export default {
thinking: "思考",
imageAnalysis: "查看图片内容",
queryKnowledgeGraph: "知识图谱查询",
finalAnswer: "生成回答",
readSkill: "读取技能",
executeSkillScript: "执行技能脚本",
dataAnalysis: "数据分析",
@@ -4756,7 +4759,6 @@ export default {
// 运行时系统注入(只读,用于预览)
webSearch: "网络搜索",
webFetch: "网页抓取",
finalAnswer: "提交最终回答",
// 分组
groupBase: "基础",
groupRag: "知识库检索(RAG)",