Skip to content

Commit 7d96513

Browse files
feat(api): image generation actions for responses; ResponseFunctionCallArgumentsDoneEvent.name
1 parent 9f43c8b commit 7d96513

File tree

6 files changed

+19
-10
lines changed

6 files changed

+19
-10
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 137
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-7a6ba5212fa9680f9489f4e73c298e1e8f78106b83a465e76290d45fc2fccb70.yml
3-
openapi_spec_hash: 3d3379b7dbf6af484944bc678ec9bf4c
4-
config_hash: a08002d1759a1d0bde3429dccc58d1ef
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-b956f0004bb930006f4b8d24734b20e89c7420ca6635dd358b9f0299c8ac8d62.yml
3+
openapi_spec_hash: 91b1b7bf3c1a6b6c9c7507d4cac8fe2a
4+
config_hash: 9501b3367f98ede2729f1bfffb3a803a

src/openai/types/realtime/response_function_call_arguments_done_event.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class ResponseFunctionCallArgumentsDoneEvent(BaseModel):
2525
item_id: str
2626
"""The ID of the function call item."""
2727

28+
name: str
29+
"""The name of the function that was called."""
30+
2831
output_index: int
2932
"""The index of the output item in the response."""
3033

src/openai/types/responses/response_function_web_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ActionOpenPage(BaseModel):
4141
type: Literal["open_page"]
4242
"""The action type."""
4343

44-
url: str
44+
url: Optional[str] = None
4545
"""The URL opened by the model."""
4646

4747

@@ -74,7 +74,7 @@ class ResponseFunctionWebSearch(BaseModel):
7474
action: Action
7575
"""
7676
An object describing the specific action taken in this web search call. Includes
77-
details on how the model used the web (search, open_page, find).
77+
details on how the model used the web (search, open_page, find_in_page).
7878
"""
7979

8080
status: Literal["in_progress", "searching", "completed", "failed"]

src/openai/types/responses/response_function_web_search_param.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Union, Iterable
5+
from typing import Union, Iterable, Optional
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from ..._types import SequenceNotStr
@@ -49,7 +49,7 @@ class ActionOpenPage(TypedDict, total=False):
4949
type: Required[Literal["open_page"]]
5050
"""The action type."""
5151

52-
url: Required[str]
52+
url: Optional[str]
5353
"""The URL opened by the model."""
5454

5555

@@ -82,7 +82,7 @@ class ResponseFunctionWebSearchParam(TypedDict, total=False):
8282
action: Required[Action]
8383
"""
8484
An object describing the specific action taken in this web search call. Includes
85-
details on how the model used the web (search, open_page, find).
85+
details on how the model used the web (search, open_page, find_in_page).
8686
"""
8787

8888
status: Required[Literal["in_progress", "searching", "completed", "failed"]]

src/openai/types/responses/tool.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ class ImageGeneration(BaseModel):
227227
type: Literal["image_generation"]
228228
"""The type of the image generation tool. Always `image_generation`."""
229229

230+
action: Optional[Literal["generate", "edit", "auto"]] = None
231+
"""Whether to generate a new image or edit an existing image. Default: `auto`."""
232+
230233
background: Optional[Literal["transparent", "opaque", "auto"]] = None
231234
"""Background type for the generated image.
232235
@@ -247,7 +250,7 @@ class ImageGeneration(BaseModel):
247250
Contains `image_url` (string, optional) and `file_id` (string, optional).
248251
"""
249252

250-
model: Union[str, Literal["gpt-image-1", "gpt-image-1-mini"], None] = None
253+
model: Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"], None] = None
251254
"""The image generation model to use. Default: `gpt-image-1`."""
252255

253256
moderation: Optional[Literal["auto", "low"]] = None

src/openai/types/responses/tool_param.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ class ImageGeneration(TypedDict, total=False):
227227
type: Required[Literal["image_generation"]]
228228
"""The type of the image generation tool. Always `image_generation`."""
229229

230+
action: Literal["generate", "edit", "auto"]
231+
"""Whether to generate a new image or edit an existing image. Default: `auto`."""
232+
230233
background: Literal["transparent", "opaque", "auto"]
231234
"""Background type for the generated image.
232235
@@ -247,7 +250,7 @@ class ImageGeneration(TypedDict, total=False):
247250
Contains `image_url` (string, optional) and `file_id` (string, optional).
248251
"""
249252

250-
model: Union[str, Literal["gpt-image-1", "gpt-image-1-mini"]]
253+
model: Union[str, Literal["gpt-image-1", "gpt-image-1-mini", "gpt-image-1.5"]]
251254
"""The image generation model to use. Default: `gpt-image-1`."""
252255

253256
moderation: Literal["auto", "low"]

0 commit comments

Comments
 (0)