Commit ba6928cf authored by Breno Baldas Skuk's avatar Breno Baldas Skuk Committed by simon-mo
Browse files

fix: OpenAI SDK compat (ResponseTextConfig) (#23126)


Signed-off-by: default avatarbreno.skuk <breno.skuk@hcompany.ai>
Signed-off-by: default avatarBreno Baldas Skuk <breno.skuk@hcompany.ai>
Signed-off-by: default avatarmgoin <mgoin64@gmail.com>
Co-authored-by: default avatargemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: default avatarMichael Goin <mgoin64@gmail.com>
parent befedf86
...@@ -12,7 +12,7 @@ tokenizers >= 0.21.1 # Required for fast incremental detokenization. ...@@ -12,7 +12,7 @@ tokenizers >= 0.21.1 # Required for fast incremental detokenization.
protobuf # Required by LlamaTokenizer. protobuf # Required by LlamaTokenizer.
fastapi[standard] >= 0.115.0 # Required by FastAPI's form models in the OpenAI API server's audio transcriptions endpoint. fastapi[standard] >= 0.115.0 # Required by FastAPI's form models in the OpenAI API server's audio transcriptions endpoint.
aiohttp aiohttp
openai >= 1.99.1, < 1.100.0 # For Responses API with reasoning content openai >= 1.99.1 # For Responses API with reasoning content
pydantic >= 2.10 pydantic >= 2.10
prometheus_client >= 0.18.0 prometheus_client >= 0.18.0
pillow # Required for image processing pillow # Required for image processing
......
...@@ -18,7 +18,7 @@ cbor2 ...@@ -18,7 +18,7 @@ cbor2
cloudpickle cloudpickle
fastapi fastapi
msgspec msgspec
openai < 1.100.0 openai
openai-harmony openai-harmony
partial-json-parser partial-json-parser
pillow pillow
......
...@@ -20,7 +20,15 @@ from openai.types.chat.chat_completion_message import ( ...@@ -20,7 +20,15 @@ from openai.types.chat.chat_completion_message import (
from openai.types.responses import (ResponseFunctionToolCall, from openai.types.responses import (ResponseFunctionToolCall,
ResponseInputItemParam, ResponseOutputItem, ResponseInputItemParam, ResponseOutputItem,
ResponsePrompt, ResponseReasoningItem, ResponsePrompt, ResponseReasoningItem,
ResponseStatus, ResponseTextConfig) ResponseStatus)
# 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 ToolChoice from openai.types.responses.response import ToolChoice
from openai.types.responses.tool import Tool from openai.types.responses.tool import Tool
from openai.types.shared import Metadata, Reasoning from openai.types.shared import Metadata, Reasoning
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment