Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
2ed3f20d
Unverified
Commit
2ed3f20d
authored
Oct 03, 2025
by
kyt
Committed by
GitHub
Oct 03, 2025
Browse files
[openai] Fix missing tool usage check (system message) (#24768)
Signed-off-by:
kyt
<
eluban4532@gmail.com
>
parent
48f30902
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
tests/entrypoints/openai/test_response_api_with_harmony.py
tests/entrypoints/openai/test_response_api_with_harmony.py
+16
-0
vllm/entrypoints/openai/serving_chat.py
vllm/entrypoints/openai/serving_chat.py
+3
-1
No files found.
tests/entrypoints/openai/test_response_api_with_harmony.py
View file @
2ed3f20d
...
...
@@ -698,6 +698,22 @@ async def test_function_calling_required(client: OpenAI, model_name: str):
)
@
pytest
.
mark
.
asyncio
@
pytest
.
mark
.
parametrize
(
"model_name"
,
[
MODEL_NAME
])
async
def
test_system_message_with_tools
(
client
:
OpenAI
,
model_name
:
str
):
from
vllm.entrypoints.harmony_utils
import
get_system_message
# Test with custom tools enabled - commentary channel should be available
sys_msg
=
get_system_message
(
with_custom_tools
=
True
)
valid_channels
=
sys_msg
.
content
[
0
].
channel_config
.
valid_channels
assert
"commentary"
in
valid_channels
# Test with custom tools disabled - commentary channel should be removed
sys_msg
=
get_system_message
(
with_custom_tools
=
False
)
valid_channels
=
sys_msg
.
content
[
0
].
channel_config
.
valid_channels
assert
"commentary"
not
in
valid_channels
@
pytest
.
mark
.
asyncio
@
pytest
.
mark
.
parametrize
(
"model_name"
,
[
MODEL_NAME
])
async
def
test_function_calling_full_history
(
client
:
OpenAI
,
model_name
:
str
):
...
...
vllm/entrypoints/openai/serving_chat.py
View file @
2ed3f20d
...
...
@@ -1575,7 +1575,9 @@ class OpenAIServingChat(OpenAIServing):
sys_msg
=
get_system_message
(
reasoning_effort
=
request
.
reasoning_effort
,
browser_description
=
None
,
python_description
=
None
)
python_description
=
None
,
with_custom_tools
=
request
.
tools
is
not
None
)
messages
.
append
(
sys_msg
)
# Add developer message.
...
...
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