fix: OpenAI SDK compat (ResponseTextConfig) (#23126)
Signed-off-by: breno.skuk <breno.skuk@hcompany.ai> Signed-off-by: Breno Baldas Skuk <breno.skuk@hcompany.ai> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Michael Goin <mgoin64@gmail.com>
This commit is contained in:
committed by
GitHub
parent
bf756321c7
commit
ac6eb49de3
@@ -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
|
|||||||
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 (
|
|||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user