Use ToolResult in litellm (#182546)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Paulus Schoutsen
2026-09-18 15:20:13 +00:00
committed by GitHub
co-authored by Claude
parent ff59823e3c
commit 6177c711d2
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -60,7 +60,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',
}),