Skip to content

Commit cca0970

Browse files
release: 1.83.0 (#2393)
* Fix a typo: "occurences" -> "occurrences" (#2387) * chore: deprecate Assistants API * chore(api): mark some methods as deprecated * feat(api): Config update for pakrym-stream-param * fix(client): return binary content from `get /containers/{container_id}/files/{file_id}/content` * codegen metadata * chore(docs): remove reference to rye shell * feat(client): add follow_redirects request option * fix(api): Fix evals and code interpreter interfaces * release: 1.83.0 --------- Co-authored-by: Roman A <[email protected]> Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 9173f3d commit cca0970

File tree

64 files changed

+3101
-1969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3101
-1969
lines changed

.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.82.1"
2+
".": "1.83.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fc64d7c2c8f51f750813375356c3f3fdfc7fc1b1b34f19c20a5410279d445d37.yml
3-
openapi_spec_hash: 618285fc70199ee32b9ebe4bf72f7e4c
4-
config_hash: 535b6e5f26a295d609b259c8cb8f656c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-2bcc845d8635bf93ddcf9ee723af4d7928248412a417bee5fc10d863a1e13867.yml
3+
openapi_spec_hash: 865230cb3abeb01bd85de05891af23c4
4+
config_hash: ed1e6b3c5f93d12b80d31167f55c557c

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## 1.83.0 (2025-06-02)
4+
5+
Full Changelog: [v1.82.1...v1.83.0](https://github.com/openai/openai-python/compare/v1.82.1...v1.83.0)
6+
7+
### Features
8+
9+
* **api:** Config update for pakrym-stream-param ([88bcf3a](https://github.com/openai/openai-python/commit/88bcf3af9ce8ffa8347547d4d30aacac1ceba939))
10+
* **client:** add follow_redirects request option ([26d715f](https://github.com/openai/openai-python/commit/26d715f4e9b0f2b19e2ac16acc796a949338e1e1))
11+
12+
13+
### Bug Fixes
14+
15+
* **api:** Fix evals and code interpreter interfaces ([2650159](https://github.com/openai/openai-python/commit/2650159f6d01f6eb481cf8c7942142e4fd21ce44))
16+
* **client:** return binary content from `get /containers/{container_id}/files/{file_id}/content` ([f7c80c4](https://github.com/openai/openai-python/commit/f7c80c4368434bd0be7436375076ba33a62f63b5))
17+
18+
19+
### Chores
20+
21+
* **api:** mark some methods as deprecated ([3e2ca57](https://github.com/openai/openai-python/commit/3e2ca571cb6cdd9e15596590605b2f98a4c5a42e))
22+
* deprecate Assistants API ([9d166d7](https://github.com/openai/openai-python/commit/9d166d795e03dea49af680ec9597e9497522187c))
23+
* **docs:** remove reference to rye shell ([c7978e9](https://github.com/openai/openai-python/commit/c7978e9f1640c311022988fcd716cbb5c865daa8))
24+
325
## 1.82.1 (2025-05-29)
426

527
Full Changelog: [v1.82.0...v1.82.1](https://github.com/openai/openai-python/compare/v1.82.0...v1.82.1)

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ $ rye sync --all-features
1717
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
1818

1919
```sh
20-
$ rye shell
21-
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
2221
$ source .venv/bin/activate
2322

2423
# now you can omit the `rye run` prefix

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ Methods:
784784
- <code title="post /responses">client.responses.<a href="./src/openai/resources/responses/responses.py">create</a>(\*\*<a href="src/openai/types/responses/response_create_params.py">params</a>) -> <a href="./src/openai/types/responses/response.py">Response</a></code>
785785
- <code title="get /responses/{response_id}">client.responses.<a href="./src/openai/resources/responses/responses.py">retrieve</a>(response_id, \*\*<a href="src/openai/types/responses/response_retrieve_params.py">params</a>) -> <a href="./src/openai/types/responses/response.py">Response</a></code>
786786
- <code title="delete /responses/{response_id}">client.responses.<a href="./src/openai/resources/responses/responses.py">delete</a>(response_id) -> None</code>
787-
- <code title="post /responses/{response_id}/cancel">client.responses.<a href="./src/openai/resources/responses/responses.py">cancel</a>(response_id) -> None</code>
787+
- <code title="post /responses/{response_id}/cancel">client.responses.<a href="./src/openai/resources/responses/responses.py">cancel</a>(response_id) -> <a href="./src/openai/types/responses/response.py">Response</a></code>
788788

789789
## InputItems
790790

@@ -894,4 +894,4 @@ Methods:
894894

895895
Methods:
896896

897-
- <code title="get /containers/{container_id}/files/{file_id}/content">client.containers.files.content.<a href="./src/openai/resources/containers/files/content.py">retrieve</a>(file_id, \*, container_id) -> None</code>
897+
- <code title="get /containers/{container_id}/files/{file_id}/content">client.containers.files.content.<a href="./src/openai/resources/containers/files/content.py">retrieve</a>(file_id, \*, container_id) -> HttpxBinaryResponseContent</code>

examples/assistant.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

examples/assistant_stream.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

examples/assistant_stream_helpers.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

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.82.1"
3+
version = "1.83.0"
44
description = "The official Python library for the openai API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/openai/_base_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,9 @@ def request(
962962
if self.custom_auth is not None:
963963
kwargs["auth"] = self.custom_auth
964964

965+
if options.follow_redirects is not None:
966+
kwargs["follow_redirects"] = options.follow_redirects
967+
965968
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
966969

967970
response = None
@@ -1477,6 +1480,9 @@ async def request(
14771480
if self.custom_auth is not None:
14781481
kwargs["auth"] = self.custom_auth
14791482

1483+
if options.follow_redirects is not None:
1484+
kwargs["follow_redirects"] = options.follow_redirects
1485+
14801486
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
14811487

14821488
response = None

src/openai/_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
777777
idempotency_key: str
778778
json_data: Body
779779
extra_json: AnyMapping
780+
follow_redirects: bool
780781

781782

782783
@final
@@ -790,6 +791,7 @@ class FinalRequestOptions(pydantic.BaseModel):
790791
files: Union[HttpxRequestFiles, None] = None
791792
idempotency_key: Union[str, None] = None
792793
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
794+
follow_redirects: Union[bool, None] = None
793795

794796
# It should be noted that we cannot use `json` here as that would override
795797
# a BaseModel method in an incompatible fashion.

src/openai/_types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class RequestOptions(TypedDict, total=False):
101101
params: Query
102102
extra_json: AnyMapping
103103
idempotency_key: str
104+
follow_redirects: bool
104105

105106

106107
# Sentinel class used until PEP 0661 is accepted
@@ -217,3 +218,4 @@ class _GenericAlias(Protocol):
217218

218219
class HttpxSendArgs(TypedDict, total=False):
219220
auth: httpx.Auth
221+
follow_redirects: bool

src/openai/_utils/_transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _transform_recursive(
212212
return data
213213

214214
if isinstance(data, pydantic.BaseModel):
215-
return model_dump(data, exclude_unset=True, mode="json", exclude=getattr(data, '__api_exclude__', None))
215+
return model_dump(data, exclude_unset=True, mode="json", exclude=getattr(data, "__api_exclude__", None))
216216

217217
annotated_type = _get_annotated_type(annotation)
218218
if annotated_type is None:

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.82.1" # x-release-please-version
4+
__version__ = "1.83.0" # x-release-please-version

src/openai/lib/_parsing/_responses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def parse_response(
109109
or output.type == "code_interpreter_call"
110110
or output.type == "local_shell_call"
111111
or output.type == "mcp_list_tools"
112-
or output.type == 'exec'
112+
or output.type == "exec"
113113
):
114114
output_list.append(output)
115115
elif TYPE_CHECKING: # type: ignore

src/openai/resources/beta/realtime/sessions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def with_streaming_response(self) -> SessionsWithStreamingResponse:
4343
def create(
4444
self,
4545
*,
46+
client_secret: session_create_params.ClientSecret | NotGiven = NOT_GIVEN,
4647
input_audio_format: Literal["pcm16", "g711_ulaw", "g711_alaw"] | NotGiven = NOT_GIVEN,
4748
input_audio_noise_reduction: session_create_params.InputAudioNoiseReduction | NotGiven = NOT_GIVEN,
4849
input_audio_transcription: session_create_params.InputAudioTranscription | NotGiven = NOT_GIVEN,
@@ -83,6 +84,8 @@ def create(
8384
the Realtime API.
8485
8586
Args:
87+
client_secret: Configuration options for the generated client secret.
88+
8689
input_audio_format: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
8790
`pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
8891
(mono), and little-endian byte order.
@@ -163,6 +166,7 @@ def create(
163166
"/realtime/sessions",
164167
body=maybe_transform(
165168
{
169+
"client_secret": client_secret,
166170
"input_audio_format": input_audio_format,
167171
"input_audio_noise_reduction": input_audio_noise_reduction,
168172
"input_audio_transcription": input_audio_transcription,
@@ -209,6 +213,7 @@ def with_streaming_response(self) -> AsyncSessionsWithStreamingResponse:
209213
async def create(
210214
self,
211215
*,
216+
client_secret: session_create_params.ClientSecret | NotGiven = NOT_GIVEN,
212217
input_audio_format: Literal["pcm16", "g711_ulaw", "g711_alaw"] | NotGiven = NOT_GIVEN,
213218
input_audio_noise_reduction: session_create_params.InputAudioNoiseReduction | NotGiven = NOT_GIVEN,
214219
input_audio_transcription: session_create_params.InputAudioTranscription | NotGiven = NOT_GIVEN,
@@ -249,6 +254,8 @@ async def create(
249254
the Realtime API.
250255
251256
Args:
257+
client_secret: Configuration options for the generated client secret.
258+
252259
input_audio_format: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For
253260
`pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel
254261
(mono), and little-endian byte order.
@@ -329,6 +336,7 @@ async def create(
329336
"/realtime/sessions",
330337
body=await async_maybe_transform(
331338
{
339+
"client_secret": client_secret,
332340
"input_audio_format": input_audio_format,
333341
"input_audio_noise_reduction": input_audio_noise_reduction,
334342
"input_audio_transcription": input_audio_transcription,

src/openai/resources/beta/realtime/transcription_sessions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def with_streaming_response(self) -> TranscriptionSessionsWithStreamingResponse:
4343
def create(
4444
self,
4545
*,
46+
client_secret: transcription_session_create_params.ClientSecret | NotGiven = NOT_GIVEN,
4647
include: List[str] | NotGiven = NOT_GIVEN,
4748
input_audio_format: Literal["pcm16", "g711_ulaw", "g711_alaw"] | NotGiven = NOT_GIVEN,
4849
input_audio_noise_reduction: transcription_session_create_params.InputAudioNoiseReduction
@@ -67,6 +68,8 @@ def create(
6768
the Realtime API.
6869
6970
Args:
71+
client_secret: Configuration options for the generated client secret.
72+
7073
include:
7174
The set of items to include in the transcription. Current available items are:
7275
@@ -113,6 +116,7 @@ def create(
113116
"/realtime/transcription_sessions",
114117
body=maybe_transform(
115118
{
119+
"client_secret": client_secret,
116120
"include": include,
117121
"input_audio_format": input_audio_format,
118122
"input_audio_noise_reduction": input_audio_noise_reduction,
@@ -152,6 +156,7 @@ def with_streaming_response(self) -> AsyncTranscriptionSessionsWithStreamingResp
152156
async def create(
153157
self,
154158
*,
159+
client_secret: transcription_session_create_params.ClientSecret | NotGiven = NOT_GIVEN,
155160
include: List[str] | NotGiven = NOT_GIVEN,
156161
input_audio_format: Literal["pcm16", "g711_ulaw", "g711_alaw"] | NotGiven = NOT_GIVEN,
157162
input_audio_noise_reduction: transcription_session_create_params.InputAudioNoiseReduction
@@ -176,6 +181,8 @@ async def create(
176181
the Realtime API.
177182
178183
Args:
184+
client_secret: Configuration options for the generated client secret.
185+
179186
include:
180187
The set of items to include in the transcription. Current available items are:
181188
@@ -222,6 +229,7 @@ async def create(
222229
"/realtime/transcription_sessions",
223230
body=await async_maybe_transform(
224231
{
232+
"client_secret": client_secret,
225233
"include": include,
226234
"input_audio_format": input_audio_format,
227235
"input_audio_noise_reduction": input_audio_noise_reduction,

0 commit comments

Comments
 (0)