Use ToolResult in open_router (#182549)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Paulus Schoutsen
2026-09-18 15:25:28 +00:00
committed by GitHub
co-authored by Claude
parent 6081351f8a
commit 434a246b64
2 changed files with 5 additions and 3 deletions
@@ -109,7 +109,9 @@ def _convert_content_to_chat_message(
return ChatCompletionToolMessageParam(
role="tool",
tool_call_id=content.tool_call_id,
content=json_dumps(content.tool_result),
content=json_dumps(
{"data": content.result.data, "error": content.result.error}
),
)
role: Literal["user", "assistant", "system"] = content.role
@@ -262,7 +262,7 @@
]),
}),
dict({
'content': '{"speech":{"plain":{"speech":"12:00 PM","extra_data":null}},"response_type":"action_done","speech_slots":{"time":"12:00:00"},"data":{"success":[],"failed":[]}}',
'content': '{"data":{"speech":{"plain":{"speech":"12:00 PM","extra_data":null}},"response_type":"action_done","speech_slots":{"time":"12:00:00"},"data":{"success":[],"failed":[]}},"error":false}',
'role': 'tool',
'tool_call_id': 'mock_tool_call_id',
}),
@@ -289,7 +289,7 @@
]),
}),
dict({
'content': '"value1"',
'content': '{"data":"value1","error":false}',
'role': 'tool',
'tool_call_id': 'call_call_1',
}),