Skip to content

Commit 404f4db

Browse files
chore(api): updates to supported Voice IDs (#1424)
1 parent b0783cc commit 404f4db

File tree

11 files changed

+143
-37
lines changed

11 files changed

+143
-37
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/resources/audio/speech.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,23 @@ export interface SpeechCreateParams {
3434

3535
/**
3636
* The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
37-
* `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
38-
* voices are available in the
37+
* `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
38+
* `verse`. Previews of the voices are available in the
3939
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
4040
*/
41-
voice: 'alloy' | 'ash' | 'coral' | 'echo' | 'fable' | 'onyx' | 'nova' | 'sage' | 'shimmer';
41+
voice:
42+
| (string & {})
43+
| 'alloy'
44+
| 'ash'
45+
| 'ballad'
46+
| 'coral'
47+
| 'echo'
48+
| 'fable'
49+
| 'onyx'
50+
| 'nova'
51+
| 'sage'
52+
| 'shimmer'
53+
| 'verse';
4254

4355
/**
4456
* Control the voice of your generated audio with additional instructions. Does not

src/resources/beta/realtime/realtime.ts

+50-11
Original file line numberDiff line numberDiff line change
@@ -1005,9 +1005,22 @@ export interface RealtimeResponse {
10051005

10061006
/**
10071007
* The voice the model used to respond. Current voice options are `alloy`, `ash`,
1008-
* `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
1009-
*/
1010-
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
1008+
* `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
1009+
* `verse`.
1010+
*/
1011+
voice?:
1012+
| (string & {})
1013+
| 'alloy'
1014+
| 'ash'
1015+
| 'ballad'
1016+
| 'coral'
1017+
| 'echo'
1018+
| 'fable'
1019+
| 'onyx'
1020+
| 'nova'
1021+
| 'sage'
1022+
| 'shimmer'
1023+
| 'verse';
10111024
}
10121025

10131026
/**
@@ -1620,9 +1633,22 @@ export namespace ResponseCreateEvent {
16201633
/**
16211634
* The voice the model uses to respond. Voice cannot be changed during the session
16221635
* once the model has responded with audio at least once. Current voice options are
1623-
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
1624-
*/
1625-
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
1636+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
1637+
* `shimmer`, and `verse`.
1638+
*/
1639+
voice?:
1640+
| (string & {})
1641+
| 'alloy'
1642+
| 'ash'
1643+
| 'ballad'
1644+
| 'coral'
1645+
| 'echo'
1646+
| 'fable'
1647+
| 'onyx'
1648+
| 'nova'
1649+
| 'sage'
1650+
| 'shimmer'
1651+
| 'verse';
16261652
}
16271653

16281654
export namespace Response {
@@ -2078,9 +2104,22 @@ export namespace SessionUpdateEvent {
20782104
/**
20792105
* The voice the model uses to respond. Voice cannot be changed during the session
20802106
* once the model has responded with audio at least once. Current voice options are
2081-
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
2082-
*/
2083-
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
2107+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
2108+
* `shimmer`, and `verse`.
2109+
*/
2110+
voice?:
2111+
| (string & {})
2112+
| 'alloy'
2113+
| 'ash'
2114+
| 'ballad'
2115+
| 'coral'
2116+
| 'echo'
2117+
| 'fable'
2118+
| 'onyx'
2119+
| 'nova'
2120+
| 'sage'
2121+
| 'shimmer'
2122+
| 'verse';
20842123
}
20852124

20862125
export namespace Session {
@@ -2376,7 +2415,7 @@ export namespace TranscriptionSessionUpdate {
23762415
export interface TurnDetection {
23772416
/**
23782417
* Whether or not to automatically generate a response when a VAD stop event
2379-
* occurs.
2418+
* occurs. Not available for transcription sessions.
23802419
*/
23812420
create_response?: boolean;
23822421

@@ -2390,7 +2429,7 @@ export namespace TranscriptionSessionUpdate {
23902429
/**
23912430
* Whether or not to automatically interrupt any ongoing response with output to
23922431
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
2393-
* occurs.
2432+
* occurs. Not available for transcription sessions.
23942433
*/
23952434
interrupt_response?: boolean;
23962435

src/resources/beta/realtime/sessions.ts

+42-5
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,19 @@ export interface Session {
139139
* once the model has responded with audio at least once. Current voice options are
140140
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
141141
*/
142-
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
142+
voice?:
143+
| (string & {})
144+
| 'alloy'
145+
| 'ash'
146+
| 'ballad'
147+
| 'coral'
148+
| 'echo'
149+
| 'fable'
150+
| 'onyx'
151+
| 'nova'
152+
| 'sage'
153+
| 'shimmer'
154+
| 'verse';
143155
}
144156

145157
export namespace Session {
@@ -361,7 +373,19 @@ export interface SessionCreateResponse {
361373
* once the model has responded with audio at least once. Current voice options are
362374
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
363375
*/
364-
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
376+
voice?:
377+
| (string & {})
378+
| 'alloy'
379+
| 'ash'
380+
| 'ballad'
381+
| 'coral'
382+
| 'echo'
383+
| 'fable'
384+
| 'onyx'
385+
| 'nova'
386+
| 'sage'
387+
| 'shimmer'
388+
| 'verse';
365389
}
366390

367391
export namespace SessionCreateResponse {
@@ -561,9 +585,22 @@ export interface SessionCreateParams {
561585
/**
562586
* The voice the model uses to respond. Voice cannot be changed during the session
563587
* once the model has responded with audio at least once. Current voice options are
564-
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
565-
*/
566-
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
588+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
589+
* `shimmer`, and `verse`.
590+
*/
591+
voice?:
592+
| (string & {})
593+
| 'alloy'
594+
| 'ash'
595+
| 'ballad'
596+
| 'coral'
597+
| 'echo'
598+
| 'fable'
599+
| 'onyx'
600+
| 'nova'
601+
| 'sage'
602+
| 'shimmer'
603+
| 'verse';
567604
}
568605

569606
export namespace SessionCreateParams {

src/resources/beta/realtime/transcription-sessions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export namespace TranscriptionSessionCreateParams {
255255
export interface TurnDetection {
256256
/**
257257
* Whether or not to automatically generate a response when a VAD stop event
258-
* occurs.
258+
* occurs. Not available for transcription sessions.
259259
*/
260260
create_response?: boolean;
261261

@@ -269,7 +269,7 @@ export namespace TranscriptionSessionCreateParams {
269269
/**
270270
* Whether or not to automatically interrupt any ongoing response with output to
271271
* the default conversation (i.e. `conversation` of `auto`) when a VAD start event
272-
* occurs.
272+
* occurs. Not available for transcription sessions.
273273
*/
274274
interrupt_response?: boolean;
275275

src/resources/chat/completions/completions.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,19 @@ export interface ChatCompletionAudioParam {
325325
* The voice the model uses to respond. Supported voices are `alloy`, `ash`,
326326
* `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
327327
*/
328-
voice: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
328+
voice:
329+
| (string & {})
330+
| 'alloy'
331+
| 'ash'
332+
| 'ballad'
333+
| 'coral'
334+
| 'echo'
335+
| 'fable'
336+
| 'onyx'
337+
| 'nova'
338+
| 'sage'
339+
| 'shimmer'
340+
| 'verse';
329341
}
330342

331343
/**

src/resources/responses/input-items.ts

+6
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ export interface InputItemListParams extends CursorPageParams {
7171
*/
7272
before?: string;
7373

74+
/**
75+
* Additional fields to include in the response. See the `include` parameter for
76+
* Response creation above for more information.
77+
*/
78+
include?: Array<ResponsesAPI.ResponseIncludable>;
79+
7480
/**
7581
* The order to return the input items in. Default is `asc`.
7682
*

src/resources/responses/responses.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ export interface Response {
305305
* context.
306306
*
307307
* When using along with `previous_response_id`, the instructions from a previous
308-
* response will be not be carried over to the next response. This makes it simple
309-
* to swap out system (or developer) messages in new responses.
308+
* response will not be carried over to the next response. This makes it simple to
309+
* swap out system (or developer) messages in new responses.
310310
*/
311311
instructions: string | null;
312312

@@ -1356,6 +1356,12 @@ export type ResponseFormatTextConfig =
13561356
* [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
13571357
*/
13581358
export interface ResponseFormatTextJSONSchemaConfig {
1359+
/**
1360+
* The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
1361+
* and dashes, with a maximum length of 64.
1362+
*/
1363+
name: string;
1364+
13591365
/**
13601366
* The schema for the response format, described as a JSON Schema object. Learn how
13611367
* to build JSON schemas [here](https://json-schema.org/).
@@ -1373,12 +1379,6 @@ export interface ResponseFormatTextJSONSchemaConfig {
13731379
*/
13741380
description?: string;
13751381

1376-
/**
1377-
* The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
1378-
* and dashes, with a maximum length of 64.
1379-
*/
1380-
name?: string;
1381-
13821382
/**
13831383
* Whether to enable strict schema adherence when generating the output. If set to
13841384
* true, the model will always follow the exact schema defined in the `schema`
@@ -2698,8 +2698,8 @@ export interface ResponseCreateParamsBase {
26982698
* context.
26992699
*
27002700
* When using along with `previous_response_id`, the instructions from a previous
2701-
* response will be not be carried over to the next response. This makes it simple
2702-
* to swap out system (or developer) messages in new responses.
2701+
* response will not be carried over to the next response. This makes it simple to
2702+
* swap out system (or developer) messages in new responses.
27032703
*/
27042704
instructions?: string | null;
27052705

tests/api-resources/audio/speech.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('resource speech', () => {
1313
const response = await client.audio.speech.create({
1414
input: 'input',
1515
model: 'string',
16-
voice: 'alloy',
16+
voice: 'ash',
1717
instructions: 'instructions',
1818
response_format: 'mp3',
1919
speed: 0.25,

tests/api-resources/chat/completions/completions.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('resource completions', () => {
2727
const response = await client.chat.completions.create({
2828
messages: [{ content: 'string', role: 'developer', name: 'name' }],
2929
model: 'gpt-4o',
30-
audio: { format: 'wav', voice: 'alloy' },
30+
audio: { format: 'wav', voice: 'ash' },
3131
frequency_penalty: -2,
3232
function_call: 'none',
3333
functions: [{ name: 'name', description: 'description', parameters: { foo: 'bar' } }],

tests/api-resources/responses/input-items.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('resource inputItems', () => {
3232
await expect(
3333
client.responses.inputItems.list(
3434
'response_id',
35-
{ after: 'after', before: 'before', limit: 0, order: 'asc' },
35+
{ after: 'after', before: 'before', include: ['file_search_call.results'], limit: 0, order: 'asc' },
3636
{ path: '/_stainless_unknown_path' },
3737
),
3838
).rejects.toThrow(OpenAI.NotFoundError);

0 commit comments

Comments
 (0)