Skip to content

Commit 0b43645

Browse files
majiayu000claude
andcommitted
Simplify error message per reviewer feedback
Address @DarkLight1337's review comment: for "required" or named tool_choice, only --tool-call-parser is needed (--enable-auto-tool-choice is specific to tool_choice="auto"). Signed-off-by: majiayu000 <[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent ea6afbd commit 0b43645

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/entrypoints/openai/test_serving_chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ async def test_tool_choice_validation_without_parser():
14261426
assert hasattr(response_required, "body")
14271427
error_body = response_required.body.decode()
14281428
assert "tool_choice" in error_body
1429-
assert "--enable-auto-tool-choice" in error_body
1429+
assert "--tool-call-parser" in error_body
14301430

14311431
# Test named tool_choice without tool_parser
14321432
req_named = ChatCompletionRequest(
@@ -1439,4 +1439,4 @@ async def test_tool_choice_validation_without_parser():
14391439
assert hasattr(response_named, "body")
14401440
error_body = response_named.body.decode()
14411441
assert "tool_choice" in error_body
1442-
assert "--enable-auto-tool-choice" in error_body
1442+
assert "--tool-call-parser" in error_body

vllm/entrypoints/openai/serving_chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ async def create_chat_completion(
227227
# "required" or named tool requires tool parser
228228
return self.create_error_response(
229229
f'tool_choice="{request.tool_choice}" requires '
230-
"--enable-auto-tool-choice and --tool-call-parser to be set"
230+
"--tool-call-parser to be set"
231231
)
232232

233233
if request.tools is None or (

0 commit comments

Comments
 (0)