A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 02:15 UTC
[Bugfix] Fix the issue where `reasoning_content` is `None` when Thinkng is enabled and `tool_choice` is set to `'required'`. (#20662)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
Chauncey committed
Jul 9, 2025 at 15:39 UTC
2155e95ef148dce4ffc62ff5bbc718a573cb740c
2 files changed
+6
-1
tests/entrypoints/openai/test_completion_with_function_calling.py
+5
-1
@@ -145,7 +145,11 @@ async def test_function_tool_use(client: openai.AsyncOpenAI, model_name: str,
145
"enable_thinking": enable_thinking
146
}
147
})
148
-
148
+ if enable_thinking:
149
+ assert chat_completion.choices[0].message.\
150
+ reasoning_content is not None
151
+ assert chat_completion.choices[0].message.\
152
+ reasoning_content != ""
153
assert chat_completion.choices[0].message.tool_calls is not None
154
assert len(chat_completion.choices[0].message.tool_calls) > 0
155
else:
vllm/entrypoints/openai/serving_chat.py
+1
@@ -1049,6 +1049,7 @@ class OpenAIServingChat(OpenAIServing):
1049
message = ChatMessage(
1050
role=role,
1051
content="",
1052
+ reasoning_content=reasoning_content,
1053
tool_calls=[
1054
tool_call_class(function=FunctionCall(
1055
name=tool_call.name,