Skip to content

Commit 3fb80d7

Browse files
feat(api): removed streaming from translation/transcription endpoints
1 parent bb74944 commit 3fb80d7

File tree

5 files changed

+70
-192
lines changed

5 files changed

+70
-192
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 35
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/togetherai%2Ftogetherai-9e121bfbc10c1adadd6057831f0dc3b2784b0f31959200681eed561e4b4bd116.yml
33
openapi_spec_hash: 124b766fc217aee5b73420aa9764fd95
4-
config_hash: 0c4aa6f4b4a140792bcc025bd64e3d8b
4+
config_hash: b4b85388c0f7669e312feacd8c0b9c87

src/resources/audio/audio.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,9 @@ import { APIPromise } from '../../core';
55
import * as Core from '../../core';
66
import * as AudioAPI from './audio';
77
import * as TranscriptionsAPI from './transcriptions';
8-
import {
9-
TranscriptionCreateParams,
10-
TranscriptionCreateParamsNonStreaming,
11-
TranscriptionCreateResponse,
12-
Transcriptions,
13-
} from './transcriptions';
8+
import { TranscriptionCreateParams, TranscriptionCreateResponse, Transcriptions } from './transcriptions';
149
import * as TranslationsAPI from './translations';
15-
import {
16-
TranslationCreateParams,
17-
TranslationCreateParamsNonStreaming,
18-
TranslationCreateResponse,
19-
Translations,
20-
} from './translations';
10+
import { TranslationCreateParams, TranslationCreateResponse, Translations } from './translations';
2111
import { Stream } from '../../streaming';
2212
import { type Response } from '../../_shims/index';
2313

@@ -189,13 +179,11 @@ export declare namespace Audio {
189179
Transcriptions as Transcriptions,
190180
type TranscriptionCreateResponse as TranscriptionCreateResponse,
191181
type TranscriptionCreateParams as TranscriptionCreateParams,
192-
type TranscriptionCreateParamsNonStreaming as TranscriptionCreateParamsNonStreaming,
193182
};
194183

195184
export {
196185
Translations as Translations,
197186
type TranslationCreateResponse as TranslationCreateResponse,
198187
type TranslationCreateParams as TranslationCreateParams,
199-
type TranslationCreateParamsNonStreaming as TranslationCreateParamsNonStreaming,
200188
};
201189
}

src/resources/audio/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,5 @@ export {
1212
Transcriptions,
1313
type TranscriptionCreateResponse,
1414
type TranscriptionCreateParams,
15-
type TranscriptionCreateParamsNonStreaming,
1615
} from './transcriptions';
17-
export {
18-
Translations,
19-
type TranslationCreateResponse,
20-
type TranslationCreateParams,
21-
type TranslationCreateParamsNonStreaming,
22-
} from './translations';
16+
export { Translations, type TranslationCreateResponse, type TranslationCreateParams } from './translations';

src/resources/audio/transcriptions.ts

Lines changed: 33 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../resource';
4-
import { APIPromise } from '../../core';
54
import * as Core from '../../core';
6-
import * as AudioAPI from './audio';
7-
import { Stream } from '../../streaming';
85

96
export class Transcriptions extends APIResource {
107
/**
@@ -21,11 +18,8 @@ export class Transcriptions extends APIResource {
2118
create(
2219
body: TranscriptionCreateParams,
2320
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 }));
2923
}
3024
}
3125

@@ -120,94 +114,48 @@ export namespace TranscriptionCreateResponse {
120114
}
121115
}
122116

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;
172122

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;
178128

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';
183133

184-
/**
185-
* Optional text to bias decoding.
186-
*/
187-
prompt?: string;
134+
/**
135+
* Optional text to bias decoding.
136+
*/
137+
prompt?: string;
188138

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';
193143

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;
198148

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';
205154
}
206155

207156
export declare namespace Transcriptions {
208157
export {
209158
type TranscriptionCreateResponse as TranscriptionCreateResponse,
210159
type TranscriptionCreateParams as TranscriptionCreateParams,
211-
type TranscriptionCreateParamsNonStreaming as TranscriptionCreateParamsNonStreaming,
212160
};
213161
}

src/resources/audio/translations.ts

Lines changed: 33 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../resource';
4-
import { APIPromise } from '../../core';
54
import * as Core from '../../core';
6-
import * as AudioAPI from './audio';
7-
import { Stream } from '../../streaming';
85

