Skip to content

Commit 2d27392

Browse files
feat(api): Add support for gpt-4o-transcribe-diarize on audio/transcriptions endpoint
1 parent f72fd94 commit 2d27392

File tree

8 files changed

+255
-23
lines changed

8 files changed

+255
-23
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 135
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-11d308a9ef78ad01aa11c880a084a3982276800d7994db3f454aa515474977d7.yml
3-
openapi_spec_hash: 0a4bbb5aa0ae532a072bd6b3854e70b1
4-
config_hash: f0940d0906846178759ef7128e4cb98e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-104cced8f4c7436a76eea02e26307828166405ccfb296faffb008b72772c11a7.yml
3+
openapi_spec_hash: fdc03ed84a65a31b80da909255e53924
4+
config_hash: 03b48e9b8c7231a902403210dbd7dfa0

api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,14 @@ Types:
156156
Types:
157157

158158
- <code><a href="./src/resources/audio/transcriptions.ts">Transcription</a></code>
159+
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionDiarized</a></code>
160+
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionDiarizedSegment</a></code>
159161
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionInclude</a></code>
160162
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionSegment</a></code>
161163
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionStreamEvent</a></code>
162164
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionTextDeltaEvent</a></code>
163165
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionTextDoneEvent</a></code>
166+
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionTextSegmentEvent</a></code>
164167
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionVerbose</a></code>
165168
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionWord</a></code>
166169
- <code><a href="./src/resources/audio/transcriptions.ts">TranscriptionCreateResponse</a></code>

src/resources/audio/audio.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ import {
1010
TranscriptionCreateParamsNonStreaming,
1111
TranscriptionCreateParamsStreaming,
1212
TranscriptionCreateResponse,
13+
TranscriptionDiarized,
14+
TranscriptionDiarizedSegment,
1315
TranscriptionInclude,
1416
TranscriptionSegment,
1517
TranscriptionStreamEvent,
1618
TranscriptionTextDeltaEvent,
1719
TranscriptionTextDoneEvent,
20+
TranscriptionTextSegmentEvent,
1821
TranscriptionVerbose,
1922
TranscriptionWord,
2023
Transcriptions,
@@ -34,14 +37,20 @@ export class Audio extends APIResource {
3437
speech: SpeechAPI.Speech = new SpeechAPI.Speech(this._client);
3538
}
3639

37-
export type AudioModel = 'whisper-1' | 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe';
40+
export type AudioModel =
41+
| 'whisper-1'
42+
| 'gpt-4o-transcribe'
43+
| 'gpt-4o-mini-transcribe'
44+
| 'gpt-4o-transcribe-diarize';
3845

3946
/**
4047
* The format of the output, in one of these options: `json`, `text`, `srt`,
41-
* `verbose_json`, or `vtt`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`,
42-
* the only supported format is `json`.
48+
* `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and
49+
* `gpt-4o-mini-transcribe`, the only supported format is `json`. For
50+
* `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and
51+
* `diarized_json`, with `diarized_json` required to receive speaker annotations.
4352
*/
44-
export type AudioResponseFormat = 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
53+
export type AudioResponseFormat = 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt' | 'diarized_json';
4554

4655
Audio.Transcriptions = Transcriptions;
4756
Audio.Translations = Translations;
@@ -53,11 +62,14 @@ export declare namespace Audio {
5362
export {
5463
Transcriptions as Transcriptions,
5564
type Transcription as Transcription,
65+
type TranscriptionDiarized as TranscriptionDiarized,
66+
type TranscriptionDiarizedSegment as TranscriptionDiarizedSegment,
5667
type TranscriptionInclude as TranscriptionInclude,
5768
type TranscriptionSegment as TranscriptionSegment,
5869
type TranscriptionStreamEvent as TranscriptionStreamEvent,
5970
type TranscriptionTextDeltaEvent as TranscriptionTextDeltaEvent,
6071
type TranscriptionTextDoneEvent as TranscriptionTextDoneEvent,
72+
type TranscriptionTextSegmentEvent as TranscriptionTextSegmentEvent,
6173
type TranscriptionVerbose as TranscriptionVerbose,
6274
type TranscriptionWord as TranscriptionWord,
6375
type TranscriptionCreateResponse as TranscriptionCreateResponse,

src/resources/audio/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ export { Speech, type SpeechModel, type SpeechCreateParams } from './speech';
55
export {
66
Transcriptions,
77
type Transcription,
8+
type TranscriptionDiarized,
9+
type TranscriptionDiarizedSegment,
810
type TranscriptionInclude,
911
type TranscriptionSegment,
1012
type TranscriptionStreamEvent,
1113
type TranscriptionTextDeltaEvent,
1214
type TranscriptionTextDoneEvent,
15+
type TranscriptionTextSegmentEvent,
1316
type TranscriptionVerbose,
1417
type TranscriptionWord,
1518
type TranscriptionCreateResponse,

0 commit comments

Comments
 (0)