Skip to content

Commit 9419e75

Browse files
authored
[CI] Add test_function_calling.py to run_suite.py (#5896)
1 parent 2c7dbb7 commit 9419e75

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

test/srt/run_suite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class TestFile:
3636
TestFile("test_fa3.py", 376),
3737
TestFile("test_fim_completion.py", 40),
3838
TestFile("test_fp8_kernel.py", 8),
39+
TestFile("test_function_calling.py", 35),
3940
TestFile("test_fused_moe.py", 30),
4041
TestFile("test_hicache.py", 116),
4142
TestFile("test_hicache_mla.py", 254),

test/srt/test_function_calling.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,17 @@ def test_function_calling_streaming_args_parsing(self):
182182
"type": "object",
183183
"properties": {
184184
"a": {
185-
"type": "int",
185+
"type": "integer",
186186
"description": "First integer",
187187
},
188188
"b": {
189-
"type": "int",
189+
"type": "integer",
190190
"description": "Second integer",
191191
},
192192
},
193193
"required": ["a", "b"],
194194
},
195+
"strict": True, # Llama-3.2-1B is flaky in tool call. It won't always respond with parameters unless we set strict.
195196
},
196197
}
197198
]
@@ -218,7 +219,7 @@ def test_function_calling_streaming_args_parsing(self):
218219
# Record the function name on first occurrence
219220
function_name = tool_call.function.name or function_name
220221
# In case of multiple chunks, JSON fragments may need to be concatenated
221-
if tool_call.function.arguments:
222+
if tool_call.function.arguments is not None:
222223
argument_fragments.append(tool_call.function.arguments)
223224

224225
self.assertEqual(function_name, "add", "Function name should be 'add'")
@@ -258,11 +259,11 @@ def test_function_call_strict(self):
258259
"type": "object",
259260
"properties": {
260261
"int_a": {
261-
"type": "int",
262+
"type": "integer",
262263
"description": "First integer",
263264
},
264265
"int_b": {
265-
"type": "int",
266+
"type": "integer",
266267
"description": "Second integer",
267268
},
268269
},

0 commit comments

Comments
 (0)