@@ -9,10 +9,22 @@ export class Transcriptions extends APIResource {
99 /**
1010 * Transcribes audio into the input language.
1111 */
12+ create (
13+ body : TranscriptionCreateParams < 'json' > ,
14+ options ?: Core . RequestOptions ,
15+ ) : Core . APIPromise < Transcription > ;
16+ create (
17+ body : TranscriptionCreateParams < 'verbose_json' > ,
18+ options ?: Core . RequestOptions ,
19+ ) : Core . APIPromise < TranscriptionVerbose > ;
20+ create (
21+ body : TranscriptionCreateParams < 'srt' | 'vtt' | 'text' > ,
22+ options ?: Core . RequestOptions ,
23+ ) : Core . APIPromise < string > ;
1224 create (
1325 body : TranscriptionCreateParams ,
1426 options ?: Core . RequestOptions ,
15- ) : Core . APIPromise < TranscriptionCreateResponse > {
27+ ) : Core . APIPromise < TranscriptionCreateResponse | string > {
1628 return this . _client . post ( '/audio/transcriptions' , Core . multipartFormRequestOptions ( { body, ...options } ) ) ;
1729 }
1830}
@@ -137,7 +149,9 @@ export interface TranscriptionWord {
137149 */
138150export type TranscriptionCreateResponse = Transcription | TranscriptionVerbose ;
139151
140- export interface TranscriptionCreateParams {
152+ export interface TranscriptionCreateParams <
153+ ResponseFormat extends AudioAPI . AudioResponseFormat = AudioAPI . AudioResponseFormat ,
154+ > {
141155 /**
142156 * The audio file object (not file name) to transcribe, in one of these formats:
143157 * flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
@@ -169,7 +183,7 @@ export interface TranscriptionCreateParams {
169183 * The format of the output, in one of these options: `json`, `text`, `srt`,
170184 * `verbose_json`, or `vtt`.
171185 */
172- response_format ?: AudioAPI . AudioResponseFormat ;
186+ response_format ?: ResponseFormat ;
173187
174188 /**
175189 * The sampling temperature, between 0 and 1. Higher values like 0.8 will make the
0 commit comments