From 12b9135334c91b0840c30f2d49fd4a07d7fb5454 Mon Sep 17 00:00:00 2001 From: Sid <138317706+Sid-V5@users.noreply.github.com> Date: Fri, 13 Feb 2026 01:12:15 +0530 Subject: [PATCH 1/5] Add BatchRequestInput type definition --- src/openai/types/batch_request_input.py | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/openai/types/batch_request_input.py diff --git a/src/openai/types/batch_request_input.py b/src/openai/types/batch_request_input.py new file mode 100644 index 0000000000..5a76584d51 --- /dev/null +++ b/src/openai/types/batch_request_input.py @@ -0,0 +1,27 @@ +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["BatchRequestInput"] + + +class BatchRequestInput(TypedDict, total=False): + custom_id: Required[str] + """A developer-provided per-request id that will be used to match outputs to inputs. + + Must be unique for each request in a batch. + """ + + method: Required[Literal["POST"]] + """The HTTP method to be used for the request. Currently only `POST` is supported.""" + + url: Required[str] + """The OpenAI API relative URL to be used for the request. + + Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are + supported. + """ + + body: Optional[object] + """The body of the request.""" From e602c3217f656dc99a5a5d3b655b684c6f38abc6 Mon Sep 17 00:00:00 2001 From: Sid <138317706+Sid-V5@users.noreply.github.com> Date: Fri, 13 Feb 2026 01:12:25 +0530 Subject: [PATCH 2/5] Add BatchRequestOutput type definition --- src/openai/types/batch_request_output.py | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/openai/types/batch_request_output.py diff --git a/src/openai/types/batch_request_output.py b/src/openai/types/batch_request_output.py new file mode 100644 index 0000000000..27bcf0617e --- /dev/null +++ b/src/openai/types/batch_request_output.py @@ -0,0 +1,36 @@ +from typing import Optional + +from .._models import BaseModel + +__all__ = ["BatchRequestOutput", "BatchRequestOutputError", "BatchRequestOutputResponse"] + + +class BatchRequestOutputError(BaseModel): + code: Optional[str] = None + """A machine-readable error code.""" + + message: Optional[str] = None + """A human-readable error message.""" + + +class BatchRequestOutputResponse(BaseModel): + status_code: int + """The HTTP status code of the response.""" + + request_id: str + """An unique identifier for the request.""" + + body: Optional[object] = None + """The JSON body of the response.""" + + +class BatchRequestOutput(BaseModel): + id: str + """The ID of the batch request.""" + + custom_id: str + """A developer-provided per-request id that will be used to match outputs to inputs.""" + + response: Optional[BatchRequestOutputResponse] = None + + error: Optional[BatchRequestOutputError] = None From 6049c75cfa875600503abaa357e1e9d9a89d9bfd Mon Sep 17 00:00:00 2001 From: Sid <138317706+Sid-V5@users.noreply.github.com> Date: Fri, 13 Feb 2026 01:16:02 +0530 Subject: [PATCH 3/5] Export Batch request types in src/openai/types/__init__.py --- src/openai/types/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/openai/types/__init__.py b/src/openai/types/__init__.py index 9190bc146c..928db8106d 100644 --- a/src/openai/types/__init__.py +++ b/src/openai/types/__init__.py @@ -65,6 +65,12 @@ from .video_create_error import VideoCreateError as VideoCreateError from .video_remix_params import VideoRemixParams as VideoRemixParams from .batch_create_params import BatchCreateParams as BatchCreateParams +from .batch_request_input import BatchRequestInput as BatchRequestInput +from .batch_request_output import ( + BatchRequestOutput as BatchRequestOutput, + BatchRequestOutputError as BatchRequestOutputError, + BatchRequestOutputResponse as BatchRequestOutputResponse, +) from .skill_create_params import SkillCreateParams as SkillCreateParams from .skill_update_params import SkillUpdateParams as SkillUpdateParams from .video_create_params import VideoCreateParams as VideoCreateParams @@ -99,8 +105,7 @@ from .vector_store_update_params import VectorStoreUpdateParams as VectorStoreUpdateParams from .container_retrieve_response import ContainerRetrieveResponse as ContainerRetrieveResponse from .moderation_text_input_param import ModerationTextInputParam as ModerationTextInputParam -from .file_chunking_strategy_param import FileChunkingStrategyParam as FileChunkingStrategyParam -from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse +from .file_chunking_strategy_param import FileChunkingStrategyParam as FileChunkingStrategyParam\nfrom .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse from .websocket_connection_options import WebsocketConnectionOptions as WebsocketConnectionOptions from .image_create_variation_params import ImageCreateVariationParams as ImageCreateVariationParams from .image_gen_partial_image_event import ImageGenPartialImageEvent as ImageGenPartialImageEvent From 62495a78e2eb893061015a3edbc96555796c29aa Mon Sep 17 00:00:00 2001 From: Sid <138317706+Sid-V5@users.noreply.github.com> Date: Fri, 13 Feb 2026 02:34:44 +0530 Subject: [PATCH 4/5] Fix SyntaxError: remove escaped newline from types/__init__.py Fixes literal \n between import statements that caused a SyntaxError, as flagged by @chatgpt-codex-connector. --- src/openai/types/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openai/types/__init__.py b/src/openai/types/__init__.py index 928db8106d..bb43041437 100644 --- a/src/openai/types/__init__.py +++ b/src/openai/types/__init__.py @@ -105,7 +105,8 @@ from .vector_store_update_params import VectorStoreUpdateParams as VectorStoreUpdateParams from .container_retrieve_response import ContainerRetrieveResponse as ContainerRetrieveResponse from .moderation_text_input_param import ModerationTextInputParam as ModerationTextInputParam -from .file_chunking_strategy_param import FileChunkingStrategyParam as FileChunkingStrategyParam\nfrom .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse +from .file_chunking_strategy_param import FileChunkingStrategyParam as FileChunkingStrategyParam +from .vector_store_search_response import VectorStoreSearchResponse as VectorStoreSearchResponse from .websocket_connection_options import WebsocketConnectionOptions as WebsocketConnectionOptions from .image_create_variation_params import ImageCreateVariationParams as ImageCreateVariationParams from .image_gen_partial_image_event import ImageGenPartialImageEvent as ImageGenPartialImageEvent From d036b44f44fdce3cc9c3262894496ac297f7d522 Mon Sep 17 00:00:00 2001 From: Sid <138317706+Sid-V5@users.noreply.github.com> Date: Mon, 16 Feb 2026 00:36:00 +0530 Subject: [PATCH 5/5] fix: make body Required in BatchRequestInput MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Batch API always requires a request body — marking it as Optional allowed structurally invalid entries to pass type checks. --- src/openai/types/batch_request_input.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/openai/types/batch_request_input.py b/src/openai/types/batch_request_input.py index 5a76584d51..7a137efff2 100644 --- a/src/openai/types/batch_request_input.py +++ b/src/openai/types/batch_request_input.py @@ -1,6 +1,5 @@ from __future__ import annotations -from typing import Optional from typing_extensions import Literal, Required, TypedDict __all__ = ["BatchRequestInput"] @@ -23,5 +22,5 @@ class BatchRequestInput(TypedDict, total=False): supported. """ - body: Optional[object] + body: Required[object] """The body of the request."""