telnyx 6.70.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 +19 -0
- package/client.d.mts +13 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +13 -6
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- 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/calls/actions.d.mts +260 -247
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +260 -247
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/actions.js.map +1 -1
- package/resources/calls/actions.mjs.map +1 -1
- package/resources/calls/calls.d.mts +210 -3
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +210 -3
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/calls/index.d.mts +2 -2
- package/resources/calls/index.d.mts.map +1 -1
- package/resources/calls/index.d.ts +2 -2
- package/resources/calls/index.d.ts.map +1 -1
- package/resources/calls/index.js.map +1 -1
- package/resources/calls/index.mjs.map +1 -1
- package/resources/conferences/actions.d.mts +1 -9
- package/resources/conferences/actions.d.mts.map +1 -1
- package/resources/conferences/actions.d.ts +1 -9
- package/resources/conferences/actions.d.ts.map +1 -1
- package/resources/index.d.mts +4 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/shared.d.mts +6 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +6 -0
- package/resources/shared.d.ts.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 +2 -0
- package/resources/speech-to-text.d.mts.map +1 -0
- package/resources/speech-to-text.d.ts +2 -0
- package/resources/speech-to-text.d.ts.map +1 -0
- package/resources/speech-to-text.js +6 -0
- package/resources/speech-to-text.js.map +1 -0
- package/resources/speech-to-text.mjs +3 -0
- package/resources/speech-to-text.mjs.map +1 -0
- 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/resources/voice-sdk-call-reports.d.mts +30 -105
- package/resources/voice-sdk-call-reports.d.mts.map +1 -1
- package/resources/voice-sdk-call-reports.d.ts +30 -105
- package/resources/voice-sdk-call-reports.d.ts.map +1 -1
- package/resources/voice-sdk-call-reports.js.map +1 -1
- package/resources/voice-sdk-call-reports.mjs.map +1 -1
- package/resources/whatsapp/index.d.mts +1 -1
- package/resources/whatsapp/index.d.mts.map +1 -1
- package/resources/whatsapp/index.d.ts +1 -1
- package/resources/whatsapp/index.d.ts.map +1 -1
- package/resources/whatsapp/index.js.map +1 -1
- package/resources/whatsapp/index.mjs.map +1 -1
- package/resources/whatsapp/user-data.d.mts +16 -33
- package/resources/whatsapp/user-data.d.mts.map +1 -1
- package/resources/whatsapp/user-data.d.ts +16 -33
- package/resources/whatsapp/user-data.d.ts.map +1 -1
- package/resources/whatsapp/whatsapp.d.mts +2 -2
- package/resources/whatsapp/whatsapp.d.mts.map +1 -1
- package/resources/whatsapp/whatsapp.d.ts +2 -2
- package/resources/whatsapp/whatsapp.d.ts.map +1 -1
- package/resources/whatsapp/whatsapp.js.map +1 -1
- package/resources/whatsapp/whatsapp.mjs.map +1 -1
- package/src/client.ts +33 -4
- package/src/resources/ai/ai.ts +3 -3
- package/src/resources/calls/actions.ts +331 -320
- package/src/resources/calls/calls.ts +272 -0
- package/src/resources/calls/index.ts +4 -0
- package/src/resources/conferences/actions.ts +1 -10
- package/src/resources/index.ts +13 -2
- package/src/resources/shared.ts +7 -0
- 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 +3 -0
- 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/resources/voice-sdk-call-reports.ts +33 -116
- package/src/resources/whatsapp/index.ts +1 -0
- package/src/resources/whatsapp/user-data.ts +17 -38
- package/src/resources/whatsapp/whatsapp.ts +2 -0
- 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
|
@@ -2,198 +2,172 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
|
-
import {
|
|
5
|
+
import { type Uploadable } from '../../core/uploads';
|
|
6
6
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Discover available speech-to-text providers, models, and supported languages.
|
|
10
10
|
*/
|
|
11
11
|
export class SpeechToText extends APIResource {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `Authorization: Bearer <API_KEY>` header.
|
|
13
|
+
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
14
|
+
* accepted language codes, and the service types each model supports.
|
|
16
15
|
*
|
|
17
|
-
*
|
|
16
|
+
* Service types:
|
|
18
17
|
*
|
|
19
|
-
*
|
|
18
|
+
* - `streaming` — standalone WebSocket transcription via
|
|
19
|
+
* `/speech-to-text/transcription`.
|
|
20
|
+
* - `file_transcription` — file-based transcription via
|
|
21
|
+
* `/ai/audio/transcriptions`.
|
|
22
|
+
* - `in_call_transcription` — live call transcription via Call Control
|
|
23
|
+
* `transcription_start`.
|
|
20
24
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return this._client.get('/speech-to-text/
|
|
25
|
+
* Use this endpoint to discover which (provider, model) combinations are available
|
|
26
|
+
* for the surface you need, and which language codes each accepts. `auto` in a
|
|
27
|
+
* `languages` array indicates the provider performs language detection.
|
|
28
|
+
*/
|
|
29
|
+
listProviders(
|
|
30
|
+
query: SpeechToTextListProvidersParams | null | undefined = {},
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): APIPromise<SpeechToTextListProvidersResponse> {
|
|
33
|
+
return this._client.get('/speech-to-text/providers', {
|
|
30
34
|
query,
|
|
35
|
+
defaultBaseURL: 'https://api.telnyx.com/v2',
|
|
31
36
|
...options,
|
|
32
|
-
headers: buildHeaders([
|
|
33
|
-
{ 'Content-Type': 'application/octet-stream', Accept: '*/*' },
|
|
34
|
-
options?.headers,
|
|
35
|
-
]),
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* List of supported STT providers and models.
|
|
42
43
|
*/
|
|
43
|
-
export interface
|
|
44
|
-
|
|
45
|
-
* The format of input audio stream.
|
|
46
|
-
*/
|
|
47
|
-
input_format: 'mp3' | 'wav';
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* The transcription engine to use for processing the audio stream.
|
|
51
|
-
*/
|
|
52
|
-
transcription_engine: 'Azure' | 'Deepgram' | 'Google' | 'Telnyx';
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Silence duration (in milliseconds) that triggers end-of-speech detection.
|
|
56
|
-
*/
|
|
57
|
-
endpointing?: number;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Whether to receive interim transcription results.
|
|
61
|
-
*/
|
|
62
|
-
interim_results?: boolean;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* A key term to boost in the transcription.
|
|
66
|
-
*/
|
|
67
|
-
keyterm?: string;
|
|
44
|
+
export interface SpeechToTextListProvidersResponse {
|
|
45
|
+
data: Array<SpeechToTextListProvidersResponse.Data>;
|
|
68
46
|
|
|
69
|
-
|
|
70
|
-
* Comma-separated list of keywords to boost in the transcription.
|
|
71
|
-
*/
|
|
72
|
-
keywords?: string;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The language spoken in the audio stream.
|
|
76
|
-
*/
|
|
77
|
-
language?: string;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* The specific model to use within the selected transcription engine.
|
|
81
|
-
*/
|
|
82
|
-
model?:
|
|
83
|
-
| 'fast'
|
|
84
|
-
| 'deepgram/nova-2'
|
|
85
|
-
| 'deepgram/nova-3'
|
|
86
|
-
| 'latest_long'
|
|
87
|
-
| 'latest_short'
|
|
88
|
-
| 'command_and_search'
|
|
89
|
-
| 'phone_call'
|
|
90
|
-
| 'video'
|
|
91
|
-
| 'default'
|
|
92
|
-
| 'medical_conversation'
|
|
93
|
-
| 'medical_dictation'
|
|
94
|
-
| 'openai/whisper-tiny'
|
|
95
|
-
| 'openai/whisper-large-v3-turbo';
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Enable redaction of sensitive information from transcription results.
|
|
99
|
-
*/
|
|
100
|
-
redact?: string;
|
|
47
|
+
meta: SpeechToTextListProvidersResponse.Meta;
|
|
101
48
|
}
|
|
102
49
|
|
|
103
|
-
|
|
104
|
-
* Parameters for establishing a speech-to-text WebSocket connection.
|
|
105
|
-
*/
|
|
106
|
-
export interface SpeechToTextStreamParams {
|
|
50
|
+
export namespace SpeechToTextListProvidersResponse {
|
|
107
51
|
/**
|
|
108
|
-
*
|
|
52
|
+
* A (provider, model) tuple along with its supported service types and languages.
|
|
109
53
|
*/
|
|
110
|
-
|
|
54
|
+
export interface Data {
|
|
55
|
+
/**
|
|
56
|
+
* Languages this (provider, model) accepts, in the provider's native code format.
|
|
57
|
+
* `auto` indicates the provider performs language detection.
|
|
58
|
+
*/
|
|
59
|
+
languages: Array<string>;
|
|
111
60
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Provider-scoped model name.
|
|
63
|
+
*/
|
|
64
|
+
model: string;
|
|
116
65
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
66
|
+
/**
|
|
67
|
+
* STT provider name.
|
|
68
|
+
*/
|
|
69
|
+
provider: string;
|
|
121
70
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Service surfaces this (provider, model) supports.
|
|
73
|
+
*/
|
|
74
|
+
service_types: Array<'streaming' | 'file_transcription' | 'in_call_transcription'>;
|
|
75
|
+
}
|
|
126
76
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
77
|
+
export interface Meta {
|
|
78
|
+
/**
|
|
79
|
+
* Total number of entries returned.
|
|
80
|
+
*/
|
|
81
|
+
total: number;
|
|
82
|
+
}
|
|
131
83
|
}
|
|
132
84
|
|
|
133
85
|
/**
|
|
134
|
-
* Binary audio data
|
|
135
|
-
* Send raw audio bytes in mp3 or wav format.
|
|
86
|
+
* Binary audio data in mp3 or wav format.
|
|
136
87
|
*/
|
|
137
|
-
export type
|
|
88
|
+
export type TranscribeClientEvent = Uploadable;
|
|
138
89
|
|
|
139
90
|
/**
|
|
140
91
|
* Union of all server-to-client WebSocket events for STT streaming.
|
|
141
92
|
*/
|
|
142
|
-
export type
|
|
93
|
+
export type TranscribeServerEvent =
|
|
94
|
+
| TranscribeServerEvent.TranscriptFrame
|
|
95
|
+
| TranscribeServerEvent.SttErrorFrame;
|
|
143
96
|
|
|
144
|
-
export namespace
|
|
97
|
+
export namespace TranscribeServerEvent {
|
|
145
98
|
/**
|
|
146
99
|
* Server-to-client frame containing a transcription result.
|
|
147
100
|
*/
|
|
148
101
|
export interface TranscriptFrame {
|
|
149
|
-
/**
|
|
150
|
-
* Frame type identifier.
|
|
151
|
-
*/
|
|
152
|
-
type: 'transcript';
|
|
153
|
-
|
|
154
102
|
/**
|
|
155
103
|
* The transcribed text from the audio.
|
|
156
104
|
*/
|
|
157
105
|
transcript: string;
|
|
158
106
|
|
|
159
107
|
/**
|
|
160
|
-
*
|
|
161
|
-
* When `false`, this is an interim result that may be refined.
|
|
108
|
+
* Frame type identifier.
|
|
162
109
|
*/
|
|
163
|
-
|
|
110
|
+
type: 'transcript';
|
|
164
111
|
|
|
165
112
|
/**
|
|
166
113
|
* Confidence score of the transcription, ranging from 0 to 1.
|
|
167
114
|
*/
|
|
168
115
|
confidence?: number;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Whether this is a final transcription result. When `false`, this is an interim
|
|
119
|
+
* result that may be refined.
|
|
120
|
+
*/
|
|
121
|
+
is_final?: boolean;
|
|
169
122
|
}
|
|
170
123
|
|
|
171
124
|
/**
|
|
172
|
-
* Server-to-client frame indicating an error during transcription.
|
|
125
|
+
* Server-to-client frame indicating an error during transcription. The connection
|
|
126
|
+
* may be closed shortly after.
|
|
173
127
|
*/
|
|
174
|
-
export interface
|
|
128
|
+
export interface SttErrorFrame {
|
|
175
129
|
/**
|
|
176
|
-
*
|
|
130
|
+
* Error message describing what went wrong.
|
|
177
131
|
*/
|
|
178
|
-
|
|
132
|
+
error: string;
|
|
179
133
|
|
|
180
134
|
/**
|
|
181
|
-
*
|
|
135
|
+
* Frame type identifier.
|
|
182
136
|
*/
|
|
183
|
-
|
|
137
|
+
type: 'error';
|
|
184
138
|
}
|
|
185
139
|
}
|
|
186
140
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
141
|
+
export interface SpeechToTextListProvidersParams {
|
|
142
|
+
/**
|
|
143
|
+
* Filter to entries for a specific STT provider. The enum mirrors the providers
|
|
144
|
+
* advertised across the speech-to-text spec (including `google` and `telnyx`,
|
|
145
|
+
* which are accepted as WebSocket transcription engines). A provider that has no
|
|
146
|
+
* models currently registered for any service type will return an empty `data`
|
|
147
|
+
* array rather than an error.
|
|
148
|
+
*/
|
|
149
|
+
provider?:
|
|
150
|
+
| 'deepgram'
|
|
151
|
+
| 'speechmatics'
|
|
152
|
+
| 'assemblyai'
|
|
153
|
+
| 'xai'
|
|
154
|
+
| 'soniox'
|
|
155
|
+
| 'azure'
|
|
156
|
+
| 'openai'
|
|
157
|
+
| 'google'
|
|
158
|
+
| 'telnyx';
|
|
191
159
|
|
|
192
|
-
/**
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Filter to entries that support the given service type.
|
|
162
|
+
*/
|
|
163
|
+
service_type?: 'streaming' | 'file_transcription' | 'in_call_transcription';
|
|
164
|
+
}
|
|
196
165
|
|
|
197
166
|
export declare namespace SpeechToText {
|
|
198
|
-
export {
|
|
167
|
+
export {
|
|
168
|
+
type SpeechToTextListProvidersResponse as SpeechToTextListProvidersResponse,
|
|
169
|
+
type TranscribeClientEvent as TranscribeClientEvent,
|
|
170
|
+
type TranscribeServerEvent as TranscribeServerEvent,
|
|
171
|
+
type SpeechToTextListProvidersParams as SpeechToTextListProvidersParams,
|
|
172
|
+
};
|
|
199
173
|
}
|