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
e39bca07
Unverified
Commit
e39bca07
authored
May 30, 2025
by
Chang Su
Committed by
GitHub
May 30, 2025
Browse files
ci: relax test_function_call_required (#6786)
parent
a2bb8565
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
test/srt/test_openai_function_calling.py
test/srt/test_openai_function_calling.py
+17
-4
No files found.
test/srt/test_openai_function_calling.py
View file @
e39bca07
...
...
@@ -357,12 +357,25 @@ class TestOpenAIServerFunctionCalling(CustomTestCase):
args_obj
=
json
.
loads
(
arguments
)
self
.
assertEqual
(
function_name
,
"get_weather"
,
"Function name should be 'get_weather'"
function_name
,
"get_weather"
,
f
"Function name should be 'get_weather', got:
{
function_name
}
"
,
)
self
.
assertIn
(
"city"
,
args_obj
,
"Function arguments should have 'city'"
)
self
.
assertIn
(
"Paris"
,
args_obj
[
"city"
],
"Parameter city should contain 'Paris'"
)
# might be flaky
"city"
,
args_obj
,
f
"Function arguments should have 'city', got:
{
args_obj
}
"
)
# Make the test more robust by checking type and accepting valid responses
city_value
=
args_obj
[
"city"
]
self
.
assertIsInstance
(
city_value
,
str
,
f
"Parameter city should be a string, got:
{
type
(
city_value
)
}
"
,
)
self
.
assertTrue
(
"Paris"
in
city_value
or
"France"
in
city_value
,
f
"Parameter city should contain either 'Paris' or 'France', got:
{
city_value
}
"
,
)
def
test_function_call_specific
(
self
):
"""
...
...
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