Skip to content

Commit 30e8f6d

Browse files
authored
Merge branch 'main' into chore/client-comment-fix
2 parents a2e76ad + a8fa0de commit 30e8f6d

35 files changed

+186
-1886
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.68.2"
2+
".": "1.69.0"
33
}

.stats.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
configured_endpoints: 82
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6663c59193eb95b201e492de17dcbd5e126ba03d18ce66287a3e2c632ca56fe7.yml
3+
openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e
4+
config_hash: 9351ea829c2b41da3b48a38c934c92ee

CHANGELOG.md

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

3+
## 1.69.0 (2025-03-27)
4+
5+
Full Changelog: [v1.68.2...v1.69.0](https://github.com/openai/openai-python/compare/v1.68.2...v1.69.0)
6+
7+
### Features
8+
9+
* **api:** add `get /chat/completions` endpoint ([e6b8a42](https://github.com/openai/openai-python/commit/e6b8a42fc4286656cc86c2acd83692b170e77b68))
10+
11+
12+
### Bug Fixes
13+
14+
* **audio:** correctly parse transcription stream events ([16a3a19](https://github.com/openai/openai-python/commit/16a3a195ff31f099fbe46043a12d2380c2c01f83))
15+
16+
17+
### Chores
18+
19+
* add hash of OpenAPI spec/config inputs to .stats.yml ([515e1cd](https://github.com/openai/openai-python/commit/515e1cdd4a3109e5b29618df813656e17f22b52a))
20+
* **api:** updates to supported Voice IDs ([#2261](https://github.com/openai/openai-python/issues/2261)) ([64956f9](https://github.com/openai/openai-python/commit/64956f9d9889b04380c7f5eb926509d1efd523e6))
21+
* fix typos ([#2259](https://github.com/openai/openai-python/issues/2259)) ([6160de3](https://github.com/openai/openai-python/commit/6160de3e099f09c2d6ee5eeee4cbcc55b67a8f87))
22+
323
## 1.68.2 (2025-03-21)
424

525
Full Changelog: [v1.68.1...v1.68.2](https://github.com/openai/openai-python/compare/v1.68.1...v1.68.2)

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

src/openai/_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ def add_request_id(obj: BaseModel, request_id: str | None) -> None:
721721
cast(Any, obj).__exclude_fields__ = {*(exclude_fields or {}), "_request_id", "__exclude_fields__"}
722722

723723

724-
# our use of subclasssing here causes weirdness for type checkers,
724+
# our use of subclassing here causes weirdness for type checkers,
725725
# so we just pretend that we don't subclass
726726
if TYPE_CHECKING:
727727
GenericModel = BaseModel

src/openai/_streaming.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __stream__(self) -> Iterator[_T]:
5959
if sse.data.startswith("[DONE]"):
6060
break
6161

62-
if sse.event is None or sse.event.startswith("response."):
62+
if sse.event is None or sse.event.startswith("response.") or sse.event.startswith('transcript.'):
6363
data = sse.json()
6464
if is_mapping(data) and data.get("error"):
6565
message = None
@@ -161,7 +161,7 @@ async def __stream__(self) -> AsyncIterator[_T]:
161161
if sse.data.startswith("[DONE]"):
162162
break
163163

164-
if sse.event is None or sse.event.startswith("response."):
164+
if sse.event is None or sse.event.startswith("response.") or sse.event.startswith('transcript.'):
165165
data = sse.json()
166166
if is_mapping(data) and data.get("error"):
167167
message = None

src/openai/_utils/_transform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _get_annotated_type(type_: type) -> type | None:
126126
def _maybe_transform_key(key: str, type_: type) -> str:
127127
"""Transform the given `data` based on the annotations provided in `type_`.
128128
129-
Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata.
129+
Note: this function only looks at `Annotated` types that contain `PropertyInfo` metadata.
130130
"""
131131
annotated_type = _get_annotated_type(type_)
132132
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.68.2" # x-release-please-version
4+
__version__ = "1.69.0" # x-release-please-version

src/openai/resources/audio/speech.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ def create(
5353
*,
5454
input: str,
5555
model: Union[str, SpeechModel],
56-
voice: Literal["alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer"],
56+
voice: Union[
57+
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
58+
],
5759
instructions: str | NotGiven = NOT_GIVEN,
5860
response_format: Literal["mp3", "opus", "aac", "flac", "wav", "pcm"] | NotGiven = NOT_GIVEN,
5961
speed: float | NotGiven = NOT_GIVEN,
@@ -75,8 +77,8 @@ def create(
7577
`tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
7678
7779
voice: The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
78-
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
79-
voices are available in the
80+
`ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
81+
`verse`. Previews of the voices are available in the
8082
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
8183
8284
instructions: Control the voice of your generated audio with additional instructions. Does not
@@ -142,7 +144,9 @@ async def create(
142144
*,
143145
input: str,
144146
model: Union[str, SpeechModel],
145-
voice: Literal["alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer"],
147+
voice: Union[
148+
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
149+
],
146150
instructions: str | NotGiven = NOT_GIVEN,
147151
response_format: Literal["mp3", "opus", "aac", "flac", "wav", "pcm"] | NotGiven = NOT_GIVEN,
148152
speed: float | NotGiven = NOT_GIVEN,
@@ -164,8 +168,8 @@ async def create(
164168
`tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
165169
166170
voice: The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
167-
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
168-
voices are available in the
171+
`ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
172+
`verse`. Previews of the voices are available in the
169173
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
170174
171175
instructions: Control the voice of your generated audio with additional instructions. Does not

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ def create(
6565
tool_choice: str | NotGiven = NOT_GIVEN,
6666
tools: Iterable[session_create_params.Tool] | NotGiven = NOT_GIVEN,
6767
turn_detection: session_create_params.TurnDetection | NotGiven = NOT_GIVEN,
68-
voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"] | NotGiven = NOT_GIVEN,
68+
voice: Union[
69+
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
70+
]
71+
| NotGiven = NOT_GIVEN,
6972
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7073
# The extra values given here take precedence over values defined on the client or passed to this method.
7174
extra_headers: Headers | None = None,
@@ -147,7 +150,8 @@ def create(
147150
148151
voice: The voice the model uses to respond. Voice cannot be changed during the session
149152
once the model has responded with audio at least once. Current voice options are
150-
`alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
153+
`alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
154+
`shimmer`, and `verse`.
151155
152156
extra_headers: Send extra headers
153157
@@ -227,7 +231,10 @@ async def create(
227231
tool_choice: str | NotGiven = NOT_GIVEN,
228232
tools: Iterable[session_create_params.Tool] | NotGiven = NOT_GIVEN,
229233
turn_detection: session_create_params.TurnDetection | NotGiven = NOT_GIVEN,
230-
voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"] | NotGiven = NOT_GIVEN,
234+
voice: Union[
235+
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
236+
]
237+
| NotGiven = NOT_GIVEN,
231238
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
232239
# The extra values given here take precedence over values defined on the client or passed to this method.
233240
extra_headers: Headers | None = None,
@@ -309,7 +316,8 @@ async def create(
309316
310317
voice: The voice the model uses to respond. Voice cannot be changed during the session
311318
once the model has responded with audio at least once. Current voice options are
312-
`alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
319+
`alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
320+
`shimmer`, and `verse`.
313321
314322
extra_headers: Send extra headers
315323

0 commit comments

Comments
 (0)