96
export class Translations extends APIResource {
107
/**
@@ -20,11 +17,8 @@ export class Translations extends APIResource {
2017
create(
2118
body: TranslationCreateParams,
2219
options?: Core.RequestOptions,
23-
): APIPromise<Stream<AudioAPI.AudioSpeechStreamChunk>> {
24-
return this._client.post(
25-
'/audio/translations',
26-
Core.multipartFormRequestOptions({ body, ...options, stream: true }),
27-
) as APIPromise<Stream<AudioAPI.AudioSpeechStreamChunk>>;
20+
): Core.APIPromise<TranslationCreateResponse> {
21+
return this._client.post('/audio/translations', Core.multipartFormRequestOptions({ body, ...options }));
2822
}
2923
}
3024

@@ -119,94 +113,48 @@ export namespace TranslationCreateResponse {
119113
}
120114
}
121115

122-
export type TranslationCreateParams =
123-
| TranslationCreateParamsNonStreaming
124-
| TranslationCreateParamsNonStreaming;
125-
126-
export declare namespace TranslationCreateParams {
127-
export interface TranslationCreateParamsNonStreaming {
128-
/**
129-
* Audio file to translate
130-
*/
131-
file: Core.Uploadable;
132-
133-
/**
134-
* Target output language. Optional ISO 639-1 language code. If omitted, language
135-
* is set to English.
136-
*/
137-
language?: string;
138-
139-
/**
140-
* Model to use for translation
141-
*/
142-
model?: 'openai/whisper-large-v3';
143-
144-
/**
145-
* Optional text to bias decoding.
146-
*/
147-
prompt?: string;
148-
149-
/**
150-
* The format of the response
151-
*/
152-
response_format?: 'json' | 'verbose_json';
153-
154-
/**
155-
* Sampling temperature between 0.0 and 1.0
156-
*/
157-
temperature?: number;
158-
159-
/**
160-
* Controls level of timestamp detail in verbose_json. Only used when
161-
* response_format is verbose_json.
162-
*/
163-
timestamp_granularities?: 'segment' | 'word';
164-
}
165-
166-
export interface TranslationCreateParamsNonStreaming {
167-
/**
168-
* Audio file to translate
169-
*/
170-
file: Core.Uploadable;
116+
export interface TranslationCreateParams {
117+
/**
118+
* Audio file to translate
119+
*/
120+
file: Core.Uploadable;
171121

172-
/**
173-
* Target output language. Optional ISO 639-1 language code. If omitted, language
174-
* is set to English.
175-
*/
176-
language?: string;
122+
/**
123+
* Target output language. Optional ISO 639-1 language code. If omitted, language
124+
* is set to English.
125+
*/
126+
language?: string;
177127

178-
/**
179-
* Model to use for translation
180-
*/
181-
model?: 'openai/whisper-large-v3';
128+
/**
129+
* Model to use for translation
130+
*/
131+
model?: 'openai/whisper-large-v3';
182132

183-
/**
184-
* Optional text to bias decoding.
185-
*/
186-
prompt?: string;
133+
/**
134+
* Optional text to bias decoding.
135+
*/
136+
prompt?: string;
187137

188-
/**
189-
* The format of the response
190-
*/
191-
response_format?: 'json' | 'verbose_json';
138+
/**
139+
* The format of the response
140+
*/
141+
response_format?: 'json' | 'verbose_json';
192142

193-
/**
194-
* Sampling temperature between 0.0 and 1.0
195-
*/
196-
temperature?: number;
143+
/**
144+
* Sampling temperature between 0.0 and 1.0
145+
*/
146+
temperature?: number;
197147

198-
/**
199-
* Controls level of timestamp detail in verbose_json. Only used when
200-
* response_format is verbose_json.
201-
*/
202-
timestamp_granularities?: 'segment' | 'word';
203-
}
148+
/**
149+
* Controls level of timestamp detail in verbose_json. Only used when
150+
* response_format is verbose_json.
151+
*/
152+
timestamp_granularities?: 'segment' | 'word';
204153
}
205154

206155
export declare namespace Translations {
207156
export {
208157
type TranslationCreateResponse as TranslationCreateResponse,
209158
type TranslationCreateParams as TranslationCreateParams,
210-
type TranslationCreateParamsNonStreaming as TranslationCreateParamsNonStreaming,
211159
};
212160
}

0 commit comments

Comments
 (0)