Skip to content

Commit 8918e88

Browse files
committed
feat(client): Make t2s awaitable
1 parent ea48b24 commit 8918e88

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/resources/text-to-speech.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { APIResource } from '../resource';
44
import * as Core from '../core';
5+
import { APIPromiseWithAwaitableTask, wrapAsWaitableResource } from '../lib/polling';
56

67
export class TextToSpeech extends APIResource {
78
/**
@@ -10,8 +11,10 @@ export class TextToSpeech extends APIResource {
1011
create(
1112
body: TextToSpeechCreateParams,
1213
options?: Core.RequestOptions,
13-
): Core.APIPromise<TextToSpeechCreateResponse> {
14-
return this._client.post('/v1/text_to_speech', { body, ...options });
14+
): APIPromiseWithAwaitableTask<TextToSpeechCreateResponse> {
15+
return wrapAsWaitableResource<TextToSpeechCreateResponse>(this._client)(
16+
this._client.post('/v1/text_to_speech', { body, ...options }),
17+
);
1518
}
1619
}
1720

0 commit comments

Comments
 (0)