Skip to content

Commit 2e73b52

Browse files
chore(api): updates to supported Voice IDs (#2261)
1 parent a4b9f40 commit 2e73b52

27 files changed

+158
-84
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 82
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml
3-
openapi_spec_hash: 0c255269b89767eae26f4d4dc22d3cbd
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6663c59193eb95b201e492de17dcbd5e126ba03d18ce66287a3e2c632ca56fe7.yml
3+
openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e
44
config_hash: d36e491b0afc4f79e3afad4b3c9bec70

src/openai/resources/audio/speech.py

+10-6
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

+12-4
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

src/openai/resources/responses/input_items.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Any, cast
5+
from typing import Any, List, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -17,6 +17,7 @@
1717
from ..._base_client import AsyncPaginator, make_request_options
1818
from ...types.responses import input_item_list_params
1919
from ...types.responses.response_item import ResponseItem
20+
from ...types.responses.response_includable import ResponseIncludable
2021

2122
__all__ = ["InputItems", "AsyncInputItems"]
2223

@@ -47,6 +48,7 @@ def list(
4748
*,
4849
after: str | NotGiven = NOT_GIVEN,
4950
before: str | NotGiven = NOT_GIVEN,
51+
include: List[ResponseIncludable] | NotGiven = NOT_GIVEN,
5052
limit: int | NotGiven = NOT_GIVEN,
5153
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
5254
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -64,6 +66,9 @@ def list(
6466
6567
before: An item ID to list items before, used in pagination.
6668
69+
include: Additional fields to include in the response. See the `include` parameter for
70+
Response creation above for more information.
71+
6772
limit: A limit on the number of objects to be returned. Limit can range between 1 and
6873
100, and the default is 20.
6974
@@ -94,6 +99,7 @@ def list(
9499
{
95100
"after": after,
96101
"before": before,
102+
"include": include,
97103
"limit": limit,
98104
"order": order,
99105
},
@@ -130,6 +136,7 @@ def list(
130136
*,
131137
after: str | NotGiven = NOT_GIVEN,
132138
before: str | NotGiven = NOT_GIVEN,
139+
include: List[ResponseIncludable] | NotGiven = NOT_GIVEN,
133140
limit: int | NotGiven = NOT_GIVEN,
134141
order: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
135142
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -147,6 +154,9 @@ def list(
147154
148155
before: An item ID to list items before, used in pagination.
149156
157+
include: Additional fields to include in the response. See the `include` parameter for
158+
Response creation above for more information.
159+
150160
limit: A limit on the number of objects to be returned. Limit can range between 1 and
151161
100, and the default is 20.
152162
@@ -177,6 +187,7 @@ def list(
177187
{
178188
"after": after,
179189
"before": before,
190+
"include": include,
180191
"limit": limit,
181192
"order": order,
182193
},

src/openai/resources/responses/responses.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ def create(
149149
context.
150150
151151
When using along with `previous_response_id`, the instructions from a previous
152-
response will be not be carried over to the next response. This makes it simple
153-
to swap out system (or developer) messages in new responses.
152+
response will not be carried over to the next response. This makes it simple to
153+
swap out system (or developer) messages in new responses.
154154
155155
max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
156156
including visible output tokens and
@@ -321,8 +321,8 @@ def create(
321321
context.
322322
323323
When using along with `previous_response_id`, the instructions from a previous
324-
response will be not be carried over to the next response. This makes it simple
325-
to swap out system (or developer) messages in new responses.
324+
response will not be carried over to the next response. This makes it simple to
325+
swap out system (or developer) messages in new responses.
326326
327327
max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
328328
including visible output tokens and
@@ -486,8 +486,8 @@ def create(
486486
context.
487487
488488
When using along with `previous_response_id`, the instructions from a previous
489-
response will be not be carried over to the next response. This makes it simple
490-
to swap out system (or developer) messages in new responses.
489+
response will not be carried over to the next response. This makes it simple to
490+
swap out system (or developer) messages in new responses.
491491
492492
max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
493493
including visible output tokens and
@@ -961,8 +961,8 @@ async def create(
961961
context.
962962
963963
When using along with `previous_response_id`, the instructions from a previous
964-
response will be not be carried over to the next response. This makes it simple
965-
to swap out system (or developer) messages in new responses.
964+
response will not be carried over to the next response. This makes it simple to
965+
swap out system (or developer) messages in new responses.
966966
967967
max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
968968
including visible output tokens and
@@ -1133,8 +1133,8 @@ async def create(
11331133
context.
11341134
11351135
When using along with `previous_response_id`, the instructions from a previous
1136-
response will be not be carried over to the next response. This makes it simple
1137-
to swap out system (or developer) messages in new responses.
1136+
response will not be carried over to the next response. This makes it simple to
1137+
swap out system (or developer) messages in new responses.
11381138
11391139
max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
11401140
including visible output tokens and
@@ -1298,8 +1298,8 @@ async def create(
12981298
context.
12991299
13001300
When using along with `previous_response_id`, the instructions from a previous
1301-
response will be not be carried over to the next response. This makes it simple
1302-
to swap out system (or developer) messages in new responses.
1301+
response will not be carried over to the next response. This makes it simple to
1302+
swap out system (or developer) messages in new responses.
13031303
13041304
max_output_tokens: An upper bound for the number of tokens that can be generated for a response,
13051305
including visible output tokens and

src/openai/types/audio/speech_create_params.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ class SpeechCreateParams(TypedDict, total=False):
2020
`tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
2121
"""
2222

23-
voice: Required[Literal["alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer"]]
23+
voice: Required[
24+
Union[
25+
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
26+
]
27+
]
2428
"""The voice to use when generating the audio.
2529
26-
Supported voices are `alloy`, `ash`, `coral`, `echo`, `fable`, `onyx`, `nova`,
27-
`sage` and `shimmer`. Previews of the voices are available in the
30+
Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`,
31+
`nova`, `sage`, `shimmer`, and `verse`. Previews of the voices are available in
32+
the
2833
[Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
2934
"""
3035

src/openai/types/beta/realtime/realtime_response.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,13 @@ class RealtimeResponse(BaseModel):
8080
will become the input for later turns.
8181
"""
8282

83-
voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
83+
voice: Union[
84+
str,
85+
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
86+
None,
87+
] = None
8488
"""
8589
The voice the model used to respond. Current voice options are `alloy`, `ash`,
86-
`ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
90+
`ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
91+
`verse`.
8792
"""

src/openai/types/beta/realtime/response_create_event.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ class Response(BaseModel):
101101
tools: Optional[List[ResponseTool]] = None
102102
"""Tools (functions) available to the model."""
103103

104-
voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
104+
voice: Union[
105+
str,
106+
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
107+
None,
108+
] = None
105109
"""The voice the model uses to respond.
106110
107111
Voice cannot be changed during the session once the model has responded with
108112
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
109-
`coral`, `echo` `sage`, `shimmer` and `verse`.
113+
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
110114
"""
111115

112116

src/openai/types/beta/realtime/response_create_event_param.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ class Response(TypedDict, total=False):
102102
tools: Iterable[ResponseTool]
103103
"""Tools (functions) available to the model."""
104104

105-
voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]
105+
voice: Union[
106+
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
107+
]
106108
"""The voice the model uses to respond.
107109
108110
Voice cannot be changed during the session once the model has responded with
109111
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
110-
`coral`, `echo` `sage`, `shimmer` and `verse`.
112+
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
111113
"""
112114

113115

src/openai/types/beta/realtime/session.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,11 @@ class Session(BaseModel):
218218
natural conversations, but may have a higher latency.
219219
"""
220220

221-
voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
221+
voice: Union[
222+
str,
223+
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
224+
None,
225+
] = None
222226
"""The voice the model uses to respond.
223227
224228
Voice cannot be changed during the session once the model has responded with

src/openai/types/beta/realtime/session_create_params.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ class SessionCreateParams(TypedDict, total=False):
113113
natural conversations, but may have a higher latency.
114114
"""
115115

116-
voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]
116+
voice: Union[
117+
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
118+
]
117119
"""The voice the model uses to respond.
118120
119121
Voice cannot be changed during the session once the model has responded with
120122
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
121-
`coral`, `echo` `sage`, `shimmer` and `verse`.
123+
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
122124
"""
123125

124126

src/openai/types/beta/realtime/session_create_response.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ class SessionCreateResponse(BaseModel):
141141
speech.
142142
"""
143143

144-
voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
144+
voice: Union[
145+
str,
146+
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
147+
None,
148+
] = None
145149
"""The voice the model uses to respond.
146150
147151
Voice cannot be changed during the session once the model has responded with

src/openai/types/beta/realtime/session_update_event.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,16 @@ class Session(BaseModel):
222222
natural conversations, but may have a higher latency.
223223
"""
224224

225-
voice: Optional[Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]] = None
225+
voice: Union[
226+
str,
227+
Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"],
228+
None,
229+
] = None
226230
"""The voice the model uses to respond.
227231
228232
Voice cannot be changed during the session once the model has responded with
229233
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
230-
`coral`, `echo` `sage`, `shimmer` and `verse`.
234+
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
231235
"""
232236

233237

src/openai/types/beta/realtime/session_update_event_param.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,14 @@ class Session(TypedDict, total=False):
220220
natural conversations, but may have a higher latency.
221221
"""
222222

223-
voice: Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse"]
223+
voice: Union[
224+
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
225+
]
224226
"""The voice the model uses to respond.
225227
226228
Voice cannot be changed during the session once the model has responded with
227229
audio at least once. Current voice options are `alloy`, `ash`, `ballad`,
228-
`coral`, `echo` `sage`, `shimmer` and `verse`.
230+
`coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
229231
"""
230232

231233

0 commit comments

Comments
 (0)