Skip to content

Commit 8ab2174

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

File tree

9 files changed

+368
-58
lines changed

9 files changed

+368
-58
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: 123
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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,18 @@ Params Types:
179179
Response Types:
180180

181181
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#Transcription">Transcription</a>
182+
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#TranscriptionSegment">TranscriptionSegment</a>
182183
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#TranscriptionStreamEventUnion">TranscriptionStreamEventUnion</a>
183184
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#TranscriptionTextDeltaEvent">TranscriptionTextDeltaEvent</a>
184185
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#TranscriptionTextDoneEvent">TranscriptionTextDoneEvent</a>
186+
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#TranscriptionTextSegmentEvent">TranscriptionTextSegmentEvent</a>
187+
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#TranscriptionVerbose">TranscriptionVerbose</a>
188+
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#TranscriptionWord">TranscriptionWord</a>
189+
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#AudioTranscriptionNewResponseUnion">AudioTranscriptionNewResponseUnion</a>
185190

186191
Methods:
187192

188-
- <code title="post /audio/transcriptions">client.Audio.Transcriptions.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#AudioTranscriptionService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#AudioTranscriptionNewParams">AudioTranscriptionNewParams</a>) (Transcription, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
193+
- <code title="post /audio/transcriptions">client.Audio.Transcriptions.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#AudioTranscriptionService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#AudioTranscriptionNewParams">AudioTranscriptionNewParams</a>) (<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#AudioTranscriptionNewResponseUnion">AudioTranscriptionNewResponseUnion</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
189194

190195
## Translations
191196

audio.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,24 @@ func NewAudioService(opts ...option.RequestOption) (r AudioService) {
3434
type AudioModel = string
3535

3636
const (
37-
AudioModelWhisper1 AudioModel = "whisper-1"
38-
AudioModelGPT4oTranscribe AudioModel = "gpt-4o-transcribe"
39-
AudioModelGPT4oMiniTranscribe AudioModel = "gpt-4o-mini-transcribe"
37+
AudioModelWhisper1 AudioModel = "whisper-1"
38+
AudioModelGPT4oTranscribe AudioModel = "gpt-4o-transcribe"
39+
AudioModelGPT4oMiniTranscribe AudioModel = "gpt-4o-mini-transcribe"
40+
AudioModelGPT4oTranscribeDiarize AudioModel = "gpt-4o-transcribe-diarize"
4041
)
4142

4243
// The format of the output, in one of these options: `json`, `text`, `srt`,
43-
// `verbose_json`, or `vtt`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`,
44-
// the only supported format is `json`.
44+
// `verbose_json`, `vtt`, or `diarized_json`. For `gpt-4o-transcribe` and
45+
// `gpt-4o-mini-transcribe`, the only supported format is `json`. For
46+
// `gpt-4o-transcribe-diarize`, the supported formats are `json`, `text`, and
47+
// `diarized_json`, with `diarized_json` required to receive speaker annotations.
4548
type AudioResponseFormat string
4649

4750
const (
48-
AudioResponseFormatJSON AudioResponseFormat = "json"
49-
AudioResponseFormatText AudioResponseFormat = "text"
50-
AudioResponseFormatSRT AudioResponseFormat = "srt"
51-
AudioResponseFormatVerboseJSON AudioResponseFormat = "verbose_json"
52-
AudioResponseFormatVTT AudioResponseFormat = "vtt"
51+
AudioResponseFormatJSON AudioResponseFormat = "json"
52+
AudioResponseFormatText AudioResponseFormat = "text"
53+
AudioResponseFormatSRT AudioResponseFormat = "srt"
54+
AudioResponseFormatVerboseJSON AudioResponseFormat = "verbose_json"
55+
AudioResponseFormatVTT AudioResponseFormat = "vtt"
56+
AudioResponseFormatDiarizedJSON AudioResponseFormat = "diarized_json"
5357
)

0 commit comments

Comments
 (0)