Skip to content

chore(api): updates to supported Voice IDs #1424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 82
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml
openapi_spec_hash: 0c255269b89767eae26f4d4dc22d3cbd
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6663c59193eb95b201e492de17dcbd5e126ba03d18ce66287a3e2c632ca56fe7.yml
openapi_spec_hash: 7996d2c34cc44fe2ce9ffe93c0ab774e
config_hash: d36e491b0afc4f79e3afad4b3c9bec70
18 changes: 15 additions & 3 deletions src/resources/audio/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@ export interface SpeechCreateParams {

/**
* The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
* `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
* voices are available in the
* `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
* `verse`. Previews of the voices are available in the
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
*/
voice: 'alloy' | 'ash' | 'coral' | 'echo' | 'fable' | 'onyx' | 'nova' | 'sage' | 'shimmer';
voice:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';

/**
* Control the voice of your generated audio with additional instructions. Does not
Expand Down
61 changes: 50 additions & 11 deletions src/resources/beta/realtime/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,22 @@ export interface RealtimeResponse {

/**
* The voice the model used to respond. Current voice options are `alloy`, `ash`,
* `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
* `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
* `verse`.
*/
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

/**
Expand Down Expand Up @@ -1620,9 +1633,22 @@ export namespace ResponseCreateEvent {
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
* `shimmer`, and `verse`.
*/
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace Response {
Expand Down Expand Up @@ -2078,9 +2104,22 @@ export namespace SessionUpdateEvent {
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
* `shimmer`, and `verse`.
*/
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace Session {
Expand Down Expand Up @@ -2376,7 +2415,7 @@ export namespace TranscriptionSessionUpdate {
export interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs.
* occurs. Not available for transcription sessions.
*/
create_response?: boolean;

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

Expand Down
47 changes: 42 additions & 5 deletions src/resources/beta/realtime/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,19 @@ export interface Session {
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace Session {
Expand Down Expand Up @@ -361,7 +373,19 @@ export interface SessionCreateResponse {
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace SessionCreateResponse {
Expand Down Expand Up @@ -561,9 +585,22 @@ export interface SessionCreateParams {
/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
*/
voice?: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
* `shimmer`, and `verse`.
*/
voice?:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

export namespace SessionCreateParams {
Expand Down
4 changes: 2 additions & 2 deletions src/resources/beta/realtime/transcription-sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export namespace TranscriptionSessionCreateParams {
export interface TurnDetection {
/**
* Whether or not to automatically generate a response when a VAD stop event
* occurs.
* occurs. Not available for transcription sessions.
*/
create_response?: boolean;

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

Expand Down
14 changes: 13 additions & 1 deletion src/resources/chat/completions/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,19 @@ export interface ChatCompletionAudioParam {
* The voice the model uses to respond. Supported voices are `alloy`, `ash`,
* `ballad`, `coral`, `echo`, `sage`, and `shimmer`.
*/
voice: 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
voice:
| (string & {})
| 'alloy'
| 'ash'
| 'ballad'
| 'coral'
| 'echo'
| 'fable'
| 'onyx'
| 'nova'
| 'sage'
| 'shimmer'
| 'verse';
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/resources/responses/input-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ export interface InputItemListParams extends CursorPageParams {
*/
before?: string;

/**
* Additional fields to include in the response. See the `include` parameter for
* Response creation above for more information.
*/
include?: Array<ResponsesAPI.ResponseIncludable>;

/**
* The order to return the input items in. Default is `asc`.
*
Expand Down
20 changes: 10 additions & 10 deletions src/resources/responses/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ export interface Response {
* context.
*
* When using along with `previous_response_id`, the instructions from a previous
* response will be not be carried over to the next response. This makes it simple
* to swap out system (or developer) messages in new responses.
* response will not be carried over to the next response. This makes it simple to
* swap out system (or developer) messages in new responses.
*/
instructions: string | null;

Expand Down Expand Up @@ -1292,6 +1292,12 @@ export type ResponseFormatTextConfig =
* [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
*/
export interface ResponseFormatTextJSONSchemaConfig {
/**
* The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
* and dashes, with a maximum length of 64.
*/
name: string;

/**
* The schema for the response format, described as a JSON Schema object. Learn how
* to build JSON schemas [here](https://json-schema.org/).
Expand All @@ -1309,12 +1315,6 @@ export interface ResponseFormatTextJSONSchemaConfig {
*/
description?: string;

/**
* The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
* and dashes, with a maximum length of 64.
*/
name?: string;

/**
* Whether to enable strict schema adherence when generating the output. If set to
* true, the model will always follow the exact schema defined in the `schema`
Expand Down Expand Up @@ -2634,8 +2634,8 @@ export interface ResponseCreateParamsBase {
* context.
*
* When using along with `previous_response_id`, the instructions from a previous
* response will be not be carried over to the next response. This makes it simple
* to swap out system (or developer) messages in new responses.
* response will not be carried over to the next response. This makes it simple to
* swap out system (or developer) messages in new responses.
*/
instructions?: string | null;

Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/audio/speech.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('resource speech', () => {
const response = await client.audio.speech.create({
input: 'input',
model: 'string',
voice: 'alloy',
voice: 'ash',
instructions: 'instructions',
response_format: 'mp3',
speed: 0.25,
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/chat/completions/completions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('resource completions', () => {
const response = await client.chat.completions.create({
messages: [{ content: 'string', role: 'developer', name: 'name' }],
model: 'gpt-4o',
audio: { format: 'wav', voice: 'alloy' },
audio: { format: 'wav', voice: 'ash' },
frequency_penalty: -2,
function_call: 'none',
functions: [{ name: 'name', description: 'description', parameters: { foo: 'bar' } }],
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/responses/input-items.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('resource inputItems', () => {
await expect(
client.responses.inputItems.list(
'response_id',
{ after: 'after', before: 'before', limit: 0, order: 'asc' },
{ after: 'after', before: 'before', include: ['file_search_call.results'], limit: 0, order: 'asc' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(OpenAI.NotFoundError);
Expand Down