Skip to content

Commit bff8da9

Browse files
stainless-app[bot]meorphis
andauthored
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

Lines changed: 39 additions & 0 deletions
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

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

.stats.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 14 additions & 0 deletions
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

Lines changed: 7 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 8 deletions
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 5 additions & 4 deletions
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]

0 commit comments

Comments
 (0)