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
|
@@ -1,149 +1,128 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { type Uploadable } from "../../core/uploads.mjs";
|
|
3
4
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Discover available speech-to-text providers, models, and supported languages.
|
|
6
7
|
*/
|
|
7
8
|
export declare class SpeechToText extends APIResource {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `Authorization: Bearer <API_KEY>` header.
|
|
10
|
+
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
11
|
+
* accepted language codes, and the service types each model supports.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Service types:
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* - `streaming` — standalone WebSocket transcription via
|
|
16
|
+
* `/speech-to-text/transcription`.
|
|
17
|
+
* - `file_transcription` — file-based transcription via
|
|
18
|
+
* `/ai/audio/transcriptions`.
|
|
19
|
+
* - `in_call_transcription` — live call transcription via Call Control
|
|
20
|
+
* `transcription_start`.
|
|
16
21
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* 3. Receive JSON transcript frames with `transcript`, `is_final`, and
|
|
21
|
-
* `confidence` fields.
|
|
22
|
-
* 4. Close connection when done.
|
|
22
|
+
* Use this endpoint to discover which (provider, model) combinations are available
|
|
23
|
+
* for the surface you need, and which language codes each accepts. `auto` in a
|
|
24
|
+
* `languages` array indicates the provider performs language detection.
|
|
23
25
|
*/
|
|
24
|
-
|
|
26
|
+
listProviders(query?: SpeechToTextListProvidersParams | null | undefined, options?: RequestOptions): APIPromise<SpeechToTextListProvidersResponse>;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
|
-
*
|
|
29
|
+
* List of supported STT providers and models.
|
|
28
30
|
*/
|
|
29
|
-
export interface
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
input_format: 'mp3' | 'wav';
|
|
34
|
-
/**
|
|
35
|
-
* The transcription engine to use for processing the audio stream.
|
|
36
|
-
*/
|
|
37
|
-
transcription_engine: 'Azure' | 'Deepgram' | 'Google' | 'Telnyx';
|
|
38
|
-
/**
|
|
39
|
-
* Silence duration (in milliseconds) that triggers end-of-speech detection.
|
|
40
|
-
*/
|
|
41
|
-
endpointing?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Whether to receive interim transcription results.
|
|
44
|
-
*/
|
|
45
|
-
interim_results?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* A key term to boost in the transcription.
|
|
48
|
-
*/
|
|
49
|
-
keyterm?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Comma-separated list of keywords to boost in the transcription.
|
|
52
|
-
*/
|
|
53
|
-
keywords?: string;
|
|
54
|
-
/**
|
|
55
|
-
* The language spoken in the audio stream.
|
|
56
|
-
*/
|
|
57
|
-
language?: string;
|
|
58
|
-
/**
|
|
59
|
-
* The specific model to use within the selected transcription engine.
|
|
60
|
-
*/
|
|
61
|
-
model?: 'fast' | 'deepgram/nova-2' | 'deepgram/nova-3' | 'latest_long' | 'latest_short' | 'command_and_search' | 'phone_call' | 'video' | 'default' | 'medical_conversation' | 'medical_dictation' | 'openai/whisper-tiny' | 'openai/whisper-large-v3-turbo';
|
|
62
|
-
/**
|
|
63
|
-
* Enable redaction of sensitive information from transcription results.
|
|
64
|
-
*/
|
|
65
|
-
redact?: string;
|
|
31
|
+
export interface SpeechToTextListProvidersResponse {
|
|
32
|
+
data: Array<SpeechToTextListProvidersResponse.Data>;
|
|
33
|
+
meta: SpeechToTextListProvidersResponse.Meta;
|
|
66
34
|
}
|
|
67
|
-
|
|
68
|
-
* Parameters for establishing a speech-to-text WebSocket connection.
|
|
69
|
-
*/
|
|
70
|
-
export interface SpeechToTextStreamParams {
|
|
71
|
-
/**
|
|
72
|
-
* The transcription engine to use for processing the audio stream.
|
|
73
|
-
*/
|
|
74
|
-
transcription_engine: 'Azure' | 'Deepgram' | 'Google' | 'Telnyx';
|
|
75
|
-
/**
|
|
76
|
-
* The format of the input audio stream.
|
|
77
|
-
*/
|
|
78
|
-
input_format?: 'mp3' | 'wav' | 'raw';
|
|
79
|
-
/**
|
|
80
|
-
* The language code for transcription (e.g., 'en-US', 'es-ES').
|
|
81
|
-
*/
|
|
82
|
-
language?: string;
|
|
35
|
+
export declare namespace SpeechToTextListProvidersResponse {
|
|
83
36
|
/**
|
|
84
|
-
*
|
|
37
|
+
* A (provider, model) tuple along with its supported service types and languages.
|
|
85
38
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
39
|
+
interface Data {
|
|
40
|
+
/**
|
|
41
|
+
* Languages this (provider, model) accepts, in the provider's native code format.
|
|
42
|
+
* `auto` indicates the provider performs language detection.
|
|
43
|
+
*/
|
|
44
|
+
languages: Array<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Provider-scoped model name.
|
|
47
|
+
*/
|
|
48
|
+
model: string;
|
|
49
|
+
/**
|
|
50
|
+
* STT provider name.
|
|
51
|
+
*/
|
|
52
|
+
provider: string;
|
|
53
|
+
/**
|
|
54
|
+
* Service surfaces this (provider, model) supports.
|
|
55
|
+
*/
|
|
56
|
+
service_types: Array<'streaming' | 'file_transcription' | 'in_call_transcription'>;
|
|
57
|
+
}
|
|
58
|
+
interface Meta {
|
|
59
|
+
/**
|
|
60
|
+
* Total number of entries returned.
|
|
61
|
+
*/
|
|
62
|
+
total: number;
|
|
63
|
+
}
|
|
91
64
|
}
|
|
92
65
|
/**
|
|
93
|
-
* Binary audio data
|
|
94
|
-
* Send raw audio bytes in mp3 or wav format.
|
|
66
|
+
* Binary audio data in mp3 or wav format.
|
|
95
67
|
*/
|
|
96
|
-
export type
|
|
68
|
+
export type TranscribeClientEvent = Uploadable;
|
|
97
69
|
/**
|
|
98
70
|
* Union of all server-to-client WebSocket events for STT streaming.
|
|
99
71
|
*/
|
|
100
|
-
export type
|
|
101
|
-
export declare namespace
|
|
72
|
+
export type TranscribeServerEvent = TranscribeServerEvent.TranscriptFrame | TranscribeServerEvent.SttErrorFrame;
|
|
73
|
+
export declare namespace TranscribeServerEvent {
|
|
102
74
|
/**
|
|
103
75
|
* Server-to-client frame containing a transcription result.
|
|
104
76
|
*/
|
|
105
77
|
interface TranscriptFrame {
|
|
106
|
-
/**
|
|
107
|
-
* Frame type identifier.
|
|
108
|
-
*/
|
|
109
|
-
type: 'transcript';
|
|
110
78
|
/**
|
|
111
79
|
* The transcribed text from the audio.
|
|
112
80
|
*/
|
|
113
81
|
transcript: string;
|
|
114
82
|
/**
|
|
115
|
-
*
|
|
116
|
-
* When `false`, this is an interim result that may be refined.
|
|
83
|
+
* Frame type identifier.
|
|
117
84
|
*/
|
|
118
|
-
|
|
85
|
+
type: 'transcript';
|
|
119
86
|
/**
|
|
120
87
|
* Confidence score of the transcription, ranging from 0 to 1.
|
|
121
88
|
*/
|
|
122
89
|
confidence?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Whether this is a final transcription result. When `false`, this is an interim
|
|
92
|
+
* result that may be refined.
|
|
93
|
+
*/
|
|
94
|
+
is_final?: boolean;
|
|
123
95
|
}
|
|
124
96
|
/**
|
|
125
|
-
* Server-to-client frame indicating an error during transcription.
|
|
97
|
+
* Server-to-client frame indicating an error during transcription. The connection
|
|
98
|
+
* may be closed shortly after.
|
|
126
99
|
*/
|
|
127
|
-
interface
|
|
128
|
-
/**
|
|
129
|
-
* Frame type identifier.
|
|
130
|
-
*/
|
|
131
|
-
type: 'error';
|
|
100
|
+
interface SttErrorFrame {
|
|
132
101
|
/**
|
|
133
102
|
* Error message describing what went wrong.
|
|
134
103
|
*/
|
|
135
104
|
error: string;
|
|
105
|
+
/**
|
|
106
|
+
* Frame type identifier.
|
|
107
|
+
*/
|
|
108
|
+
type: 'error';
|
|
136
109
|
}
|
|
137
110
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
111
|
+
export interface SpeechToTextListProvidersParams {
|
|
112
|
+
/**
|
|
113
|
+
* Filter to entries for a specific STT provider. The enum mirrors the providers
|
|
114
|
+
* advertised across the speech-to-text spec (including `google` and `telnyx`,
|
|
115
|
+
* which are accepted as WebSocket transcription engines). A provider that has no
|
|
116
|
+
* models currently registered for any service type will return an empty `data`
|
|
117
|
+
* array rather than an error.
|
|
118
|
+
*/
|
|
119
|
+
provider?: 'deepgram' | 'speechmatics' | 'assemblyai' | 'xai' | 'soniox' | 'azure' | 'openai' | 'google' | 'telnyx';
|
|
120
|
+
/**
|
|
121
|
+
* Filter to entries that support the given service type.
|
|
122
|
+
*/
|
|
123
|
+
service_type?: 'streaming' | 'file_transcription' | 'in_call_transcription';
|
|
124
|
+
}
|
|
146
125
|
export declare namespace SpeechToText {
|
|
147
|
-
export { type
|
|
126
|
+
export { type SpeechToTextListProvidersResponse as SpeechToTextListProvidersResponse, type TranscribeClientEvent as TranscribeClientEvent, type TranscribeServerEvent as TranscribeServerEvent, type SpeechToTextListProvidersParams as SpeechToTextListProvidersParams, };
|
|
148
127
|
}
|
|
149
128
|
//# sourceMappingURL=speech-to-text.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech-to-text.d.mts","sourceRoot":"","sources":["../../src/resources/speech-to-text/speech-to-text.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;
|
|
1
|
+
{"version":3,"file":"speech-to-text.d.mts","sourceRoot":"","sources":["../../src/resources/speech-to-text/speech-to-text.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,+BAA2B;AACrD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,KAAK,GAAE,+BAA+B,GAAG,IAAI,GAAG,SAAc,EAC9D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;CAOjD;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,KAAK,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC;IAEpD,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC;CAC9C;AAED,yBAAiB,iCAAiC,CAAC;IACjD;;OAEG;IACH,UAAiB,IAAI;QACnB;;;WAGG;QACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEzB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,aAAa,EAAE,KAAK,CAAC,WAAW,GAAG,oBAAoB,GAAG,uBAAuB,CAAC,CAAC;KACpF;IAED,UAAiB,IAAI;QACnB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,qBAAqB,CAAC,eAAe,GACrC,qBAAqB,CAAC,aAAa,CAAC;AAExC,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,eAAe;QAC9B;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,IAAI,EAAE,YAAY,CAAC;QAEnB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;;WAGG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;IAED;;;OAGG;IACH,UAAiB,aAAa;QAC5B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;KACf;CACF;AAED,MAAM,WAAW,+BAA+B;IAC9C;;;;;;OAMG;IACH,QAAQ,CAAC,EACL,UAAU,GACV,cAAc,GACd,YAAY,GACZ,KAAK,GACL,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAC;IAEb;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,oBAAoB,GAAG,uBAAuB,CAAC;CAC7E;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
|
|
@@ -1,149 +1,128 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { type Uploadable } from "../../core/uploads.js";
|
|
3
4
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Discover available speech-to-text providers, models, and supported languages.
|
|
6
7
|
*/
|
|
7
8
|
export declare class SpeechToText extends APIResource {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `Authorization: Bearer <API_KEY>` header.
|
|
10
|
+
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
11
|
+
* accepted language codes, and the service types each model supports.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Service types:
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* - `streaming` — standalone WebSocket transcription via
|
|
16
|
+
* `/speech-to-text/transcription`.
|
|
17
|
+
* - `file_transcription` — file-based transcription via
|
|
18
|
+
* `/ai/audio/transcriptions`.
|
|
19
|
+
* - `in_call_transcription` — live call transcription via Call Control
|
|
20
|
+
* `transcription_start`.
|
|
16
21
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* 3. Receive JSON transcript frames with `transcript`, `is_final`, and
|
|
21
|
-
* `confidence` fields.
|
|
22
|
-
* 4. Close connection when done.
|
|
22
|
+
* Use this endpoint to discover which (provider, model) combinations are available
|
|
23
|
+
* for the surface you need, and which language codes each accepts. `auto` in a
|
|
24
|
+
* `languages` array indicates the provider performs language detection.
|
|
23
25
|
*/
|
|
24
|
-
|
|
26
|
+
listProviders(query?: SpeechToTextListProvidersParams | null | undefined, options?: RequestOptions): APIPromise<SpeechToTextListProvidersResponse>;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
|
-
*
|
|
29
|
+
* List of supported STT providers and models.
|
|
28
30
|
*/
|
|
29
|
-
export interface
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
input_format: 'mp3' | 'wav';
|
|
34
|
-
/**
|
|
35
|
-
* The transcription engine to use for processing the audio stream.
|
|
36
|
-
*/
|
|
37
|
-
transcription_engine: 'Azure' | 'Deepgram' | 'Google' | 'Telnyx';
|
|
38
|
-
/**
|
|
39
|
-
* Silence duration (in milliseconds) that triggers end-of-speech detection.
|
|
40
|
-
*/
|
|
41
|
-
endpointing?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Whether to receive interim transcription results.
|
|
44
|
-
*/
|
|
45
|
-
interim_results?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* A key term to boost in the transcription.
|
|
48
|
-
*/
|
|
49
|
-
keyterm?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Comma-separated list of keywords to boost in the transcription.
|
|
52
|
-
*/
|
|
53
|
-
keywords?: string;
|
|
54
|
-
/**
|
|
55
|
-
* The language spoken in the audio stream.
|
|
56
|
-
*/
|
|
57
|
-
language?: string;
|
|
58
|
-
/**
|
|
59
|
-
* The specific model to use within the selected transcription engine.
|
|
60
|
-
*/
|
|
61
|
-
model?: 'fast' | 'deepgram/nova-2' | 'deepgram/nova-3' | 'latest_long' | 'latest_short' | 'command_and_search' | 'phone_call' | 'video' | 'default' | 'medical_conversation' | 'medical_dictation' | 'openai/whisper-tiny' | 'openai/whisper-large-v3-turbo';
|
|
62
|
-
/**
|
|
63
|
-
* Enable redaction of sensitive information from transcription results.
|
|
64
|
-
*/
|
|
65
|
-
redact?: string;
|
|
31
|
+
export interface SpeechToTextListProvidersResponse {
|
|
32
|
+
data: Array<SpeechToTextListProvidersResponse.Data>;
|
|
33
|
+
meta: SpeechToTextListProvidersResponse.Meta;
|
|
66
34
|
}
|
|
67
|
-
|
|
68
|
-
* Parameters for establishing a speech-to-text WebSocket connection.
|
|
69
|
-
*/
|
|
70
|
-
export interface SpeechToTextStreamParams {
|
|
71
|
-
/**
|
|
72
|
-
* The transcription engine to use for processing the audio stream.
|
|
73
|
-
*/
|
|
74
|
-
transcription_engine: 'Azure' | 'Deepgram' | 'Google' | 'Telnyx';
|
|
75
|
-
/**
|
|
76
|
-
* The format of the input audio stream.
|
|
77
|
-
*/
|
|
78
|
-
input_format?: 'mp3' | 'wav' | 'raw';
|
|
79
|
-
/**
|
|
80
|
-
* The language code for transcription (e.g., 'en-US', 'es-ES').
|
|
81
|
-
*/
|
|
82
|
-
language?: string;
|
|
35
|
+
export declare namespace SpeechToTextListProvidersResponse {
|
|
83
36
|
/**
|
|
84
|
-
*
|
|
37
|
+
* A (provider, model) tuple along with its supported service types and languages.
|
|
85
38
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
39
|
+
interface Data {
|
|
40
|
+
/**
|
|
41
|
+
* Languages this (provider, model) accepts, in the provider's native code format.
|
|
42
|
+
* `auto` indicates the provider performs language detection.
|
|
43
|
+
*/
|
|
44
|
+
languages: Array<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Provider-scoped model name.
|
|
47
|
+
*/
|
|
48
|
+
model: string;
|
|
49
|
+
/**
|
|
50
|
+
* STT provider name.
|
|
51
|
+
*/
|
|
52
|
+
provider: string;
|
|
53
|
+
/**
|
|
54
|
+
* Service surfaces this (provider, model) supports.
|
|
55
|
+
*/
|
|
56
|
+
service_types: Array<'streaming' | 'file_transcription' | 'in_call_transcription'>;
|
|
57
|
+
}
|
|
58
|
+
interface Meta {
|
|
59
|
+
/**
|
|
60
|
+
* Total number of entries returned.
|
|
61
|
+
*/
|
|
62
|
+
total: number;
|
|
63
|
+
}
|
|
91
64
|
}
|
|
92
65
|
/**
|
|
93
|
-
* Binary audio data
|
|
94
|
-
* Send raw audio bytes in mp3 or wav format.
|
|
66
|
+
* Binary audio data in mp3 or wav format.
|
|
95
67
|
*/
|
|
96
|
-
export type
|
|
68
|
+
export type TranscribeClientEvent = Uploadable;
|
|
97
69
|
/**
|
|
98
70
|
* Union of all server-to-client WebSocket events for STT streaming.
|
|
99
71
|
*/
|
|
100
|
-
export type
|
|
101
|
-
export declare namespace
|
|
72
|
+
export type TranscribeServerEvent = TranscribeServerEvent.TranscriptFrame | TranscribeServerEvent.SttErrorFrame;
|
|
73
|
+
export declare namespace TranscribeServerEvent {
|
|
102
74
|
/**
|
|
103
75
|
* Server-to-client frame containing a transcription result.
|
|
104
76
|
*/
|
|
105
77
|
interface TranscriptFrame {
|
|
106
|
-
/**
|
|
107
|
-
* Frame type identifier.
|
|
108
|
-
*/
|
|
109
|
-
type: 'transcript';
|
|
110
78
|
/**
|
|
111
79
|
* The transcribed text from the audio.
|
|
112
80
|
*/
|
|
113
81
|
transcript: string;
|
|
114
82
|
/**
|
|
115
|
-
*
|
|
116
|
-
* When `false`, this is an interim result that may be refined.
|
|
83
|
+
* Frame type identifier.
|
|
117
84
|
*/
|
|
118
|
-
|
|
85
|
+
type: 'transcript';
|
|
119
86
|
/**
|
|
120
87
|
* Confidence score of the transcription, ranging from 0 to 1.
|
|
121
88
|
*/
|
|
122
89
|
confidence?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Whether this is a final transcription result. When `false`, this is an interim
|
|
92
|
+
* result that may be refined.
|
|
93
|
+
*/
|
|
94
|
+
is_final?: boolean;
|
|
123
95
|
}
|
|
124
96
|
/**
|
|
125
|
-
* Server-to-client frame indicating an error during transcription.
|
|
97
|
+
* Server-to-client frame indicating an error during transcription. The connection
|
|
98
|
+
* may be closed shortly after.
|
|
126
99
|
*/
|
|
127
|
-
interface
|
|
128
|
-
/**
|
|
129
|
-
* Frame type identifier.
|
|
130
|
-
*/
|
|
131
|
-
type: 'error';
|
|
100
|
+
interface SttErrorFrame {
|
|
132
101
|
/**
|
|
133
102
|
* Error message describing what went wrong.
|
|
134
103
|
*/
|
|
135
104
|
error: string;
|
|
105
|
+
/**
|
|
106
|
+
* Frame type identifier.
|
|
107
|
+
*/
|
|
108
|
+
type: 'error';
|
|
136
109
|
}
|
|
137
110
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
111
|
+
export interface SpeechToTextListProvidersParams {
|
|
112
|
+
/**
|
|
113
|
+
* Filter to entries for a specific STT provider. The enum mirrors the providers
|
|
114
|
+
* advertised across the speech-to-text spec (including `google` and `telnyx`,
|
|
115
|
+
* which are accepted as WebSocket transcription engines). A provider that has no
|
|
116
|
+
* models currently registered for any service type will return an empty `data`
|
|
117
|
+
* array rather than an error.
|
|
118
|
+
*/
|
|
119
|
+
provider?: 'deepgram' | 'speechmatics' | 'assemblyai' | 'xai' | 'soniox' | 'azure' | 'openai' | 'google' | 'telnyx';
|
|
120
|
+
/**
|
|
121
|
+
* Filter to entries that support the given service type.
|
|
122
|
+
*/
|
|
123
|
+
service_type?: 'streaming' | 'file_transcription' | 'in_call_transcription';
|
|
124
|
+
}
|
|
146
125
|
export declare namespace SpeechToText {
|
|
147
|
-
export { type
|
|
126
|
+
export { type SpeechToTextListProvidersResponse as SpeechToTextListProvidersResponse, type TranscribeClientEvent as TranscribeClientEvent, type TranscribeServerEvent as TranscribeServerEvent, type SpeechToTextListProvidersParams as SpeechToTextListProvidersParams, };
|
|
148
127
|
}
|
|
149
128
|
//# sourceMappingURL=speech-to-text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech-to-text.d.ts","sourceRoot":"","sources":["../../src/resources/speech-to-text/speech-to-text.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;
|
|
1
|
+
{"version":3,"file":"speech-to-text.d.ts","sourceRoot":"","sources":["../../src/resources/speech-to-text/speech-to-text.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,KAAK,UAAU,EAAE,8BAA2B;AACrD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,KAAK,GAAE,+BAA+B,GAAG,IAAI,GAAG,SAAc,EAC9D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;CAOjD;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,KAAK,CAAC,iCAAiC,CAAC,IAAI,CAAC,CAAC;IAEpD,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC;CAC9C;AAED,yBAAiB,iCAAiC,CAAC;IACjD;;OAEG;IACH,UAAiB,IAAI;QACnB;;;WAGG;QACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEzB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,aAAa,EAAE,KAAK,CAAC,WAAW,GAAG,oBAAoB,GAAG,uBAAuB,CAAC,CAAC;KACpF;IAED,UAAiB,IAAI;QACnB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,qBAAqB,CAAC,eAAe,GACrC,qBAAqB,CAAC,aAAa,CAAC;AAExC,yBAAiB,qBAAqB,CAAC;IACrC;;OAEG;IACH,UAAiB,eAAe;QAC9B;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,IAAI,EAAE,YAAY,CAAC;QAEnB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;;WAGG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;IAED;;;OAGG;IACH,UAAiB,aAAa;QAC5B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;KACf;CACF;AAED,MAAM,WAAW,+BAA+B;IAC9C;;;;;;OAMG;IACH,QAAQ,CAAC,EACL,UAAU,GACV,cAAc,GACd,YAAY,GACZ,KAAK,GACL,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAC;IAEb;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,oBAAoB,GAAG,uBAAuB,CAAC;CAC7E;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
|
|
@@ -3,35 +3,32 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.SpeechToText = void 0;
|
|
5
5
|
const resource_1 = require("../../core/resource.js");
|
|
6
|
-
const headers_1 = require("../../internal/headers.js");
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
7
|
+
* Discover available speech-to-text providers, models, and supported languages.
|
|
9
8
|
*/
|
|
10
9
|
class SpeechToText extends resource_1.APIResource {
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `Authorization: Bearer <API_KEY>` header.
|
|
11
|
+
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
12
|
+
* accepted language codes, and the service types each model supports.
|
|
15
13
|
*
|
|
16
|
-
*
|
|
14
|
+
* Service types:
|
|
17
15
|
*
|
|
18
|
-
*
|
|
16
|
+
* - `streaming` — standalone WebSocket transcription via
|
|
17
|
+
* `/speech-to-text/transcription`.
|
|
18
|
+
* - `file_transcription` — file-based transcription via
|
|
19
|
+
* `/ai/audio/transcriptions`.
|
|
20
|
+
* - `in_call_transcription` — live call transcription via Call Control
|
|
21
|
+
* `transcription_start`.
|
|
19
22
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* 3. Receive JSON transcript frames with `transcript`, `is_final`, and
|
|
24
|
-
* `confidence` fields.
|
|
25
|
-
* 4. Close connection when done.
|
|
23
|
+
* Use this endpoint to discover which (provider, model) combinations are available
|
|
24
|
+
* for the surface you need, and which language codes each accepts. `auto` in a
|
|
25
|
+
* `languages` array indicates the provider performs language detection.
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
return this._client.get('/speech-to-text/
|
|
27
|
+
listProviders(query = {}, options) {
|
|
28
|
+
return this._client.get('/speech-to-text/providers', {
|
|
29
29
|
query,
|
|
30
|
+
defaultBaseURL: 'https://api.telnyx.com/v2',
|
|
30
31
|
...options,
|
|
31
|
-
headers: (0, headers_1.buildHeaders)([
|
|
32
|
-
{ 'Content-Type': 'application/octet-stream', Accept: '*/*' },
|
|
33
|
-
options?.headers,
|
|
34
|
-
]),
|
|
35
32
|
});
|
|
36
33
|
}
|
|
37
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech-to-text.js","sourceRoot":"","sources":["../../src/resources/speech-to-text/speech-to-text.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;
|
|
1
|
+
{"version":3,"file":"speech-to-text.js","sourceRoot":"","sources":["../../src/resources/speech-to-text/speech-to-text.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE;YACnD,KAAK;YACL,cAAc,EAAE,2BAA2B;YAC3C,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF;AA5BD,oCA4BC"}
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
-
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Discover available speech-to-text providers, models, and supported languages.
|
|
6
5
|
*/
|
|
7
6
|
export class SpeechToText extends APIResource {
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `Authorization: Bearer <API_KEY>` header.
|
|
8
|
+
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
9
|
+
* accepted language codes, and the service types each model supports.
|
|
12
10
|
*
|
|
13
|
-
*
|
|
11
|
+
* Service types:
|
|
14
12
|
*
|
|
15
|
-
*
|
|
13
|
+
* - `streaming` — standalone WebSocket transcription via
|
|
14
|
+
* `/speech-to-text/transcription`.
|
|
15
|
+
* - `file_transcription` — file-based transcription via
|
|
16
|
+
* `/ai/audio/transcriptions`.
|
|
17
|
+
* - `in_call_transcription` — live call transcription via Call Control
|
|
18
|
+
* `transcription_start`.
|
|
16
19
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* 3. Receive JSON transcript frames with `transcript`, `is_final`, and
|
|
21
|
-
* `confidence` fields.
|
|
22
|
-
* 4. Close connection when done.
|
|
20
|
+
* Use this endpoint to discover which (provider, model) combinations are available
|
|
21
|
+
* for the surface you need, and which language codes each accepts. `auto` in a
|
|
22
|
+
* `languages` array indicates the provider performs language detection.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
return this._client.get('/speech-to-text/
|
|
24
|
+
listProviders(query = {}, options) {
|
|
25
|
+
return this._client.get('/speech-to-text/providers', {
|
|
26
26
|
query,
|
|
27
|
+
defaultBaseURL: 'https://api.telnyx.com/v2',
|
|
27
28
|
...options,
|
|
28
|
-
headers: buildHeaders([
|
|
29
|
-
{ 'Content-Type': 'application/octet-stream', Accept: '*/*' },
|
|
30
|
-
options?.headers,
|
|
31
|
-
]),
|
|
32
29
|
});
|
|
33
30
|
}
|
|
34
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech-to-text.mjs","sourceRoot":"","sources":["../../src/resources/speech-to-text/speech-to-text.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;
|
|
1
|
+
{"version":3,"file":"speech-to-text.mjs","sourceRoot":"","sources":["../../src/resources/speech-to-text/speech-to-text.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAKlD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,CACX,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE;YACnD,KAAK;YACL,cAAc,EAAE,2BAA2B;YAC3C,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;CACF"}
|