From 941e52c29813ed75b3382f2a0d74ad5f168fc046 Mon Sep 17 00:00:00 2001 From: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Date: Mon, 9 Mar 2026 11:33:46 -0400 Subject: [PATCH] [Refactor] Simplify `chat_completion_full_generator` for tool parsers (#35634) Signed-off-by: yewentao256 --- vllm/entrypoints/openai/chat_completion/serving.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/vllm/entrypoints/openai/chat_completion/serving.py b/vllm/entrypoints/openai/chat_completion/serving.py index 4f1196281e..eb39e649a7 100644 --- a/vllm/entrypoints/openai/chat_completion/serving.py +++ b/vllm/entrypoints/openai/chat_completion/serving.py @@ -1463,17 +1463,7 @@ class OpenAIServingChat(OpenAIServing): tool_call_class = ( MistralToolCall if is_mistral_tokenizer(tokenizer) else ToolCall ) - if self.use_harmony: - # Harmony models already have parsed content and tool_calls - # through parse_chat_output. Respect its output directly. - message = ChatMessage( - role=role, - reasoning=reasoning, - content=content, - tool_calls=tool_calls if tool_calls else [], - ) - - elif (not self.enable_auto_tools or not self.tool_parser) and ( + if (not self.enable_auto_tools or not self.tool_parser) and ( not isinstance(request.tool_choice, ChatCompletionNamedToolChoiceParam) and request.tool_choice != "required" ):