telnyx 6.71.0 → 6.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/client.d.mts +8 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -8
- package/client.d.ts.map +1 -1
- package/client.js +6 -6
- package/client.js.map +1 -1
- package/client.mjs +6 -6
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +1 -1
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +1 -1
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js +2 -2
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs +2 -2
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/speech-to-text/index.d.mts +3 -3
- package/resources/speech-to-text/index.d.mts.map +1 -1
- package/resources/speech-to-text/index.d.ts +3 -3
- package/resources/speech-to-text/index.d.ts.map +1 -1
- package/resources/speech-to-text/index.js +1 -5
- package/resources/speech-to-text/index.js.map +1 -1
- package/resources/speech-to-text/index.mjs +0 -2
- package/resources/speech-to-text/index.mjs.map +1 -1
- package/resources/speech-to-text/internal-base.d.mts +42 -11
- package/resources/speech-to-text/internal-base.d.mts.map +1 -1
- package/resources/speech-to-text/internal-base.d.ts +42 -11
- package/resources/speech-to-text/internal-base.d.ts.map +1 -1
- package/resources/speech-to-text/internal-base.js +5 -9
- package/resources/speech-to-text/internal-base.js.map +1 -1
- package/resources/speech-to-text/internal-base.mjs +5 -9
- package/resources/speech-to-text/internal-base.mjs.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.mts +79 -100
- package/resources/speech-to-text/speech-to-text.d.mts.map +1 -1
- package/resources/speech-to-text/speech-to-text.d.ts +79 -100
- package/resources/speech-to-text/speech-to-text.d.ts.map +1 -1
- package/resources/speech-to-text/speech-to-text.js +16 -19
- package/resources/speech-to-text/speech-to-text.js.map +1 -1
- package/resources/speech-to-text/speech-to-text.mjs +16 -19
- package/resources/speech-to-text/speech-to-text.mjs.map +1 -1
- package/resources/speech-to-text/ws-base.d.mts +106 -0
- package/resources/speech-to-text/ws-base.d.mts.map +1 -0
- package/resources/speech-to-text/ws-base.d.ts +106 -0
- package/resources/speech-to-text/ws-base.d.ts.map +1 -0
- package/resources/speech-to-text/ws-base.js +476 -0
- package/resources/speech-to-text/ws-base.js.map +1 -0
- package/resources/speech-to-text/ws-base.mjs +472 -0
- package/resources/speech-to-text/ws-base.mjs.map +1 -0
- package/resources/speech-to-text/ws.d.mts +9 -28
- package/resources/speech-to-text/ws.d.mts.map +1 -1
- package/resources/speech-to-text/ws.d.ts +9 -28
- package/resources/speech-to-text/ws.d.ts.map +1 -1
- package/resources/speech-to-text/ws.js +17 -97
- package/resources/speech-to-text/ws.js.map +1 -1
- package/resources/speech-to-text/ws.mjs +17 -97
- package/resources/speech-to-text/ws.mjs.map +1 -1
- package/resources/speech-to-text.d.mts +1 -80
- package/resources/speech-to-text.d.mts.map +1 -1
- package/resources/speech-to-text.d.ts +1 -80
- package/resources/speech-to-text.d.ts.map +1 -1
- package/resources/speech-to-text.js +2 -32
- package/resources/speech-to-text.js.map +1 -1
- package/resources/speech-to-text.mjs +1 -30
- package/resources/speech-to-text.mjs.map +1 -1
- package/resources/texml/accounts/calls/calls.d.mts +31 -465
- package/resources/texml/accounts/calls/calls.d.mts.map +1 -1
- package/resources/texml/accounts/calls/calls.d.ts +31 -465
- package/resources/texml/accounts/calls/calls.d.ts.map +1 -1
- package/resources/texml/accounts/calls/calls.js +7 -1
- package/resources/texml/accounts/calls/calls.js.map +1 -1
- package/resources/texml/accounts/calls/calls.mjs +7 -1
- package/resources/texml/accounts/calls/calls.mjs.map +1 -1
- package/resources/text-to-speech/index.d.mts +1 -1
- package/resources/text-to-speech/index.d.mts.map +1 -1
- package/resources/text-to-speech/index.d.ts +1 -1
- package/resources/text-to-speech/index.d.ts.map +1 -1
- package/resources/text-to-speech/index.js.map +1 -1
- package/resources/text-to-speech/index.mjs.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.mts +79 -13
- package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.ts +79 -13
- package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
- package/resources/text-to-speech/text-to-speech.js +33 -1
- package/resources/text-to-speech/text-to-speech.js.map +1 -1
- package/resources/text-to-speech/text-to-speech.mjs +33 -1
- package/resources/text-to-speech/text-to-speech.mjs.map +1 -1
- package/src/client.ts +26 -20
- package/src/resources/ai/ai.ts +3 -3
- package/src/resources/index.ts +5 -2
- package/src/resources/speech-to-text/index.ts +6 -9
- package/src/resources/speech-to-text/internal-base.ts +49 -22
- package/src/resources/speech-to-text/speech-to-text.ts +102 -128
- package/src/resources/speech-to-text/ws-base.ts +619 -0
- package/src/resources/speech-to-text/ws.ts +26 -111
- package/src/resources/speech-to-text.ts +1 -112
- package/src/resources/texml/accounts/calls/calls.ts +36 -564
- package/src/resources/text-to-speech/index.ts +3 -2
- package/src/resources/text-to-speech/text-to-speech.ts +100 -16
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -29,13 +29,49 @@ export class TextToSpeech extends APIResource {
|
|
|
29
29
|
* adjustment, and volume control. Use the `telnyx` provider-specific parameters to
|
|
30
30
|
* configure these features.
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
body:
|
|
32
|
+
createSpeech(
|
|
33
|
+
body: TextToSpeechCreateSpeechParams,
|
|
34
34
|
options?: RequestOptions,
|
|
35
|
-
): APIPromise<
|
|
35
|
+
): APIPromise<TextToSpeechCreateSpeechResponse> {
|
|
36
36
|
return this._client.post('/text-to-speech/speech', { body, ...options });
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Open a WebSocket connection to stream text and receive synthesized audio in real
|
|
41
|
+
* time. Authentication is provided via the standard
|
|
42
|
+
* `Authorization: Bearer <API_KEY>` header. Send JSON frames with text to
|
|
43
|
+
* synthesize; receive JSON frames containing base64-encoded audio chunks.
|
|
44
|
+
*
|
|
45
|
+
* Supported providers: `aws`, `telnyx`, `azure`, `murfai`, `minimax`, `rime`,
|
|
46
|
+
* `resemble`, `elevenlabs`, `xai`.
|
|
47
|
+
*
|
|
48
|
+
* **Connection flow:**
|
|
49
|
+
*
|
|
50
|
+
* 1. Open WebSocket with query parameters specifying provider, voice, and model.
|
|
51
|
+
* 2. Send an initial handshake message `{"text": " "}` (single space) with
|
|
52
|
+
* optional `voice_settings` to initialize the session.
|
|
53
|
+
* 3. Send text messages as `{"text": "Hello world"}`.
|
|
54
|
+
* 4. Receive audio chunks as JSON frames with base64-encoded audio.
|
|
55
|
+
* 5. A final frame with `isFinal: true` indicates the end of audio for the current
|
|
56
|
+
* text.
|
|
57
|
+
*
|
|
58
|
+
* To interrupt and restart synthesis mid-stream, send `{"force": true}` — the
|
|
59
|
+
* current worker is stopped and a new one is started.
|
|
60
|
+
*
|
|
61
|
+
* **Note:** The Telnyx `Ultra` model is not available over WebSocket. Use the HTTP
|
|
62
|
+
* POST `/text-to-speech/speech` endpoint instead.
|
|
63
|
+
*/
|
|
64
|
+
generateSpeech(
|
|
65
|
+
query: TextToSpeechGenerateSpeechParams | null | undefined = {},
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): APIPromise<void> {
|
|
68
|
+
return this._client.get('/text-to-speech/speech', {
|
|
69
|
+
query,
|
|
70
|
+
...options,
|
|
71
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
39
75
|
/**
|
|
40
76
|
* Retrieve a list of available voices from one or all TTS providers. When
|
|
41
77
|
* `provider` is specified, returns voices for that provider only. Otherwise,
|
|
@@ -71,7 +107,7 @@ export class TextToSpeech extends APIResource {
|
|
|
71
107
|
/**
|
|
72
108
|
* Response when `output_type` is `base64_output`.
|
|
73
109
|
*/
|
|
74
|
-
export interface
|
|
110
|
+
export interface TextToSpeechCreateSpeechResponse {
|
|
75
111
|
/**
|
|
76
112
|
* Base64-encoded audio data.
|
|
77
113
|
*/
|
|
@@ -236,16 +272,16 @@ export namespace StreamServerEvent {
|
|
|
236
272
|
}
|
|
237
273
|
}
|
|
238
274
|
|
|
239
|
-
export interface
|
|
275
|
+
export interface TextToSpeechCreateSpeechParams {
|
|
240
276
|
/**
|
|
241
277
|
* AWS Polly provider-specific parameters.
|
|
242
278
|
*/
|
|
243
|
-
aws?:
|
|
279
|
+
aws?: TextToSpeechCreateSpeechParams.Aws;
|
|
244
280
|
|
|
245
281
|
/**
|
|
246
282
|
* Azure Cognitive Services provider-specific parameters.
|
|
247
283
|
*/
|
|
248
|
-
azure?:
|
|
284
|
+
azure?: TextToSpeechCreateSpeechParams.Azure;
|
|
249
285
|
|
|
250
286
|
/**
|
|
251
287
|
* When `true`, bypass the audio cache and generate fresh audio.
|
|
@@ -255,7 +291,7 @@ export interface TextToSpeechGenerateParams {
|
|
|
255
291
|
/**
|
|
256
292
|
* ElevenLabs provider-specific parameters.
|
|
257
293
|
*/
|
|
258
|
-
elevenlabs?:
|
|
294
|
+
elevenlabs?: TextToSpeechCreateSpeechParams.Elevenlabs;
|
|
259
295
|
|
|
260
296
|
/**
|
|
261
297
|
* Inworld provider-specific parameters.
|
|
@@ -270,7 +306,7 @@ export interface TextToSpeechGenerateParams {
|
|
|
270
306
|
/**
|
|
271
307
|
* Minimax provider-specific parameters.
|
|
272
308
|
*/
|
|
273
|
-
minimax?:
|
|
309
|
+
minimax?: TextToSpeechCreateSpeechParams.Minimax;
|
|
274
310
|
|
|
275
311
|
/**
|
|
276
312
|
* Determines the response format. `binary_output` returns raw audio bytes,
|
|
@@ -286,19 +322,19 @@ export interface TextToSpeechGenerateParams {
|
|
|
286
322
|
/**
|
|
287
323
|
* Resemble AI provider-specific parameters.
|
|
288
324
|
*/
|
|
289
|
-
resemble?:
|
|
325
|
+
resemble?: TextToSpeechCreateSpeechParams.Resemble;
|
|
290
326
|
|
|
291
327
|
/**
|
|
292
328
|
* Rime provider-specific parameters.
|
|
293
329
|
*/
|
|
294
|
-
rime?:
|
|
330
|
+
rime?: TextToSpeechCreateSpeechParams.Rime;
|
|
295
331
|
|
|
296
332
|
/**
|
|
297
333
|
* Telnyx provider-specific parameters. Use `voice_speed` and `temperature` for
|
|
298
334
|
* `Natural` and `NaturalHD` models. For the `Ultra` model, use `voice_speed`,
|
|
299
335
|
* `volume`, and `emotion`.
|
|
300
336
|
*/
|
|
301
|
-
telnyx?:
|
|
337
|
+
telnyx?: TextToSpeechCreateSpeechParams.Telnyx;
|
|
302
338
|
|
|
303
339
|
/**
|
|
304
340
|
* The text to convert to speech.
|
|
@@ -329,10 +365,10 @@ export interface TextToSpeechGenerateParams {
|
|
|
329
365
|
/**
|
|
330
366
|
* xAI provider-specific parameters.
|
|
331
367
|
*/
|
|
332
|
-
xai?:
|
|
368
|
+
xai?: TextToSpeechCreateSpeechParams.Xai;
|
|
333
369
|
}
|
|
334
370
|
|
|
335
|
-
export namespace
|
|
371
|
+
export namespace TextToSpeechCreateSpeechParams {
|
|
336
372
|
/**
|
|
337
373
|
* AWS Polly provider-specific parameters.
|
|
338
374
|
*/
|
|
@@ -567,6 +603,53 @@ export namespace TextToSpeechGenerateParams {
|
|
|
567
603
|
}
|
|
568
604
|
}
|
|
569
605
|
|
|
606
|
+
export interface TextToSpeechGenerateSpeechParams {
|
|
607
|
+
/**
|
|
608
|
+
* Audio output format override. Supported for Telnyx models. `pcm` and `wav` are
|
|
609
|
+
* available for `Natural`/`NaturalHD` models. The `Ultra` model outputs PCM at
|
|
610
|
+
* 24kHz s16le or MP3 at 128kbps 24kHz.
|
|
611
|
+
*/
|
|
612
|
+
audio_format?: 'pcm' | 'wav' | 'mp3';
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* When `true`, bypass the audio cache and generate fresh audio.
|
|
616
|
+
*/
|
|
617
|
+
disable_cache?: boolean;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Model identifier for the chosen provider. Examples: `Natural`, `NaturalHD`,
|
|
621
|
+
* `Ultra` (Telnyx); `Polly.Generative` (AWS).
|
|
622
|
+
*/
|
|
623
|
+
model_id?: string;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* TTS provider. Defaults to `telnyx` if not specified. Ignored when `voice` is
|
|
627
|
+
* provided.
|
|
628
|
+
*/
|
|
629
|
+
provider?: 'aws' | 'telnyx' | 'azure' | 'elevenlabs' | 'minimax' | 'murfai' | 'rime' | 'resemble' | 'xai';
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Client-provided socket identifier for tracking. If not provided, one is
|
|
633
|
+
* generated server-side.
|
|
634
|
+
*/
|
|
635
|
+
socket_id?: string;
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* Voice identifier in the format `provider.model_id.voice_id` or
|
|
639
|
+
* `provider.voice_id` (e.g. `telnyx.NaturalHD.Telnyx_Alloy`,
|
|
640
|
+
* `Telnyx.Ultra.<voice_id>`, or `azure.en-US-AvaMultilingualNeural`). When
|
|
641
|
+
* provided, the `provider`, `model_id`, and `voice_id` are extracted
|
|
642
|
+
* automatically. Takes precedence over individual `provider`/`model_id`/`voice_id`
|
|
643
|
+
* parameters.
|
|
644
|
+
*/
|
|
645
|
+
voice?: string;
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Voice identifier for the chosen provider.
|
|
649
|
+
*/
|
|
650
|
+
voice_id?: string;
|
|
651
|
+
}
|
|
652
|
+
|
|
570
653
|
export interface TextToSpeechListVoicesParams {
|
|
571
654
|
/**
|
|
572
655
|
* API key for providers that require one to list voices (e.g. ElevenLabs).
|
|
@@ -581,11 +664,12 @@ export interface TextToSpeechListVoicesParams {
|
|
|
581
664
|
|
|
582
665
|
export declare namespace TextToSpeech {
|
|
583
666
|
export {
|
|
584
|
-
type
|
|
667
|
+
type TextToSpeechCreateSpeechResponse as TextToSpeechCreateSpeechResponse,
|
|
585
668
|
type TextToSpeechListVoicesResponse as TextToSpeechListVoicesResponse,
|
|
586
669
|
type StreamClientEvent as StreamClientEvent,
|
|
587
670
|
type StreamServerEvent as StreamServerEvent,
|
|
588
|
-
type
|
|
671
|
+
type TextToSpeechCreateSpeechParams as TextToSpeechCreateSpeechParams,
|
|
672
|
+
type TextToSpeechGenerateSpeechParams as TextToSpeechGenerateSpeechParams,
|
|
589
673
|
type TextToSpeechListVoicesParams as TextToSpeechListVoicesParams,
|
|
590
674
|
};
|
|
591
675
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.72.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.72.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "6.
|
|
1
|
+
export declare const VERSION = "6.72.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.72.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|