优化工具调用格式解析与后端工具调用日志保存逻辑,同时增强列表工具的返回内容展示
All checks were successful
Deploy Noval to K3s / deploy (push) Successful in 52s

This commit is contained in:
2026-03-23 08:39:45 +08:00
parent 0525c8217e
commit 2bdc18c00a
2 changed files with 31 additions and 19 deletions

View File

@@ -82,8 +82,8 @@ function parseHistoryMessage(msg: ChatMessage): ChatEntry[] {
continue
}
// 尝试匹配普通工具调用格式
const toolMatch = line.match(/^\[工具调用: (.+?)\] 参数: (.+?) → 结果: (.+)$/)
// 尝试匹配普通工具调用格式(兼容 "→ 结果: xxx" 和 "→ xxx" 两种格式)
const toolMatch = line.match(/^\[工具调用: (.+?)\] 参数: (.+?) → (?:结果: )?(.+)$/)
if (toolMatch) {
const label = toolMatch[1]
const name = LABEL_TO_TOOL_NAME[label] || label