diff --git a/tests/entrypoints/openai/test_completion_with_function_calling.py b/tests/entrypoints/openai/test_completion_with_function_calling.py index 84ad7a0916..799648d399 100644 --- a/tests/entrypoints/openai/test_completion_with_function_calling.py +++ b/tests/entrypoints/openai/test_completion_with_function_calling.py @@ -145,7 +145,11 @@ async def test_function_tool_use(client: openai.AsyncOpenAI, model_name: str, "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 len(chat_completion.choices[0].message.tool_calls) > 0 else: diff --git a/vllm/entrypoints/openai/serving_chat.py b/vllm/entrypoints/openai/serving_chat.py index a802fbc386..451241d3f9 100644 --- a/vllm/entrypoints/openai/serving_chat.py +++ b/vllm/entrypoints/openai/serving_chat.py @@ -1049,6 +1049,7 @@ class OpenAIServingChat(OpenAIServing): message = ChatMessage( role=role, content="", + reasoning_content=reasoning_content, tool_calls=[ tool_call_class(function=FunctionCall( name=tool_call.name,