fix anthropic tool result format (#2246)

This commit is contained in:
Shuchang Zheng
2025-04-29 04:17:50 +08:00
committed by GitHub
parent 2f10e3c430
commit f4ea546ae4
4 changed files with 15 additions and 4 deletions

View File

@@ -371,7 +371,7 @@ class ActionHandler:
tool_call_result = {
"type": "tool_result",
"tool_use_id": action.tool_call_id,
"content": {"result": "Tool execution failed"},
"content": "Tool execution failed",
}
llm_caller.add_tool_result(tool_call_result)
LOG.info("Tool call result", tool_call_result=tool_call_result, action=action)
@@ -381,7 +381,7 @@ class ActionHandler:
tool_call_result = {
"type": "tool_result",
"tool_use_id": action.tool_call_id,
"content": {"result": "Tool executed successfully"},
"content": "Tool executed successfully",
}
LOG.info("Tool call result", tool_call_result=tool_call_result, action=action)
llm_caller.add_tool_result(tool_call_result)