mirror of
https://github.com/vllm-project/vllm.git
synced 2025-10-20 23:03:52 +08:00
[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>
This commit is contained in:
@ -145,7 +145,11 @@ async def test_function_tool_use(client: openai.AsyncOpenAI, model_name: str,
|
|||||||
"enable_thinking": enable_thinking
|
"enable_thinking": enable_thinking
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if enable_thinking:
|
||||||
|
assert chat_completion.choices[0].message.\
|
||||||
|
reasoning_content is not None
|
||||||
|
assert chat_completion.choices[0].message.\
|
||||||
|
reasoning_content != ""
|
||||||
assert chat_completion.choices[0].message.tool_calls is not None
|
assert chat_completion.choices[0].message.tool_calls is not None
|
||||||
assert len(chat_completion.choices[0].message.tool_calls) > 0
|
assert len(chat_completion.choices[0].message.tool_calls) > 0
|
||||||
else:
|
else:
|
||||||
|
@ -1049,6 +1049,7 @@ class OpenAIServingChat(OpenAIServing):
|
|||||||
message = ChatMessage(
|
message = ChatMessage(
|
||||||
role=role,
|
role=role,
|
||||||
content="",
|
content="",
|
||||||
|
reasoning_content=reasoning_content,
|
||||||
tool_calls=[
|
tool_calls=[
|
||||||
tool_call_class(function=FunctionCall(
|
tool_call_class(function=FunctionCall(
|
||||||
name=tool_call.name,
|
name=tool_call.name,
|
||||||
|
Reference in New Issue
Block a user