From b322b197f17c8164cff0d1e7346def9ffc41573c Mon Sep 17 00:00:00 2001 From: Chauncey Date: Wed, 18 Mar 2026 18:20:10 +0800 Subject: [PATCH] [Build] Bump python openai version (#32316) Signed-off-by: chaunceyjiang --- requirements/common.txt | 2 +- tests/entrypoints/openai/responses/conftest.py | 2 +- .../openai/responses/test_function_call.py | 15 +++++++++------ vllm/entrypoints/openai/responses/protocol.py | 12 +++--------- vllm/tool_parsers/abstract_tool_parser.py | 4 ++-- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/requirements/common.txt b/requirements/common.txt index d96928f06b..05666c5d14 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -12,7 +12,7 @@ tokenizers >= 0.21.1 # Required for fast incremental detokenization. protobuf >= 5.29.6, !=6.30.*, !=6.31.*, !=6.32.*, !=6.33.0.*, !=6.33.1.*, !=6.33.2.*, !=6.33.3.*, !=6.33.4.* # Required by LlamaTokenizer, gRPC. CVE-2026-0994 fastapi[standard] >= 0.115.0 # Required by FastAPI's form models in the OpenAI API server's audio transcriptions endpoint. aiohttp >= 3.13.3 -openai >= 1.99.1, < 2.25.0 # For Responses API with reasoning content +openai >= 2.0.0 # For Responses API with reasoning content pydantic >= 2.12.0 prometheus_client >= 0.18.0 pillow # Required for image processing diff --git a/tests/entrypoints/openai/responses/conftest.py b/tests/entrypoints/openai/responses/conftest.py index 68fdbbba3b..a1d16b1231 100644 --- a/tests/entrypoints/openai/responses/conftest.py +++ b/tests/entrypoints/openai/responses/conftest.py @@ -370,7 +370,7 @@ def log_response_diagnostics( def default_server_args(): return [ "--max-model-len", - "8192", + "18192", "--enforce-eager", # For faster startup. "--enable-auto-tool-choice", "--structured-outputs-config.backend", diff --git a/tests/entrypoints/openai/responses/test_function_call.py b/tests/entrypoints/openai/responses/test_function_call.py index 36627f92d7..bacb084c7e 100644 --- a/tests/entrypoints/openai/responses/test_function_call.py +++ b/tests/entrypoints/openai/responses/test_function_call.py @@ -118,7 +118,6 @@ async def test_function_tool_use( tool_choice=tool_choice, temperature=0.0, ) - assert len(response.output) >= 1 tool_call = None reasoning = None @@ -127,11 +126,15 @@ async def test_function_tool_use( tool_call = out if out.type == "reasoning": reasoning = out - assert tool_call is not None - assert tool_call.type == "function_call" - assert json.loads(tool_call.arguments) is not None - assert reasoning is not None - assert reasoning.type == "reasoning" + if response.incomplete_details is None: + assert tool_call is not None + assert tool_call.type == "function_call" + assert json.loads(tool_call.arguments) is not None + assert reasoning is not None + assert reasoning.type == "reasoning" + else: + print(response.model_dump_json(indent=2)) + assert response.incomplete_details.reason == "max_output_tokens" @pytest.mark.asyncio diff --git a/vllm/entrypoints/openai/responses/protocol.py b/vllm/entrypoints/openai/responses/protocol.py index 2adcd9eaa0..a5f62bdd8c 100644 --- a/vllm/entrypoints/openai/responses/protocol.py +++ b/vllm/entrypoints/openai/responses/protocol.py @@ -27,6 +27,7 @@ from openai.types.responses import ( ResponseReasoningTextDeltaEvent, ResponseReasoningTextDoneEvent, ResponseStatus, + ResponseTextConfig, ResponseWebSearchCallCompletedEvent, ResponseWebSearchCallInProgressEvent, ResponseWebSearchCallSearchingEvent, @@ -38,20 +39,13 @@ from openai.types.responses import ResponseCreatedEvent as OpenAIResponseCreated from openai.types.responses import ( ResponseInProgressEvent as OpenAIResponseInProgressEvent, ) -from openai.types.responses.tool import Tool -from openai_harmony import Message as OpenAIHarmonyMessage - -# Backward compatibility for OpenAI client versions -try: # For older openai versions (< 1.100.0) - from openai.types.responses import ResponseTextConfig -except ImportError: # For newer openai versions (>= 1.100.0) - from openai.types.responses import ResponseFormatTextConfig as ResponseTextConfig - from openai.types.responses.response import IncompleteDetails, ToolChoice from openai.types.responses.response_reasoning_item import ( Content as ResponseReasoningTextContent, ) +from openai.types.responses.tool import Tool from openai.types.shared import Metadata, Reasoning +from openai_harmony import Message as OpenAIHarmonyMessage from pydantic import ( Field, ValidationError, diff --git a/vllm/tool_parsers/abstract_tool_parser.py b/vllm/tool_parsers/abstract_tool_parser.py index 81ee4ea671..a2c2f06278 100644 --- a/vllm/tool_parsers/abstract_tool_parser.py +++ b/vllm/tool_parsers/abstract_tool_parser.py @@ -6,8 +6,9 @@ import os from collections.abc import Callable, Sequence from functools import cached_property -from openai.types.responses.response_format_text_json_schema_config import ( +from openai.types.responses import ( ResponseFormatTextJSONSchemaConfig, + ResponseTextConfig, ) from vllm.entrypoints.openai.chat_completion.protocol import ChatCompletionRequest @@ -17,7 +18,6 @@ from vllm.entrypoints.openai.engine.protocol import ( ) from vllm.entrypoints.openai.responses.protocol import ( ResponsesRequest, - ResponseTextConfig, ) from vllm.logger import init_logger from vllm.sampling_params import (