Add BatchRequestInput and BatchRequestOutput types (Issue #1937)#2865
Add BatchRequestInput and BatchRequestOutput types (Issue #1937)#2865Sid-V5 wants to merge 6 commits intoopenai:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6049c75cfa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
src/openai/types/__init__.py
Outdated
There was a problem hiding this comment.
Remove escaped newline from types import
This line now contains a literal \n between two from imports, which makes src/openai/types/__init__.py invalid Python and raises a SyntaxError at import time. Because openai/__init__.py imports types unconditionally, this breaks import openai for all users, so the package cannot be used at all until the import is split back into valid separate statements.
Useful? React with 👍 / 👎.
Fixes literal \n between import statements that caused a SyntaxError, as flagged by @chatgpt-codex-connector.
|
Fixed the escaped newline in |
|
Note To use Codex here, create a Codex account and connect to github. |
|
fixed |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0dbfc0feb1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The Batch API always requires a request body — marking it as Optional allowed structurally invalid entries to pass type checks.
|
Made |
added type definitions for
BatchRequestInputandBatchRequestOutput, as requested in issue #1937.Changes
src/openai/types/batch_request_input.py: DefinesBatchRequestInputas aTypedDict.src/openai/types/batch_request_output.py: DefinesBatchRequestOutputand related classes (BatchRequestOutputError,BatchRequestOutputResponse) asBaseModels.src/openai/types/__init__.py: Exported the new types.These types align with the existing patterns in the library (TypedDict for inputs, BaseModel for outputs) and support the Batch API structure.
Resolves #1937