Skip to content

Commit bff8da9

Browse files
stainless-app[bot]meorphis
and
meorphis
authored
release: 1.66.5 (#2223)
* chore(internal): remove extra empty newlines (#2195) * chore(internal): bump rye to 0.44.0 (#2200) * chore(internal): remove CI condition (#2203) * chore(internal): update release workflows * fix(types): handle more discriminated union shapes (#2206) * fix(ci): ensure pip is always available (#2207) * fix(ci): remove publishing patch (#2208) * chore(internal): add back releases workflow * chore(internal): codegen related update (#2222) * fix(types): improve responses type names (#2224) * release: 1.66.5 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: meorphis <[email protected]>
1 parent 17d7867 commit bff8da9

31 files changed

+351
-220
lines changed

.github/workflows/create-releases.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Create releases
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *' # every day at 5am UTC
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
name: release
12+
if: github.ref == 'refs/heads/main' && github.repository == 'openai/openai-python'
13+
runs-on: ubuntu-latest
14+
environment: publish
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: stainless-api/trigger-release-please@v1
20+
id: release
21+
with:
22+
repo: ${{ github.event.repository.full_name }}
23+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
24+
25+
- name: Install Rye
26+
if: ${{ steps.release.outputs.releases_created }}
27+
run: |
28+
curl -sSf https://rye.astral.sh/get | bash
29+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
30+
env:
31+
RYE_VERSION: '0.44.0'
32+
RYE_INSTALL_OPTION: '--yes'
33+
34+
- name: Publish to PyPI
35+
if: ${{ steps.release.outputs.releases_created }}
36+
run: |
37+
bash ./bin/publish-pypi
38+
env:
39+
PYPI_TOKEN: ${{ secrets.OPENAI_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.66.4"
2+
".": "1.66.5"
33
}

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 81
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-c8579861bc21d4d2155a5b9e8e7d54faee8083730673c4d32cbbe573d7fb4116.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f3bce04386c4fcfd5037e0477fbaa39010003fd1558eb5185fe4a71dd6a05fdd.yml

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 1.66.5 (2025-03-18)
4+
5+
Full Changelog: [v1.66.4...v1.66.5](https://github.com/openai/openai-python/compare/v1.66.4...v1.66.5)
6+
7+
### Bug Fixes
8+
9+
* **types:** improve responses type names ([#2224](https://github.com/openai/openai-python/issues/2224)) ([5f7beb8](https://github.com/openai/openai-python/commit/5f7beb873af5ccef2551f34ab3ef098e099ce9c6))
10+
11+
12+
### Chores
13+
14+
* **internal:** add back releases workflow ([c71d4c9](https://github.com/openai/openai-python/commit/c71d4c918eab3532b36ea944b0c4069db6ac2d38))
15+
* **internal:** codegen related update ([#2222](https://github.com/openai/openai-python/issues/2222)) ([f570d91](https://github.com/openai/openai-python/commit/f570d914a16cb5092533e32dfd863027d378c0b5))
16+
317
## 1.66.4 (2025-03-17)
418

519
Full Changelog: [v1.66.3...v1.66.4](https://github.com/openai/openai-python/compare/v1.66.3...v1.66.4)

api.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,8 @@ from openai.types.responses import (
605605
ResponseCodeInterpreterToolCall,
606606
ResponseCompletedEvent,
607607
ResponseComputerToolCall,
608+
ResponseComputerToolCallOutputItem,
609+
ResponseComputerToolCallOutputScreenshot,
608610
ResponseContent,
609611
ResponseContentPartAddedEvent,
610612
ResponseContentPartDoneEvent,
@@ -621,6 +623,8 @@ from openai.types.responses import (
621623
ResponseFunctionCallArgumentsDeltaEvent,
622624
ResponseFunctionCallArgumentsDoneEvent,
623625
ResponseFunctionToolCall,
626+
ResponseFunctionToolCallItem,
627+
ResponseFunctionToolCallOutputItem,
624628
ResponseFunctionWebSearch,
625629
ResponseInProgressEvent,
626630
ResponseIncludable,
@@ -632,7 +636,9 @@ from openai.types.responses import (
632636
ResponseInputImage,
633637
ResponseInputItem,
634638
ResponseInputMessageContentList,
639+
ResponseInputMessageItem,
635640
ResponseInputText,
641+
ResponseItem,
636642
ResponseOutputAudio,
637643
ResponseOutputItem,
638644
ResponseOutputItemAddedEvent,
@@ -677,4 +683,4 @@ from openai.types.responses import ResponseItemList
677683

678684
Methods:
679685

680-
- <code title="get /responses/{response_id}/input_items">client.responses.input_items.<a href="./src/openai/resources/responses/input_items.py">list</a>(response_id, \*\*<a href="src/openai/types/responses/input_item_list_params.py">params</a>) -> SyncCursorPage[Data]</code>
686+
- <code title="get /responses/{response_id}/input_items">client.responses.input_items.<a href="./src/openai/resources/responses/input_items.py">list</a>(response_id, \*\*<a href="src/openai/types/responses/input_item_list_params.py">params</a>) -> <a href="./src/openai/types/responses/response_item.py">SyncCursorPage[ResponseItem]</a></code>

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openai"
3-
version = "1.66.4"
3+
version = "1.66.5"
44
description = "The official Python library for the openai API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/openai/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "openai"
4-
__version__ = "1.66.4" # x-release-please-version
4+
__version__ = "1.66.5" # x-release-please-version

src/openai/resources/batches.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def create(
4949
self,
5050
*,
5151
completion_window: Literal["24h"],
52-
endpoint: Literal["/v1/chat/completions", "/v1/embeddings", "/v1/completions"],
52+
endpoint: Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions"],
5353
input_file_id: str,
5454
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
5555
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -67,9 +67,9 @@ def create(
6767
is supported.
6868
6969
endpoint: The endpoint to be used for all requests in the batch. Currently
70-
`/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported.
71-
Note that `/v1/embeddings` batches are also restricted to a maximum of 50,000
72-
embedding inputs across all requests in the batch.
70+
`/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions`
71+
are supported. Note that `/v1/embeddings` batches are also restricted to a
72+
maximum of 50,000 embedding inputs across all requests in the batch.
7373
7474
input_file_id: The ID of an uploaded file that contains requests for the new batch.
7575
@@ -259,7 +259,7 @@ async def create(
259259
self,
260260
*,
261261
completion_window: Literal["24h"],
262-
endpoint: Literal["/v1/chat/completions", "/v1/embeddings", "/v1/completions"],
262+
endpoint: Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions"],
263263
input_file_id: str,
264264
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
265265
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -277,9 +277,9 @@ async def create(
277277
is supported.
278278
279279
endpoint: The endpoint to be used for all requests in the batch. Currently
280-
`/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported.
281-
Note that `/v1/embeddings` batches are also restricted to a maximum of 50,000
282-
embedding inputs across all requests in the batch.
280+
`/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions`
281+
are supported. Note that `/v1/embeddings` batches are also restricted to a
282+
maximum of 50,000 embedding inputs across all requests in the batch.
283283
284284
input_file_id: The ID of an uploaded file that contains requests for the new batch.
285285

src/openai/resources/responses/input_items.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ...pagination import SyncCursorPage, AsyncCursorPage
1717
from ..._base_client import AsyncPaginator, make_request_options
1818
from ...types.responses import input_item_list_params
19-
from ...types.responses.response_item_list import Data
19+
from ...types.responses.response_item import ResponseItem
2020

2121
__all__ = ["InputItems", "AsyncInputItems"]
2222

@@ -55,7 +55,7 @@ def list(
5555
extra_query: Query | None = None,
5656
extra_body: Body | None = None,
5757
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
58-
) -> SyncCursorPage[Data]:
58+
) -> SyncCursorPage[ResponseItem]:
5959
"""
6060
Returns a list of input items for a given response.
6161
@@ -84,7 +84,7 @@ def list(
8484
raise ValueError(f"Expected a non-empty value for `response_id` but received {response_id!r}")
8585
return self._get_api_list(
8686
f"/responses/{response_id}/input_items",
87-
page=SyncCursorPage[Data],
87+
page=SyncCursorPage[ResponseItem],
8888
options=make_request_options(
8989
extra_headers=extra_headers,
9090
extra_query=extra_query,
@@ -100,7 +100,7 @@ def list(
100100
input_item_list_params.InputItemListParams,
101101
),
102102
),
103-
model=cast(Any, Data), # Union types cannot be passed in as arguments in the type system
103+
model=cast(Any, ResponseItem), # Union types cannot be passed in as arguments in the type system
104104
)
105105

106106

@@ -138,7 +138,7 @@ def list(
138138
extra_query: Query | None = None,
139139
extra_body: Body | None = None,
140140
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
141-
) -> AsyncPaginator[Data, AsyncCursorPage[Data]]:
141+
) -> AsyncPaginator[ResponseItem, AsyncCursorPage[ResponseItem]]:
142142
"""
143143
Returns a list of input items for a given response.
144144
@@ -167,7 +167,7 @@ def list(
167167
raise ValueError(f"Expected a non-empty value for `response_id` but received {response_id!r}")
168168
return self._get_api_list(
169169
f"/responses/{response_id}/input_items",
170-
page=AsyncCursorPage[Data],
170+
page=AsyncCursorPage[ResponseItem],
171171
options=make_request_options(
172172
extra_headers=extra_headers,
173173
extra_query=extra_query,
@@ -183,7 +183,7 @@ def list(
183183
input_item_list_params.InputItemListParams,
184184
),
185185
),
186-
model=cast(Any, Data), # Union types cannot be passed in as arguments in the type system
186+
model=cast(Any, ResponseItem), # Union types cannot be passed in as arguments in the type system
187187
)
188188

189189

src/openai/types/batch_create_params.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ class BatchCreateParams(TypedDict, total=False):
1717
Currently only `24h` is supported.
1818
"""
1919

20-
endpoint: Required[Literal["/v1/chat/completions", "/v1/embeddings", "/v1/completions"]]
20+
endpoint: Required[Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions"]]
2121
"""The endpoint to be used for all requests in the batch.
2222
23-
Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are
24-
supported. Note that `/v1/embeddings` batches are also restricted to a maximum
25-
of 50,000 embedding inputs across all requests in the batch.
23+
Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and
24+
`/v1/completions` are supported. Note that `/v1/embeddings` batches are also
25+
restricted to a maximum of 50,000 embedding inputs across all requests in the
26+
batch.
2627
"""
2728

2829
input_file_id: Required[str]

src/openai/types/chat/chat_completion_chunk.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ class ChatCompletionChunk(BaseModel):
142142
"""
143143
An optional field that will only be present when you set
144144
`stream_options: {"include_usage": true}` in your request. When present, it
145-
contains a null value except for the last chunk which contains the token usage
146-
statistics for the entire request.
145+
contains a null value **except for the last chunk** which contains the token
146+
usage statistics for the entire request.
147+
148+
**NOTE:** If the stream is interrupted or cancelled, you may not receive the
149+
final usage chunk which contains the total token usage for the request.
147150
"""

src/openai/types/chat/chat_completion_content_part_param.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FileFile(TypedDict, total=False):
2222
file_id: str
2323
"""The ID of an uploaded file to use as input."""
2424

25-
file_name: str
25+
filename: str
2626
"""The name of the file, used when passing the file to the model as a string."""
2727

2828

src/openai/types/chat/chat_completion_stream_options_param.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class ChatCompletionStreamOptionsParam(TypedDict, total=False):
1212
"""If set, an additional chunk will be streamed before the `data: [DONE]` message.
1313
1414
The `usage` field on this chunk shows the token usage statistics for the entire
15-
request, and the `choices` field will always be an empty array. All other chunks
16-
will also include a `usage` field, but with a null value.
15+
request, and the `choices` field will always be an empty array.
16+
17+
All other chunks will also include a `usage` field, but with a null value.
18+
**NOTE:** If the stream is interrupted, you may not receive the final usage
19+
chunk which contains the total token usage for the request.
1720
"""

src/openai/types/responses/__init__.py

+15
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .tool_param import ToolParam as ToolParam
88
from .computer_tool import ComputerTool as ComputerTool
99
from .function_tool import FunctionTool as FunctionTool
10+
from .response_item import ResponseItem as ResponseItem
1011
from .response_error import ResponseError as ResponseError
1112
from .response_usage import ResponseUsage as ResponseUsage
1213
from .parsed_response import (
@@ -66,6 +67,7 @@
6667
from .response_computer_tool_call import ResponseComputerToolCall as ResponseComputerToolCall
6768
from .response_format_text_config import ResponseFormatTextConfig as ResponseFormatTextConfig
6869
from .response_function_tool_call import ResponseFunctionToolCall as ResponseFunctionToolCall
70+
from .response_input_message_item import ResponseInputMessageItem as ResponseInputMessageItem
6971
from .response_refusal_done_event import ResponseRefusalDoneEvent as ResponseRefusalDoneEvent
7072
from .response_function_web_search import ResponseFunctionWebSearch as ResponseFunctionWebSearch
7173
from .response_input_content_param import ResponseInputContentParam as ResponseInputContentParam
@@ -76,6 +78,7 @@
7678
from .response_file_search_tool_call import ResponseFileSearchToolCall as ResponseFileSearchToolCall
7779
from .response_output_item_done_event import ResponseOutputItemDoneEvent as ResponseOutputItemDoneEvent
7880
from .response_content_part_done_event import ResponseContentPartDoneEvent as ResponseContentPartDoneEvent
81+
from .response_function_tool_call_item import ResponseFunctionToolCallItem as ResponseFunctionToolCallItem
7982
from .response_output_item_added_event import ResponseOutputItemAddedEvent as ResponseOutputItemAddedEvent
8083
from .response_computer_tool_call_param import ResponseComputerToolCallParam as ResponseComputerToolCallParam
8184
from .response_content_part_added_event import ResponseContentPartAddedEvent as ResponseContentPartAddedEvent
@@ -90,9 +93,15 @@
9093
from .response_audio_transcript_delta_event import (
9194
ResponseAudioTranscriptDeltaEvent as ResponseAudioTranscriptDeltaEvent,
9295
)
96+
from .response_computer_tool_call_output_item import (
97+
ResponseComputerToolCallOutputItem as ResponseComputerToolCallOutputItem,
98+
)
9399
from .response_format_text_json_schema_config import (
94100
ResponseFormatTextJSONSchemaConfig as ResponseFormatTextJSONSchemaConfig,
95101
)
102+
from .response_function_tool_call_output_item import (
103+
ResponseFunctionToolCallOutputItem as ResponseFunctionToolCallOutputItem,
104+
)
96105
from .response_web_search_call_completed_event import (
97106
ResponseWebSearchCallCompletedEvent as ResponseWebSearchCallCompletedEvent,
98107
)
@@ -120,6 +129,9 @@
120129
from .response_function_call_arguments_delta_event import (
121130
ResponseFunctionCallArgumentsDeltaEvent as ResponseFunctionCallArgumentsDeltaEvent,
122131
)
132+
from .response_computer_tool_call_output_screenshot import (
133+
ResponseComputerToolCallOutputScreenshot as ResponseComputerToolCallOutputScreenshot,
134+
)
123135
from .response_format_text_json_schema_config_param import (
124136
ResponseFormatTextJSONSchemaConfigParam as ResponseFormatTextJSONSchemaConfigParam,
125137
)
@@ -138,3 +150,6 @@
138150
from .response_code_interpreter_call_interpreting_event import (
139151
ResponseCodeInterpreterCallInterpretingEvent as ResponseCodeInterpreterCallInterpretingEvent,
140152
)
153+
from .response_computer_tool_call_output_screenshot_param import (
154+
ResponseComputerToolCallOutputScreenshotParam as ResponseComputerToolCallOutputScreenshotParam,
155+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from typing_extensions import Literal
5+
6+
from ..._models import BaseModel
7+
from .response_computer_tool_call_output_screenshot import ResponseComputerToolCallOutputScreenshot
8+
9+
__all__ = ["ResponseComputerToolCallOutputItem", "AcknowledgedSafetyCheck"]
10+
11+
12+
class AcknowledgedSafetyCheck(BaseModel):
13+
id: str
14+
"""The ID of the pending safety check."""
15+
16+
code: str
17+
"""The type of the pending safety check."""
18+
19+
message: str
20+
"""Details about the pending safety check."""
21+
22+
23+
class ResponseComputerToolCallOutputItem(BaseModel):
24+
id: str
25+
"""The unique ID of the computer call tool output."""
26+
27+
call_id: str
28+
"""The ID of the computer tool call that produced the output."""
29+
30+
output: ResponseComputerToolCallOutputScreenshot
31+
"""A computer screenshot image used with the computer use tool."""
32+
33+
type: Literal["computer_call_output"]
34+
"""The type of the computer tool call output. Always `computer_call_output`."""
35+
36+
acknowledged_safety_checks: Optional[List[AcknowledgedSafetyCheck]] = None
37+
"""
38+
The safety checks reported by the API that have been acknowledged by the
39+
developer.
40+
"""
41+
42+
status: Optional[Literal["in_progress", "completed", "incomplete"]] = None
43+
"""The status of the message input.
44+
45+
One of `in_progress`, `completed`, or `incomplete`. Populated when input items
46+
are returned via API.
47+
"""

0 commit comments

Comments
 (0)