mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 00:53:54 +08:00
update:优化工具回复
This commit is contained in:
@@ -108,15 +108,12 @@ async def process_intent_result(conn, intent_result, original_text):
|
||||
|
||||
# 使用统一工具处理器处理所有工具调用
|
||||
try:
|
||||
tool_result = asyncio.run_coroutine_threadsafe(
|
||||
result = asyncio.run_coroutine_threadsafe(
|
||||
conn.func_handler.handle_llm_function_call(
|
||||
conn, function_call_data
|
||||
),
|
||||
conn.loop,
|
||||
).result()
|
||||
|
||||
# 转换ToolResult为ActionResponse
|
||||
result = conn._convert_tool_result_to_action_response(tool_result)
|
||||
except Exception as e:
|
||||
conn.logger.bind(tag=TAG).error(f"工具调用失败: {e}")
|
||||
result = ActionResponse(
|
||||
|
||||
Reference in New Issue
Block a user