Skip to content

Commit 1eab9ed

Browse files
stainless-app[bot]RobertCraigie
authored andcommitted
feat(api): new models for TTS, STT, + new audio features for Realtime
1 parent 3540b06 commit 1eab9ed

File tree

15 files changed

+1251
-137
lines changed

15 files changed

+1251
-137
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 81
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-b26121d5df6eb5d3032a45a267473798b15fcfec76dd44a3256cf1238be05fa4.yml
1+
configured_endpoints: 82
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-c22f59c66aec7914b6ee653d3098d1c1c8c16c180d2a158e819c8ddbf476f74b.yml

api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ Types:
140140
Types:
141141

142142
- <code><a href="./src/resources/audio/transcriptions.ts">Transcription</a></code>
143+
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionInclude</a></code>
143144
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionSegment</a></code>
145+
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionStreamEvent</a></code>
146+
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionTextDeltaEvent</a></code>
147+
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionTextDoneEvent</a></code>
144148
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionVerbose</a></code>
145149
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionWord</a></code>
146150
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionCreateResponse</a></code>
@@ -305,7 +309,9 @@ Types:
305309
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemDeleteEvent</a></code>
306310
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemDeletedEvent</a></code>
307311
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemInputAudioTranscriptionCompletedEvent</a></code>
312+
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemInputAudioTranscriptionDeltaEvent</a></code>
308313
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemInputAudioTranscriptionFailedEvent</a></code>
314+
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemRetrieveEvent</a></code>
309315
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemTruncateEvent</a></code>
310316
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemTruncatedEvent</a></code>
311317
- <code><a href="./src/resources/beta/realtime/realtime.ts">ConversationItemWithReference</a></code>
@@ -342,6 +348,8 @@ Types:
342348
- <code><a href="./src/resources/beta/realtime/realtime.ts">SessionCreatedEvent</a></code>
343349
- <code><a href="./src/resources/beta/realtime/realtime.ts">SessionUpdateEvent</a></code>
344350
- <code><a href="./src/resources/beta/realtime/realtime.ts">SessionUpdatedEvent</a></code>
351+
- <code><a href="./src/resources/beta/realtime/realtime.ts">TranscriptionSessionUpdate</a></code>
352+
- <code><a href="./src/resources/beta/realtime/realtime.ts">TranscriptionSessionUpdatedEvent</a></code>
345353

346354
### Sessions
347355

@@ -354,6 +362,16 @@ Methods:
354362

355363
- <code title="post /realtime/sessions">client.beta.realtime.sessions.<a href="./src/resources/beta/realtime/sessions.ts">create</a>({ ...params }) -> SessionCreateResponse</code>
356364

365+
### TranscriptionSessions
366+
367+
Types:
368+
369+
- <code><a href="./src/resources/beta/realtime/transcription-sessions.ts">TranscriptionSession</a></code>
370+
371+
Methods:
372+
373+
- <code title="post /realtime/transcription_sessions">client.beta.realtime.transcriptionSessions.<a href="./src/resources/beta/realtime/transcription-sessions.ts">create</a>({ ...params }) -> TranscriptionSession</code>
374+
357375
## Assistants
358376

359377
Types:

src/resources/audio/audio.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ import * as TranscriptionsAPI from './transcriptions';
77
import {
88
Transcription,
99
TranscriptionCreateParams,
10+
TranscriptionCreateParamsNonStreaming,
11+
TranscriptionCreateParamsStreaming,
1012
TranscriptionCreateResponse,
13+
TranscriptionInclude,
1114
TranscriptionSegment,
15+
TranscriptionStreamEvent,
16+
TranscriptionTextDeltaEvent,
17+
TranscriptionTextDoneEvent,
1218
TranscriptionVerbose,
1319
TranscriptionWord,
1420
Transcriptions,
@@ -28,11 +34,12 @@ export class Audio extends APIResource {
2834
speech: SpeechAPI.Speech = new SpeechAPI.Speech(this._client);
2935
}
3036

31-
export type AudioModel = 'whisper-1';
37+
export type AudioModel = 'whisper-1' | 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe';
3238

3339
/**
3440
* The format of the output, in one of these options: `json`, `text`, `srt`,
35-
* `verbose_json`, or `vtt`.
41+
* `verbose_json`, or `vtt`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`,
42+
* the only supported format is `json`.
3643
*/
3744
export type AudioResponseFormat = 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
3845

@@ -46,11 +53,17 @@ export declare namespace Audio {
4653
export {
4754
Transcriptions as Transcriptions,
4855
type Transcription as Transcription,
56+
type TranscriptionInclude as TranscriptionInclude,
4957
type TranscriptionSegment as TranscriptionSegment,
58+
type TranscriptionStreamEvent as TranscriptionStreamEvent,
59+
type TranscriptionTextDeltaEvent as TranscriptionTextDeltaEvent,
60+
type TranscriptionTextDoneEvent as TranscriptionTextDoneEvent,
5061
type TranscriptionVerbose as TranscriptionVerbose,
5162
type TranscriptionWord as TranscriptionWord,
5263
type TranscriptionCreateResponse as TranscriptionCreateResponse,
5364
type TranscriptionCreateParams as TranscriptionCreateParams,
65+
type TranscriptionCreateParamsNonStreaming as TranscriptionCreateParamsNonStreaming,
66+
type TranscriptionCreateParamsStreaming as TranscriptionCreateParamsStreaming,
5467
};
5568

5669
export {

src/resources/audio/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ export { Speech, type SpeechModel, type SpeechCreateParams } from './speech';
55
export {
66
Transcriptions,
77
type Transcription,
8+
type TranscriptionInclude,
89
type TranscriptionSegment,
10+
type TranscriptionStreamEvent,
11+
type TranscriptionTextDeltaEvent,
12+
type TranscriptionTextDoneEvent,
913
type TranscriptionVerbose,
1014
type TranscriptionWord,
1115
type TranscriptionCreateResponse,
1216
type TranscriptionCreateParams,
17+
type TranscriptionCreateParamsNonStreaming,
18+
type TranscriptionCreateParamsStreaming,
1319
} from './transcriptions';
1420
export {
1521
Translations,

src/resources/audio/speech.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class Speech extends APIResource {
1919
}
2020
}
2121

22-
export type SpeechModel = 'tts-1' | 'tts-1-hd';
22+
export type SpeechModel = 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts';
2323

2424
export interface SpeechCreateParams {
2525
/**
@@ -29,7 +29,7 @@ export interface SpeechCreateParams {
2929

3030
/**
3131
* One of the available [TTS models](https://platform.openai.com/docs/models#tts):
32-
* `tts-1` or `tts-1-hd`
32+
* `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
3333
*/
3434
model: (string & {}) | SpeechModel;
3535

@@ -41,6 +41,12 @@ export interface SpeechCreateParams {
4141
*/
4242
voice: 'alloy' | 'ash' | 'coral' | 'echo' | 'fable' | 'onyx' | 'nova' | 'sage' | 'shimmer';
4343

44+
/**
45+
* Control the voice of your generated audio with additional instructions. Does not
46+
* work with `tts-1` or `tts-1-hd`.
47+
*/
48+
instructions?: string;
49+
4450
/**
4551
* The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,
4652
* `wav`, and `pcm`.

0 commit comments

Comments
 (0)