Skip to content

Add BatchRequestInput and BatchRequestOutput types (Issue #1937)#2865

Open
Sid-V5 wants to merge 6 commits intoopenai:mainfrom
Sid-V5:fix-batch-types-1937
Open

Add BatchRequestInput and BatchRequestOutput types (Issue #1937)#2865
Sid-V5 wants to merge 6 commits intoopenai:mainfrom
Sid-V5:fix-batch-types-1937

Conversation

@Sid-V5
Copy link

@Sid-V5 Sid-V5 commented Feb 12, 2026

added type definitions for BatchRequestInput and BatchRequestOutput, as requested in issue #1937.

Changes

  • Added src/openai/types/batch_request_input.py: Defines BatchRequestInput as a TypedDict.
  • Added src/openai/types/batch_request_output.py: Defines BatchRequestOutput and related classes (BatchRequestOutputError, BatchRequestOutputResponse) as BaseModels.
  • Updated 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

@Sid-V5 Sid-V5 requested a review from a team as a code owner February 12, 2026 19:46
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge 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.
@Sid-V5
Copy link
Author

Sid-V5 commented Feb 12, 2026

Fixed the escaped newline in src/openai/types/__init__.py

@chatgpt-codex-connector
Copy link

@Sid-V5
Copy link
Author

Sid-V5 commented Feb 12, 2026

fixed

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.
@Sid-V5
Copy link
Author

Sid-V5 commented Feb 15, 2026

Made body a Required field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

types: Missing type for batch request input and output objects

1 participant

Comments