补充sql,增加错误详情上报

This commit is contained in:
Sakura-RanChen
2026-04-01 14:32:47 +08:00
parent b0e911b248
commit 140fcd5887
3 changed files with 13 additions and 4 deletions
@@ -0,0 +1 @@
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (312, 'tool_call_timeout', '30', 'number', 1, '工具调用超时时间(秒)');
@@ -585,4 +585,10 @@ databaseChangeLog:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202603311200.sql
- changeSet:
id: 202604011035
author: RanChen
changes:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202604011035.sql
+5 -3
View File
@@ -1117,6 +1117,9 @@ class ConnectionHandler:
try:
result = future.result(timeout=tool_call_timeout)
tool_results.append((result, tool_call_data))
# 使用公共方法上报工具调用结果
enqueue_tool_report(self, tool_call_data['name'], tool_input, str(result.result) if result.result else None, report_tool_call=False)
except Exception as e:
self.logger.bind(tag=TAG).error(
f"工具调用超时或异常: {tool_call_data['name']}, 错误: {e}"
@@ -1126,9 +1129,8 @@ class ConnectionHandler:
ActionResponse(action=Action.ERROR, result="哎呀,网络遇到点问题,请稍后再试下!"),
tool_call_data
))
# 使用公共方法上报工具调用结果
enqueue_tool_report(self, tool_call_data['name'], tool_input, str(result.result) if result.result else None, report_tool_call=False)
# 上报工具调用错误
enqueue_tool_report(self, tool_call_data['name'], tool_input, str(e), report_tool_call=False)
# 统一处理工具调用结果
if tool_results: