mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-14 01:41:25 -06:00
Fix empty list in content on tool calls causing ollama parse error (#102)
This is related to google/adk-python#49
This commit is contained in:
parent
089c1e6428
commit
cfbcc17644
@ -178,7 +178,7 @@ def _content_to_message_param(
|
||||
|
||||
return ChatCompletionAssistantMessage(
|
||||
role=role,
|
||||
content=_get_content(content.parts),
|
||||
content=_get_content(content.parts) or None,
|
||||
tool_calls=tool_calls or None,
|
||||
)
|
||||
|
||||
|
@ -536,7 +536,7 @@ def test_content_to_message_param_function_call():
|
||||
content.parts[0].function_call.id = "test_tool_call_id"
|
||||
message = _content_to_message_param(content)
|
||||
assert message["role"] == "assistant"
|
||||
assert message["content"] == []
|
||||
assert message["content"] == None
|
||||
assert message["tool_calls"][0].type == "function"
|
||||
assert message["tool_calls"][0].id == "test_tool_call_id"
|
||||
assert message["tool_calls"][0].function.name == "test_function"
|
||||
|
Loading…
Reference in New Issue
Block a user