Skip to content

fix(images.edit): update size type annotation to match documentation #2334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
8 changes: 6 additions & 2 deletions src/openai/resources/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def edit(
n: Optional[int] | NotGiven = NOT_GIVEN,
quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | NotGiven = NOT_GIVEN,
response_format: Optional[Literal["url", "b64_json"]] | NotGiven = NOT_GIVEN,
size: Optional[Literal["256x256", "512x512", "1024x1024"]] | NotGiven = NOT_GIVEN,
size: Optional[
Literal["auto", "1024x1024", "1536x1024", "1024x1536", "256x256", "512x512"]
] | NotGiven = NOT_GIVEN,
user: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -434,7 +436,9 @@ async def edit(
n: Optional[int] | NotGiven = NOT_GIVEN,
quality: Optional[Literal["standard", "low", "medium", "high", "auto"]] | NotGiven = NOT_GIVEN,
response_format: Optional[Literal["url", "b64_json"]] | NotGiven = NOT_GIVEN,
size: Optional[Literal["256x256", "512x512", "1024x1024"]] | NotGiven = NOT_GIVEN,
size: Optional[
Literal["auto", "1024x1024", "1536x1024", "1024x1536", "256x256", "512x512"]
] | NotGiven = NOT_GIVEN,
user: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/image_edit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ImageEditParams(TypedDict, total=False):
`gpt-image-1` will always return base64-encoded images.
"""

size: Optional[Literal["256x256", "512x512", "1024x1024"]]
size: Optional[Literal["auto", "1024x1024", "1536x1024", "1024x1536", "256x256", "512x512"]]
"""The size of the generated images.

Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or
Expand Down