Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions python/packages/core/agent_framework/_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,7 @@ def convert_message(message: Message) -> list[dict[str, Any]]:
"tool_call_id": c.call_id or "",
"name": c.name or "",
}
if args:
tc["arguments"] = args
tc["arguments"] = args if args is not None else {}
content_items.append(tc)
elif c.type == "function_result":
result_val = c.result
Expand Down
17 changes: 17 additions & 0 deletions python/packages/foundry/tests/test_foundry_evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,23 @@ def test_assistant_with_tool_call(self) -> None:
assert tc["name"] == "get_weather"
assert tc["arguments"] == {"location": "Seattle"}

def test_assistant_with_zero_argument_tool_call(self) -> None:
msg = Message(
"assistant",
[
Content.from_function_call(
call_id="call_3",
name="get_site_summary",
arguments=None,
),
],
)
result = AgentEvalConverter.convert_message(msg)
tc = result[0]["content"][0]
assert tc["type"] == "tool_call"
assert "arguments" in tc
assert tc["arguments"] == {}

def test_assistant_text_and_tool_call(self) -> None:
msg = Message(
"assistant",
Expand Down
Loading