Skip to content

Commit

Permalink
fix(audio): correct response_format translations type (#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Sep 25, 2024
1 parent bf374b8 commit 00c93cd
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 68
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-de1981b64ac229493473670d618500c6362c195f1057eb7de00bd1bc9184fbd5.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-073331021d48db6af646a3552ab0c682efe31b7fb4e59a109ed1ba539f9b89c5.yml
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Methods:
Types:

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

## Transcriptions

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ export namespace OpenAI {

export import Audio = API.Audio;
export import AudioModel = API.AudioModel;
export import AudioResponseFormat = API.AudioResponseFormat;

export import Moderations = API.Moderations;
export import Moderation = API.Moderation;
Expand Down
7 changes: 7 additions & 0 deletions src/resources/audio/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ export class Audio extends APIResource {

export type AudioModel = 'whisper-1';

/**
* The format of the output, in one of these options: `json`, `text`, `srt`,
* `verbose_json`, or `vtt`.
*/
export type AudioResponseFormat = 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';

export namespace Audio {
export import AudioModel = AudioAPI.AudioModel;
export import AudioResponseFormat = AudioAPI.AudioResponseFormat;
export import Transcriptions = TranscriptionsAPI.Transcriptions;
export import Transcription = TranscriptionsAPI.Transcription;
export import TranscriptionCreateParams = TranscriptionsAPI.TranscriptionCreateParams;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/audio/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { AudioModel, Audio } from './audio';
export { AudioModel, AudioResponseFormat, Audio } from './audio';
export { SpeechModel, SpeechCreateParams, Speech } from './speech';
export { Transcription, TranscriptionCreateParams, Transcriptions } from './transcriptions';
export { Translation, TranslationCreateParams, Translations } from './translations';
6 changes: 3 additions & 3 deletions src/resources/audio/transcriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export interface TranscriptionCreateParams {
prompt?: string;

/**
* The format of the transcript output, in one of these options: `json`, `text`,
* `srt`, `verbose_json`, or `vtt`.
* The format of the output, in one of these options: `json`, `text`, `srt`,
* `verbose_json`, or `vtt`.
*/
response_format?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
response_format?: AudioAPI.AudioResponseFormat;

/**
* The sampling temperature, between 0 and 1. Higher values like 0.8 will make the
Expand Down
6 changes: 3 additions & 3 deletions src/resources/audio/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export interface TranslationCreateParams {
prompt?: string;

/**
* The format of the transcript output, in one of these options: `json`, `text`,
* `srt`, `verbose_json`, or `vtt`.
* The format of the output, in one of these options: `json`, `text`, `srt`,
* `verbose_json`, or `vtt`.
*/
response_format?: string;
response_format?: AudioAPI.AudioResponseFormat;

/**
* The sampling temperature, between 0 and 1. Higher values like 0.8 will make the
Expand Down
2 changes: 1 addition & 1 deletion src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export * from './chat/index';
export * from './shared';
export { AudioModel, Audio } from './audio/audio';
export { AudioModel, AudioResponseFormat, Audio } from './audio/audio';
export {
Batch,
BatchError,
Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/audio/translations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('resource translations', () => {
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
model: 'whisper-1',
prompt: 'prompt',
response_format: 'response_format',
response_format: 'json',
temperature: 0,
});
});
Expand Down

0 comments on commit 00c93cd

Please sign in to comment.