Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #111

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/toddlzt%2Ftoddlzt-58940d53b2ab1ca01dcc937cefe1ec6c44d1318613b222fa77c58d22827a2d9b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/toddlzt%2Ftoddlzt-61fa00768b393cdf67a173e1c1e62a6bae4dbf15007bdea88296ec2692c018f7.yml
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ Methods:

Types:

- <code><a href="./src/resources/voice.ts">VoiceRetrieveResponse</a></code>
- <code><a href="./src/resources/voice.ts">LlmResponse</a></code>
- <code><a href="./src/resources/voice.ts">VoiceListResponse</a></code>

Methods:

- <code title="get /get-voice/{voice_id}">client.voice.<a href="./src/resources/voice.ts">retrieve</a>(voiceId) -> VoiceRetrieveResponse</code>
- <code title="get /get-voice/{voice_id}">client.voice.<a href="./src/resources/voice.ts">retrieve</a>(voiceId) -> LlmResponse</code>
- <code title="get /list-voices">client.voice.<a href="./src/resources/voice.ts">list</a>() -> VoiceListResponse</code>
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export class Retell extends Core.APIClient {
}

protected override stringifyQuery(query: Record<string, unknown>): string {
return qs.stringify(query, { arrayFormat: 'comma' });
return qs.stringify(query, { arrayFormat: 'brackets' });
}

static Retell = this;
Expand Down Expand Up @@ -204,7 +204,7 @@ export namespace Retell {
export import LlmUpdateParams = API.LlmUpdateParams;

export import Voice = API.Voice;
export import VoiceRetrieveResponse = API.VoiceRetrieveResponse;
export import LlmResponse = API.LlmResponse;
export import VoiceListResponse = API.VoiceListResponse;
}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export {
Call,
} from './call';
export { LlmResponse, LlmListResponse, LlmCreateParams, LlmUpdateParams, Llm } from './llm';
export { LlmResponse, VoiceListResponse, Voice } from './voice';
export {
PhoneNumberResponse,
PhoneNumberListResponse,
PhoneNumberCreateParams,
PhoneNumberUpdateParams,
PhoneNumber,
} from './phone-number';
export { VoiceRetrieveResponse, VoiceListResponse, Voice } from './voice';
47 changes: 4 additions & 43 deletions src/resources/voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class Voice extends APIResource {
/**
* Retrieve details of a specific voice
*/
retrieve(voiceId: string, options?: Core.RequestOptions): Core.APIPromise<VoiceRetrieveResponse> {
retrieve(voiceId: string, options?: Core.RequestOptions): Core.APIPromise<LlmResponse> {
return this._client.get(`/get-voice/${voiceId}`, options);
}

Expand All @@ -20,7 +20,7 @@ export class Voice extends APIResource {
}
}

export interface VoiceRetrieveResponse {
export interface LlmResponse {
/**
* Gender of voice.
*/
Expand Down Expand Up @@ -57,48 +57,9 @@ export interface VoiceRetrieveResponse {
preview_audio_url?: string;
}

export type VoiceListResponse = Array<VoiceListResponse.VoiceListResponseItem>;

export namespace VoiceListResponse {
export interface VoiceListResponseItem {
/**
* Gender of voice.
*/
gender: 'male' | 'female';

/**
* Indicates the provider of voice.
*/
provider: 'elevenlabs' | 'openai' | 'deepgram';

/**
* Unique id for the voice.
*/
voice_id: string;

/**
* Name of the voice.
*/
voice_name: string;

/**
* Accent annotation of the voice.
*/
accent?: string;

/**
* Age annotation of the voice.
*/
age?: string;

/**
* URL to the preview audio of the voice.
*/
preview_audio_url?: string;
}
}
export type VoiceListResponse = Array<LlmResponse>;

export namespace Voice {
export import VoiceRetrieveResponse = VoiceAPI.VoiceRetrieveResponse;
export import LlmResponse = VoiceAPI.LlmResponse;
export import VoiceListResponse = VoiceAPI.VoiceListResponse;
}