Skip to content

Commit 9f86d27

Browse files
fix(audio): correct response_format translations type (#1097)
1 parent 5ecdeae commit 9f86d27

File tree

9 files changed

+19
-10
lines changed

9 files changed

+19
-10
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 68
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-de1981b64ac229493473670d618500c6362c195f1057eb7de00bd1bc9184fbd5.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-073331021d48db6af646a3552ab0c682efe31b7fb4e59a109ed1ba539f9b89c5.yml

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Methods:
108108
Types:
109109

110110
- <code><a href="./src/resources/audio/audio.ts">AudioModel</a></code>
111+
- <code><a href="./src/resources/audio/audio.ts">AudioResponseFormat</a></code>
111112

112113
## Transcriptions
113114

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ export namespace OpenAI {
298298

299299
export import Audio = API.Audio;
300300
export import AudioModel = API.AudioModel;
301+
export import AudioResponseFormat = API.AudioResponseFormat;
301302

302303
export import Moderations = API.Moderations;
303304
export import Moderation = API.Moderation;

src/resources/audio/audio.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ export class Audio extends APIResource {
1414

1515
export type AudioModel = 'whisper-1';
1616

17+
/**
18+
* The format of the output, in one of these options: `json`, `text`, `srt`,
19+
* `verbose_json`, or `vtt`.
20+
*/
21+
export type AudioResponseFormat = 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
22+
1723
export namespace Audio {
1824
export import AudioModel = AudioAPI.AudioModel;
25+
export import AudioResponseFormat = AudioAPI.AudioResponseFormat;
1926
export import Transcriptions = TranscriptionsAPI.Transcriptions;
2027
export import Transcription = TranscriptionsAPI.Transcription;
2128
export import TranscriptionCreateParams = TranscriptionsAPI.TranscriptionCreateParams;

src/resources/audio/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
export { AudioModel, Audio } from './audio';
3+
export { AudioModel, AudioResponseFormat, Audio } from './audio';
44
export { SpeechModel, SpeechCreateParams, Speech } from './speech';
55
export { Transcription, TranscriptionCreateParams, Transcriptions } from './transcriptions';
66
export { Translation, TranslationCreateParams, Translations } from './translations';

src/resources/audio/transcriptions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ export interface TranscriptionCreateParams {
5454
prompt?: string;
5555

5656
/**
57-
* The format of the transcript output, in one of these options: `json`, `text`,
58-
* `srt`, `verbose_json`, or `vtt`.
57+
* The format of the output, in one of these options: `json`, `text`, `srt`,
58+
* `verbose_json`, or `vtt`.
5959
*/
60-
response_format?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
60+
response_format?: AudioAPI.AudioResponseFormat;
6161

6262
/**
6363
* The sampling temperature, between 0 and 1. Higher values like 0.8 will make the

src/resources/audio/translations.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ export interface TranslationCreateParams {
4040
prompt?: string;
4141

4242
/**
43-
* The format of the transcript output, in one of these options: `json`, `text`,
44-
* `srt`, `verbose_json`, or `vtt`.
43+
* The format of the output, in one of these options: `json`, `text`, `srt`,
44+
* `verbose_json`, or `vtt`.
4545
*/
46-
response_format?: string;
46+
response_format?: AudioAPI.AudioResponseFormat;
4747

4848
/**
4949
* The sampling temperature, between 0 and 1. Higher values like 0.8 will make the

src/resources/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
export * from './chat/index';
44
export * from './shared';
5-
export { AudioModel, Audio } from './audio/audio';
5+
export { AudioModel, AudioResponseFormat, Audio } from './audio/audio';
66
export {
77
Batch,
88
BatchError,

tests/api-resources/audio/translations.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('resource translations', () => {
2828
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
2929
model: 'whisper-1',
3030
prompt: 'prompt',
31-
response_format: 'response_format',
31+
response_format: 'json',
3232
temperature: 0,
3333
});
3434
});

0 commit comments

Comments
 (0)