@@ -92,6 +92,7 @@ def do_test_completion_with_required_tool_tiny(server: ServerProcess, tool: dict
92
92
assert tool_calls and len (tool_calls ) == 1 , f'Expected 1 tool call in { choice ["message" ]} '
93
93
tool_call = tool_calls [0 ]
94
94
assert choice ["message" ].get ("content" ) in (None , "" ), f'Expected no content in { choice ["message" ]} '
95
+ assert len (tool_call .get ("id" , "" )) > 0 , f'Expected non empty tool call id in { tool_call } '
95
96
expected_function_name = "python" if tool ["type" ] == "code_interpreter" else tool ["function" ]["name" ]
96
97
assert expected_function_name == tool_call ["function" ]["name" ]
97
98
actual_arguments = tool_call ["function" ]["arguments" ]
@@ -373,6 +374,7 @@ def do_test_weather(server: ServerProcess, **kwargs):
373
374
tool_call = tool_calls [0 ]
374
375
# assert choice["message"].get("content") in (None, ""), f'Expected no content in {choice["message"]}'
375
376
assert tool_call ["function" ]["name" ] == WEATHER_TOOL ["function" ]["name" ], f'Expected weather tool call, got { tool_call ["function" ]["name" ]} '
377
+ assert len (tool_call .get ("id" , "" )) > 0 , f'Expected non empty tool call id in { tool_call } '
376
378
actual_arguments = json .loads (tool_call ["function" ]["arguments" ])
377
379
assert 'location' in actual_arguments , f"location not found in { json .dumps (actual_arguments )} "
378
380
location = actual_arguments ["location" ]
@@ -596,6 +598,7 @@ def do_test_hello_world(server: ServerProcess, **kwargs):
596
598
tool_call = tool_calls [0 ]
597
599
# assert choice["message"].get("content") in (None, ""), f'Expected no content in {choice["message"]}'
598
600
assert tool_call ["function" ]["name" ] == PYTHON_TOOL ["function" ]["name" ]
601
+ assert len (tool_call .get ("id" , "" )) > 0 , f'Expected non empty tool call id in { tool_call } '
599
602
actual_arguments = json .loads (tool_call ["function" ]["arguments" ])
600
603
assert 'code' in actual_arguments , f"code not found in { json .dumps (actual_arguments )} "
601
604
code = actual_arguments ["code" ]
0 commit comments