Skip to content

Commit 1219f09

Browse files
feat(api): add new realtime and audio models, realtime session options
1 parent 00458ac commit 1219f09

File tree

4 files changed

+164
-3
lines changed

4 files changed

+164
-3
lines changed

.stats.yml

Lines changed: 2 additions & 2 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-2bcc845d8635bf93ddcf9ee723af4d7928248412a417bee5fc10d863a1e13867.yml
3-
openapi_spec_hash: 865230cb3abeb01bd85de05891af23c4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-04213ea42074f52b8e7e60e101ed7d7ae47b8abcc233c7e8eae310bba544454d.yml
3+
openapi_spec_hash: 5fb148608764103ba3700cd6bda4f22e
44
config_hash: ed1e6b3c5f93d12b80d31167f55c557c

src/resources/beta/realtime/realtime.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,6 +2162,7 @@ export namespace SessionUpdateEvent {
21622162
| 'gpt-4o-realtime-preview'
21632163
| 'gpt-4o-realtime-preview-2024-10-01'
21642164
| 'gpt-4o-realtime-preview-2024-12-17'
2165+
| 'gpt-4o-realtime-preview-2025-06-03'
21652166
| 'gpt-4o-mini-realtime-preview'
21662167
| 'gpt-4o-mini-realtime-preview-2024-12-17';
21672168

@@ -2171,6 +2172,13 @@ export namespace SessionUpdateEvent {
21712172
*/
21722173
output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
21732174

2175+
/**
2176+
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
2177+
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
2178+
* between model turns, not while a response is in progress.
2179+
*/
2180+
speed?: number;
2181+
21742182
/**
21752183
* Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
21762184
* temperature of 0.8 is highly recommended for best performance.
@@ -2188,6 +2196,15 @@ export namespace SessionUpdateEvent {
21882196
*/
21892197
tools?: Array<Session.Tool>;
21902198

2199+
/**
2200+
* Configuration options for tracing. Set to null to disable tracing. Once tracing
2201+
* is enabled for a session, the configuration cannot be modified.
2202+
*
2203+
* `auto` will create a trace for the session with default values for the workflow
2204+
* name, group id, and metadata.
2205+
*/
2206+
tracing?: 'auto' | Session.UnionMember1;
2207+
21912208
/**
21922209
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
21932210
* set to `null` to turn off, in which case the client must manually trigger model
@@ -2326,6 +2343,29 @@ export namespace SessionUpdateEvent {
23262343
type?: 'function';
23272344
}
23282345

2346+
/**
2347+
* Granular configuration for tracing.
2348+
*/
2349+
export interface UnionMember1 {
2350+
/**
2351+
* The group id to attach to this trace to enable filtering and grouping in the
2352+
* traces dashboard.
2353+
*/
2354+
group_id?: string;
2355+
2356+
/**
2357+
* The arbitrary metadata to attach to this trace to enable filtering in the traces
2358+
* dashboard.
2359+
*/
2360+
metadata?: unknown;
2361+
2362+
/**
2363+
* The name of the workflow to attach to this trace. This is used to name the trace
2364+
* in the traces dashboard.
2365+
*/
2366+
workflow_name?: string;
2367+
}
2368+
23292369
/**
23302370
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
23312371
* set to `null` to turn off, in which case the client must manually trigger model

src/resources/beta/realtime/sessions.ts

Lines changed: 121 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export interface Session {
102102
| 'gpt-4o-realtime-preview'
103103
| 'gpt-4o-realtime-preview-2024-10-01'
104104
| 'gpt-4o-realtime-preview-2024-12-17'
105+
| 'gpt-4o-realtime-preview-2025-06-03'
105106
| 'gpt-4o-mini-realtime-preview'
106107
| 'gpt-4o-mini-realtime-preview-2024-12-17';
107108

@@ -111,6 +112,13 @@ export interface Session {
111112
*/
112113
output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
113114

115+
/**
116+
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
117+
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
118+
* between model turns, not while a response is in progress.
119+
*/
120+
speed?: number;
121+
114122
/**
115123
* Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
116124
* temperature of 0.8 is highly recommended for best performance.
@@ -128,6 +136,15 @@ export interface Session {
128136
*/
129137
tools?: Array<Session.Tool>;
130138

139+
/**
140+
* Configuration options for tracing. Set to null to disable tracing. Once tracing
141+
* is enabled for a session, the configuration cannot be modified.
142+
*
143+
* `auto` will create a trace for the session with default values for the workflow
144+
* name, group id, and metadata.
145+
*/
146+
tracing?: 'auto' | Session.UnionMember1;
147+
131148
/**
132149
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
133150
* set to `null` to turn off, in which case the client must manually trigger model
@@ -145,7 +162,8 @@ export interface Session {
145162
/**
146163
* The voice the model uses to respond. Voice cannot be changed during the session
147164
* once the model has responded with audio at least once. Current voice options are
148-
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
165+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
166+
* `shimmer`, and `verse`.
149167
*/
150168
voice?:
151169
| (string & {})
@@ -236,6 +254,29 @@ export namespace Session {
236254
type?: 'function';
237255
}
238256

257+
/**
258+
* Granular configuration for tracing.
259+
*/
260+
export interface UnionMember1 {
261+
/**
262+
* The group id to attach to this trace to enable filtering and grouping in the
263+
* traces dashboard.
264+
*/
265+
group_id?: string;
266+
267+
/**
268+
* The arbitrary metadata to attach to this trace to enable filtering in the traces
269+
* dashboard.
270+
*/
271+
metadata?: unknown;
272+
273+
/**
274+
* The name of the workflow to attach to this trace. This is used to name the trace
275+
* in the traces dashboard.
276+
*/
277+
workflow_name?: string;
278+
}
279+
239280
/**
240281
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
241282
* set to `null` to turn off, in which case the client must manually trigger model
@@ -353,6 +394,13 @@ export interface SessionCreateResponse {
353394
*/
354395
output_audio_format?: string;
355396

397+
/**
398+
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
399+
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
400+
* between model turns, not while a response is in progress.
401+
*/
402+
speed?: number;
403+
356404
/**
357405
* Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
358406
*/
@@ -369,6 +417,15 @@ export interface SessionCreateResponse {
369417
*/
370418
tools?: Array<SessionCreateResponse.Tool>;
371419

420+
/**
421+
* Configuration options for tracing. Set to null to disable tracing. Once tracing
422+
* is enabled for a session, the configuration cannot be modified.
423+
*
424+
* `auto` will create a trace for the session with default values for the workflow
425+
* name, group id, and metadata.
426+
*/
427+
tracing?: 'auto' | SessionCreateResponse.UnionMember1;
428+
372429
/**
373430
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
374431
* means that the model will detect the start and end of speech based on audio
@@ -453,6 +510,29 @@ export namespace SessionCreateResponse {
453510
type?: 'function';
454511
}
455512

513+
/**
514+
* Granular configuration for tracing.
515+
*/
516+
export interface UnionMember1 {
517+
/**
518+
* The group id to attach to this trace to enable filtering and grouping in the
519+
* traces dashboard.
520+
*/
521+
group_id?: string;
522+
523+
/**
524+
* The arbitrary metadata to attach to this trace to enable filtering in the traces
525+
* dashboard.
526+
*/
527+
metadata?: unknown;
528+
529+
/**
530+
* The name of the workflow to attach to this trace. This is used to name the trace
531+
* in the traces dashboard.
532+
*/
533+
workflow_name?: string;
534+
}
535+
456536
/**
457537
* Configuration for turn detection. Can be set to `null` to turn off. Server VAD
458538
* means that the model will detect the start and end of speech based on audio
@@ -555,6 +635,7 @@ export interface SessionCreateParams {
555635
| 'gpt-4o-realtime-preview'
556636
| 'gpt-4o-realtime-preview-2024-10-01'
557637
| 'gpt-4o-realtime-preview-2024-12-17'
638+
| 'gpt-4o-realtime-preview-2025-06-03'
558639
| 'gpt-4o-mini-realtime-preview'
559640
| 'gpt-4o-mini-realtime-preview-2024-12-17';
560641

@@ -564,6 +645,13 @@ export interface SessionCreateParams {
564645
*/
565646
output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw';
566647

648+
/**
649+
* The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
650+
* minimum speed. 1.5 is the maximum speed. This value can only be changed in
651+
* between model turns, not while a response is in progress.
652+
*/
653+
speed?: number;
654+
567655
/**
568656
* Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
569657
* temperature of 0.8 is highly recommended for best performance.
@@ -581,6 +669,15 @@ export interface SessionCreateParams {
581669
*/
582670
tools?: Array<SessionCreateParams.Tool>;
583671

672+
/**
673+
* Configuration options for tracing. Set to null to disable tracing. Once tracing
674+
* is enabled for a session, the configuration cannot be modified.
675+
*
676+
* `auto` will create a trace for the session with default values for the workflow
677+
* name, group id, and metadata.
678+
*/
679+
tracing?: 'auto' | SessionCreateParams.UnionMember1;
680+
584681
/**
585682
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
586683
* set to `null` to turn off, in which case the client must manually trigger model
@@ -719,6 +816,29 @@ export namespace SessionCreateParams {
719816
type?: 'function';
720817
}
721818

819+
/**
820+
* Granular configuration for tracing.
821+
*/
822+
export interface UnionMember1 {
823+
/**
824+
* The group id to attach to this trace to enable filtering and grouping in the
825+
* traces dashboard.
826+
*/
827+
group_id?: string;
828+
829+
/**
830+
* The arbitrary metadata to attach to this trace to enable filtering in the traces
831+
* dashboard.
832+
*/
833+
metadata?: unknown;
834+
835+
/**
836+
* The name of the workflow to attach to this trace. This is used to name the trace
837+
* in the traces dashboard.
838+
*/
839+
workflow_name?: string;
840+
}
841+
722842
/**
723843
* Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
724844
* set to `null` to turn off, in which case the client must manually trigger model

src/resources/shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type ChatModel =
3434
| 'gpt-4o-audio-preview'
3535
| 'gpt-4o-audio-preview-2024-10-01'
3636
| 'gpt-4o-audio-preview-2024-12-17'
37+
| 'gpt-4o-audio-preview-2025-06-03'
3738
| 'gpt-4o-mini-audio-preview'
3839
| 'gpt-4o-mini-audio-preview-2024-12-17'
3940
| 'gpt-4o-search-preview'

0 commit comments

Comments
 (0)