Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/openai/types/responses/response_input_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,21 @@ class ImageGenerationCall(BaseModel):
type: Literal["image_generation_call"]
"""The type of the image generation call. Always `image_generation_call`."""

background: Optional[Literal["transparent", "opaque", "auto"]] = None
"""The background setting used for the generated image."""

output_format: Optional[Literal["png", "webp", "jpeg"]] = None
"""The output format of the generated image."""

quality: Optional[Literal["low", "medium", "high", "auto"]] = None
"""The quality setting used for the generated image."""

revised_prompt: Optional[str] = None
"""The revised prompt that was used to generate the image, if applicable."""

size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = None
"""The size of the generated image."""


class LocalShellCallAction(BaseModel):
"""Execute a shell command on the server."""
Expand Down
15 changes: 15 additions & 0 deletions src/openai/types/responses/response_input_item_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,21 @@ class ImageGenerationCall(TypedDict, total=False):
type: Required[Literal["image_generation_call"]]
"""The type of the image generation call. Always `image_generation_call`."""

background: Optional[Literal["transparent", "opaque", "auto"]]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the fields to the primary response input type

This updates response_input_item_param.py, but the main client.responses.create(...) overloads import ResponseInputParam from src/openai/types/responses/response_input_param.py, which contains a duplicate ImageGenerationCall TypedDict that still lacks these keys. In the common case of feeding a returned image_generation_call item back through responses.create(input=[...]), type checkers will still reject background, output_format, quality, revised_prompt, and size; add the same fields to the duplicate response_input_param.py definition as well.

Useful? React with 👍 / 👎.

"""The background setting used for the generated image."""

output_format: Optional[Literal["png", "webp", "jpeg"]]
"""The output format of the generated image."""

quality: Optional[Literal["low", "medium", "high", "auto"]]
"""The quality setting used for the generated image."""

revised_prompt: Optional[str]
"""The revised prompt that was used to generate the image, if applicable."""

size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]]
"""The size of the generated image."""


class LocalShellCallAction(TypedDict, total=False):
"""Execute a shell command on the server."""
Expand Down
15 changes: 15 additions & 0 deletions src/openai/types/responses/response_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ class ImageGenerationCall(BaseModel):
type: Literal["image_generation_call"]
"""The type of the image generation call. Always `image_generation_call`."""

background: Optional[Literal["transparent", "opaque", "auto"]] = None
"""The background setting used for the generated image."""

output_format: Optional[Literal["png", "webp", "jpeg"]] = None
"""The output format of the generated image."""

quality: Optional[Literal["low", "medium", "high", "auto"]] = None
"""The quality setting used for the generated image."""

revised_prompt: Optional[str] = None
"""The revised prompt that was used to generate the image, if applicable."""

size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = None
"""The size of the generated image."""


class LocalShellCallAction(BaseModel):
"""Execute a shell command on the server."""
Expand Down
15 changes: 15 additions & 0 deletions src/openai/types/responses/response_output_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ class ImageGenerationCall(BaseModel):
type: Literal["image_generation_call"]
"""The type of the image generation call. Always `image_generation_call`."""

background: Optional[Literal["transparent", "opaque", "auto"]] = None
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep ConversationItem's image call model in sync

The conversations item endpoints cast returned items to src/openai/types/conversations/conversation_item.py::ConversationItem, which has its own duplicate ImageGenerationCall model that was not updated here. When an image generation call is retrieved or listed via client.conversations.items.*, these newly documented attributes are still absent from the typed model/autocomplete for that API surface, so the type fix remains incomplete for conversation-stored response items.

Useful? React with 👍 / 👎.

"""The background setting used for the generated image."""

output_format: Optional[Literal["png", "webp", "jpeg"]] = None
"""The output format of the generated image."""

quality: Optional[Literal["low", "medium", "high", "auto"]] = None
"""The quality setting used for the generated image."""

revised_prompt: Optional[str] = None
"""The revised prompt that was used to generate the image, if applicable."""

size: Optional[Literal["1024x1024", "1024x1536", "1536x1024", "auto"]] = None
"""The size of the generated image."""


class LocalShellCallAction(BaseModel):
"""Execute a shell command on the server."""
Expand Down