1
1
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
3
3
import { APIResource } from '../../resource' ;
4
- import { APIPromise } from '../../core' ;
5
4
import * as Core from '../../core' ;
6
- import * as AudioAPI from './audio' ;
7
- import { Stream } from '../../streaming' ;
8
5
9
6
export class Transcriptions extends APIResource {
10
7
/**
@@ -21,11 +18,8 @@ export class Transcriptions extends APIResource {
21
18
create (
22
19
body : TranscriptionCreateParams ,
23
20
options ?: Core . RequestOptions ,
24
- ) : APIPromise < Stream < AudioAPI . AudioSpeechStreamChunk > > {
25
- return this . _client . post (
26
- '/audio/transcriptions' ,
27
- Core . multipartFormRequestOptions ( { body, ...options , stream : true } ) ,
28
- ) as APIPromise < Stream < AudioAPI . AudioSpeechStreamChunk > > ;
21
+ ) : Core . APIPromise < TranscriptionCreateResponse > {
22
+ return this . _client . post ( '/audio/transcriptions' , Core . multipartFormRequestOptions ( { body, ...options } ) ) ;
29
23
}
30
24
}
31
25
@@ -120,94 +114,48 @@ export namespace TranscriptionCreateResponse {
120
114
}
121
115
}
122
116
123
- export type TranscriptionCreateParams =
124
- | TranscriptionCreateParamsNonStreaming
125
- | TranscriptionCreateParamsNonStreaming ;
126
-
127
- export declare namespace TranscriptionCreateParams {
128
- export interface TranscriptionCreateParamsNonStreaming {
129
- /**
130
- * Audio file to transcribe
131
- */
132
- file : Core . Uploadable ;
133
-
134
- /**
135
- * Optional ISO 639-1 language code. If `auto` is provided, language is
136
- * auto-detected.
137
- */
138
- language ?: string ;
139
-
140
- /**
141
- * Model to use for transcription
142
- */
143
- model ?: 'openai/whisper-large-v3' ;
144
-
145
- /**
146
- * Optional text to bias decoding.
147
- */
148
- prompt ?: string ;
149
-
150
- /**
151
- * The format of the response
152
- */
153
- response_format ?: 'json' | 'verbose_json' ;
154
-
155
- /**
156
- * Sampling temperature between 0.0 and 1.0
157
- */
158
- temperature ?: number ;
159
-
160
- /**
161
- * Controls level of timestamp detail in verbose_json. Only used when
162
- * response_format is verbose_json.
163
- */
164
- timestamp_granularities ?: 'segment' | 'word' ;
165
- }
166
-
167
- export interface TranscriptionCreateParamsNonStreaming {
168
- /**
169
- * Audio file to transcribe
170
- */
171
- file : Core . Uploadable ;
117
+ export interface TranscriptionCreateParams {
118
+ /**
119
+ * Audio file to transcribe
120
+ */
121
+ file : Core . Uploadable ;
172
122
173
- /**
174
- * Optional ISO 639-1 language code. If `auto` is provided, language is
175
- * auto-detected.
176
- */
177
- language ?: string ;
123
+ /**
124
+ * Optional ISO 639-1 language code. If `auto` is provided, language is
125
+ * auto-detected.
126
+ */
127
+ language ?: string ;
178
128
179
- /**
180
- * Model to use for transcription
181
- */
182
- model ?: 'openai/whisper-large-v3' ;
129
+ /**
130
+ * Model to use for transcription
131
+ */
132
+ model ?: 'openai/whisper-large-v3' ;
183
133
184
- /**
185
- * Optional text to bias decoding.
186
- */
187
- prompt ?: string ;
134
+ /**
135
+ * Optional text to bias decoding.
136
+ */
137
+ prompt ?: string ;
188
138
189
- /**
190
- * The format of the response
191
- */
192
- response_format ?: 'json' | 'verbose_json' ;
139
+ /**
140
+ * The format of the response
141
+ */
142
+ response_format ?: 'json' | 'verbose_json' ;
193
143
194
- /**
195
- * Sampling temperature between 0.0 and 1.0
196
- */
197
- temperature ?: number ;
144
+ /**
145
+ * Sampling temperature between 0.0 and 1.0
146
+ */
147
+ temperature ?: number ;
198
148
199
- /**
200
- * Controls level of timestamp detail in verbose_json. Only used when
201
- * response_format is verbose_json.
202
- */
203
- timestamp_granularities ?: 'segment' | 'word' ;
204
- }
149
+ /**
150
+ * Controls level of timestamp detail in verbose_json. Only used when
151
+ * response_format is verbose_json.
152
+ */
153
+ timestamp_granularities ?: 'segment' | 'word' ;
205
154
}
206
155
207
156
export declare namespace Transcriptions {
208
157
export {
209
158
type TranscriptionCreateResponse as TranscriptionCreateResponse ,
210
159
type TranscriptionCreateParams as TranscriptionCreateParams ,
211
- type TranscriptionCreateParamsNonStreaming as TranscriptionCreateParamsNonStreaming ,
212
160
} ;
213
161
}
0 commit comments