Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(audio): correct response_format translations type (#1097)
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Sep 25, 2024
commit 9a5f461306e84b62ce1ed8aedbfee90798def5fb
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 @@ -108,6 +108,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