Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
9419e75d
Unverified
Commit
9419e75d
authored
Apr 29, 2025
by
Chang Su
Committed by
GitHub
Apr 29, 2025
Browse files
[CI] Add test_function_calling.py to run_suite.py (#5896)
parent
2c7dbb7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
test/srt/run_suite.py
test/srt/run_suite.py
+1
-0
test/srt/test_function_calling.py
test/srt/test_function_calling.py
+6
-5
No files found.
test/srt/run_suite.py
View file @
9419e75d
...
@@ -36,6 +36,7 @@ suites = {
...
@@ -36,6 +36,7 @@ suites = {
TestFile
(
"test_fa3.py"
,
376
),
TestFile
(
"test_fa3.py"
,
376
),
TestFile
(
"test_fim_completion.py"
,
40
),
TestFile
(
"test_fim_completion.py"
,
40
),
TestFile
(
"test_fp8_kernel.py"
,
8
),
TestFile
(
"test_fp8_kernel.py"
,
8
),
TestFile
(
"test_function_calling.py"
,
35
),
TestFile
(
"test_fused_moe.py"
,
30
),
TestFile
(
"test_fused_moe.py"
,
30
),
TestFile
(
"test_hicache.py"
,
116
),
TestFile
(
"test_hicache.py"
,
116
),
TestFile
(
"test_hicache_mla.py"
,
254
),
TestFile
(
"test_hicache_mla.py"
,
254
),
...
...
test/srt/test_function_calling.py
View file @
9419e75d
...
@@ -182,16 +182,17 @@ class TestOpenAIServerFunctionCalling(CustomTestCase):
...
@@ -182,16 +182,17 @@ class TestOpenAIServerFunctionCalling(CustomTestCase):
"type"
:
"object"
,
"type"
:
"object"
,
"properties"
:
{
"properties"
:
{
"a"
:
{
"a"
:
{
"type"
:
"int"
,
"type"
:
"int
eger
"
,
"description"
:
"First integer"
,
"description"
:
"First integer"
,
},
},
"b"
:
{
"b"
:
{
"type"
:
"int"
,
"type"
:
"int
eger
"
,
"description"
:
"Second integer"
,
"description"
:
"Second integer"
,
},
},
},
},
"required"
:
[
"a"
,
"b"
],
"required"
:
[
"a"
,
"b"
],
},
},
"strict"
:
True
,
# Llama-3.2-1B is flaky in tool call. It won't always respond with parameters unless we set strict.
},
},
}
}
]
]
...
@@ -218,7 +219,7 @@ class TestOpenAIServerFunctionCalling(CustomTestCase):
...
@@ -218,7 +219,7 @@ class TestOpenAIServerFunctionCalling(CustomTestCase):
# Record the function name on first occurrence
# Record the function name on first occurrence
function_name
=
tool_call
.
function
.
name
or
function_name
function_name
=
tool_call
.
function
.
name
or
function_name
# In case of multiple chunks, JSON fragments may need to be concatenated
# In case of multiple chunks, JSON fragments may need to be concatenated
if
tool_call
.
function
.
arguments
:
if
tool_call
.
function
.
arguments
is
not
None
:
argument_fragments
.
append
(
tool_call
.
function
.
arguments
)
argument_fragments
.
append
(
tool_call
.
function
.
arguments
)
self
.
assertEqual
(
function_name
,
"add"
,
"Function name should be 'add'"
)
self
.
assertEqual
(
function_name
,
"add"
,
"Function name should be 'add'"
)
...
@@ -258,11 +259,11 @@ class TestOpenAIServerFunctionCalling(CustomTestCase):
...
@@ -258,11 +259,11 @@ class TestOpenAIServerFunctionCalling(CustomTestCase):
"type"
:
"object"
,
"type"
:
"object"
,
"properties"
:
{
"properties"
:
{
"int_a"
:
{
"int_a"
:
{
"type"
:
"int"
,
"type"
:
"int
eger
"
,
"description"
:
"First integer"
,
"description"
:
"First integer"
,
},
},
"int_b"
:
{
"int_b"
:
{
"type"
:
"int"
,
"type"
:
"int
eger
"
,
"description"
:
"Second integer"
,
"description"
:
"Second integer"
,
},
},
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment