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
|
@@ -4,107 +4,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.SpeechToTextWS = void 0;
|
|
5
5
|
const tslib_1 = require("../../internal/tslib.js");
|
|
6
6
|
const WS = tslib_1.__importStar(require("ws"));
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const ws_adapter_node_1 = require("../../internal/ws-adapter-node.js");
|
|
8
|
+
const ws_base_1 = require("./ws-base.js");
|
|
9
|
+
class SpeechToTextWS extends ws_base_1.SpeechToTextWSBase {
|
|
9
10
|
constructor(client, parameters, options) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.url = (0, internal_base_1.buildURL)(client, parameters);
|
|
13
|
-
this.socket = new WS.WebSocket(this.url, {
|
|
14
|
-
...options,
|
|
15
|
-
headers: {
|
|
16
|
-
...this.authHeaders(),
|
|
17
|
-
...options?.headers,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
this.socket.on('open', () => {
|
|
21
|
-
// Connection established, ready to send audio
|
|
22
|
-
});
|
|
23
|
-
this.socket.on('message', (wsEvent) => {
|
|
24
|
-
const event = (() => {
|
|
25
|
-
try {
|
|
26
|
-
return JSON.parse(wsEvent.toString());
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
this._onError(null, 'could not parse websocket event', err);
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
})();
|
|
33
|
-
if (event) {
|
|
34
|
-
this._emit('event', event);
|
|
35
|
-
if (event.type === 'error') {
|
|
36
|
-
this._onError(event);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
// @ts-ignore TS isn't smart enough to get the relationship right here
|
|
40
|
-
this._emit(event.type, event);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
this.socket.on('error', (err) => {
|
|
45
|
-
this._onError(null, err.message, err);
|
|
46
|
-
});
|
|
47
|
-
this.socket.on('close', (code, reason) => {
|
|
48
|
-
// Connection closed
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Send binary audio data to the server for transcription.
|
|
53
|
-
* @param data - Raw audio bytes (mp3 or wav format)
|
|
54
|
-
*/
|
|
55
|
-
send(data) {
|
|
56
|
-
try {
|
|
57
|
-
this.socket.send(data);
|
|
58
|
-
}
|
|
59
|
-
catch (err) {
|
|
60
|
-
this._onError(null, 'could not send audio data', err);
|
|
11
|
+
if (!WS?.WebSocket) {
|
|
12
|
+
throw new Error('SpeechToTextWS from "telnyx/resources/speech-to-text/ws" requires the "ws" package but it could not be loaded.');
|
|
61
13
|
}
|
|
14
|
+
const { reconnect, maxQueueSize, ...wsOptions } = options ?? {};
|
|
15
|
+
super(client, parameters, { reconnect, maxQueueSize });
|
|
16
|
+
this._wsOptions = wsOptions;
|
|
17
|
+
this._connectInitial();
|
|
62
18
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
catch (err) {
|
|
71
|
-
this._onError(null, 'could not close the connection', err);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Check if the WebSocket is open and ready to send data.
|
|
76
|
-
*/
|
|
77
|
-
get isOpen() {
|
|
78
|
-
return this.socket.readyState === WS.WebSocket.OPEN;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Wait for the connection to be established.
|
|
82
|
-
*/
|
|
83
|
-
waitForOpen() {
|
|
84
|
-
return new Promise((resolve, reject) => {
|
|
85
|
-
if (this.socket.readyState === WS.WebSocket.OPEN) {
|
|
86
|
-
resolve();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const onOpen = () => {
|
|
90
|
-
this.socket.off('open', onOpen);
|
|
91
|
-
this.socket.off('error', onError);
|
|
92
|
-
resolve();
|
|
93
|
-
};
|
|
94
|
-
const onError = (err) => {
|
|
95
|
-
this.socket.off('open', onOpen);
|
|
96
|
-
this.socket.off('error', onError);
|
|
97
|
-
reject(err);
|
|
98
|
-
};
|
|
99
|
-
this.socket.on('open', onOpen);
|
|
100
|
-
this.socket.on('error', onError);
|
|
19
|
+
_createSocket(url, authHeaders) {
|
|
20
|
+
const ws = new WS.WebSocket(url, {
|
|
21
|
+
...this._wsOptions,
|
|
22
|
+
headers: {
|
|
23
|
+
...authHeaders,
|
|
24
|
+
...this._wsOptions?.headers,
|
|
25
|
+
},
|
|
101
26
|
});
|
|
102
|
-
|
|
103
|
-
authHeaders() {
|
|
104
|
-
if (this.client.apiKey) {
|
|
105
|
-
return { Authorization: `Bearer ${this.client.apiKey}` };
|
|
106
|
-
}
|
|
107
|
-
return {};
|
|
27
|
+
return new ws_adapter_node_1.NodeWebSocket(ws);
|
|
108
28
|
}
|
|
109
29
|
}
|
|
110
30
|
exports.SpeechToTextWS = SpeechToTextWS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../src/resources/speech-to-text/ws.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,+CAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../src/resources/speech-to-text/ws.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,+CAAyB;AACzB,uEAA+D;AAC/D,0CAA+E;AAO/E,MAAa,cAAe,SAAQ,4BAAiC;IAGnE,YACE,MAAc,EACd,UAAgD,EAChD,OAAwD;QAExD,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAChE,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAES,aAAa,CAAC,GAAQ,EAAE,WAAmC;QACnE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE;YAC/B,GAAG,IAAI,CAAC,UAAU;YAClB,OAAO,EAAE;gBACP,GAAG,WAAW;gBACd,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO;aAC5B;SACF,CAAC,CAAC;QACH,OAAO,IAAI,+BAAa,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF;AA9BD,wCA8BC"}
|
|
@@ -1,106 +1,26 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import * as WS from 'ws';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { NodeWebSocket } from "../../internal/ws-adapter-node.mjs";
|
|
4
|
+
import { SpeechToTextWSBase } from "./ws-base.mjs";
|
|
5
|
+
export class SpeechToTextWS extends SpeechToTextWSBase {
|
|
5
6
|
constructor(client, parameters, options) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this.url = buildURL(client, parameters);
|
|
9
|
-
this.socket = new WS.WebSocket(this.url, {
|
|
10
|
-
...options,
|
|
11
|
-
headers: {
|
|
12
|
-
...this.authHeaders(),
|
|
13
|
-
...options?.headers,
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
this.socket.on('open', () => {
|
|
17
|
-
// Connection established, ready to send audio
|
|
18
|
-
});
|
|
19
|
-
this.socket.on('message', (wsEvent) => {
|
|
20
|
-
const event = (() => {
|
|
21
|
-
try {
|
|
22
|
-
return JSON.parse(wsEvent.toString());
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
this._onError(null, 'could not parse websocket event', err);
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
})();
|
|
29
|
-
if (event) {
|
|
30
|
-
this._emit('event', event);
|
|
31
|
-
if (event.type === 'error') {
|
|
32
|
-
this._onError(event);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
// @ts-ignore TS isn't smart enough to get the relationship right here
|
|
36
|
-
this._emit(event.type, event);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
this.socket.on('error', (err) => {
|
|
41
|
-
this._onError(null, err.message, err);
|
|
42
|
-
});
|
|
43
|
-
this.socket.on('close', (code, reason) => {
|
|
44
|
-
// Connection closed
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Send binary audio data to the server for transcription.
|
|
49
|
-
* @param data - Raw audio bytes (mp3 or wav format)
|
|
50
|
-
*/
|
|
51
|
-
send(data) {
|
|
52
|
-
try {
|
|
53
|
-
this.socket.send(data);
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
this._onError(null, 'could not send audio data', err);
|
|
7
|
+
if (!WS?.WebSocket) {
|
|
8
|
+
throw new Error('SpeechToTextWS from "telnyx/resources/speech-to-text/ws" requires the "ws" package but it could not be loaded.');
|
|
57
9
|
}
|
|
10
|
+
const { reconnect, maxQueueSize, ...wsOptions } = options ?? {};
|
|
11
|
+
super(client, parameters, { reconnect, maxQueueSize });
|
|
12
|
+
this._wsOptions = wsOptions;
|
|
13
|
+
this._connectInitial();
|
|
58
14
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
catch (err) {
|
|
67
|
-
this._onError(null, 'could not close the connection', err);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Check if the WebSocket is open and ready to send data.
|
|
72
|
-
*/
|
|
73
|
-
get isOpen() {
|
|
74
|
-
return this.socket.readyState === WS.WebSocket.OPEN;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Wait for the connection to be established.
|
|
78
|
-
*/
|
|
79
|
-
waitForOpen() {
|
|
80
|
-
return new Promise((resolve, reject) => {
|
|
81
|
-
if (this.socket.readyState === WS.WebSocket.OPEN) {
|
|
82
|
-
resolve();
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const onOpen = () => {
|
|
86
|
-
this.socket.off('open', onOpen);
|
|
87
|
-
this.socket.off('error', onError);
|
|
88
|
-
resolve();
|
|
89
|
-
};
|
|
90
|
-
const onError = (err) => {
|
|
91
|
-
this.socket.off('open', onOpen);
|
|
92
|
-
this.socket.off('error', onError);
|
|
93
|
-
reject(err);
|
|
94
|
-
};
|
|
95
|
-
this.socket.on('open', onOpen);
|
|
96
|
-
this.socket.on('error', onError);
|
|
15
|
+
_createSocket(url, authHeaders) {
|
|
16
|
+
const ws = new WS.WebSocket(url, {
|
|
17
|
+
...this._wsOptions,
|
|
18
|
+
headers: {
|
|
19
|
+
...authHeaders,
|
|
20
|
+
...this._wsOptions?.headers,
|
|
21
|
+
},
|
|
97
22
|
});
|
|
98
|
-
|
|
99
|
-
authHeaders() {
|
|
100
|
-
if (this.client.apiKey) {
|
|
101
|
-
return { Authorization: `Bearer ${this.client.apiKey}` };
|
|
102
|
-
}
|
|
103
|
-
return {};
|
|
23
|
+
return new NodeWebSocket(ws);
|
|
104
24
|
}
|
|
105
25
|
}
|
|
106
26
|
//# sourceMappingURL=ws.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws.mjs","sourceRoot":"","sources":["../../src/resources/speech-to-text/ws.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ws.mjs","sourceRoot":"","sources":["../../src/resources/speech-to-text/ws.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,2CAAuC;AAC/D,OAAO,EAAE,kBAAkB,EAAkC,sBAAkB;AAO/E,MAAM,OAAO,cAAe,SAAQ,kBAAiC;IAGnE,YACE,MAAc,EACd,UAAgD,EAChD,OAAwD;QAExD,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAChE,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAES,aAAa,CAAC,GAAQ,EAAE,WAAmC;QACnE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE;YAC/B,GAAG,IAAI,CAAC,UAAU;YAClB,OAAO,EAAE;gBACP,GAAG,WAAW;gBACd,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO;aAC5B;SACF,CAAC,CAAC;QACH,OAAO,IAAI,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,81 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
-
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
-
/**
|
|
5
|
-
* Discover available speech-to-text providers, models, and supported languages.
|
|
6
|
-
*/
|
|
7
|
-
export declare class SpeechToText extends APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
10
|
-
* accepted language codes, and the service types each model supports.
|
|
11
|
-
*
|
|
12
|
-
* Service types:
|
|
13
|
-
*
|
|
14
|
-
* - `streaming` — standalone WebSocket transcription via
|
|
15
|
-
* `/speech-to-text/transcription`.
|
|
16
|
-
* - `file_transcription` — file-based transcription via
|
|
17
|
-
* `/ai/audio/transcriptions`.
|
|
18
|
-
* - `in_call_transcription` — live call transcription via Call Control
|
|
19
|
-
* `transcription_start`.
|
|
20
|
-
*
|
|
21
|
-
* Use this endpoint to discover which (provider, model) combinations are available
|
|
22
|
-
* for the surface you need, and which language codes each accepts. `auto` in a
|
|
23
|
-
* `languages` array indicates the provider performs language detection.
|
|
24
|
-
*/
|
|
25
|
-
listProviders(query?: SpeechToTextListProvidersParams | null | undefined, options?: RequestOptions): APIPromise<SpeechToTextListProvidersResponse>;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* List of supported STT providers and models.
|
|
29
|
-
*/
|
|
30
|
-
export interface SpeechToTextListProvidersResponse {
|
|
31
|
-
data: Array<SpeechToTextListProvidersResponse.Data>;
|
|
32
|
-
meta: SpeechToTextListProvidersResponse.Meta;
|
|
33
|
-
}
|
|
34
|
-
export declare namespace SpeechToTextListProvidersResponse {
|
|
35
|
-
/**
|
|
36
|
-
* A (provider, model) tuple along with its supported service types and languages.
|
|
37
|
-
*/
|
|
38
|
-
interface Data {
|
|
39
|
-
/**
|
|
40
|
-
* Languages this (provider, model) accepts, in the provider's native code format.
|
|
41
|
-
* `auto` indicates the provider performs language detection.
|
|
42
|
-
*/
|
|
43
|
-
languages: Array<string>;
|
|
44
|
-
/**
|
|
45
|
-
* Provider-scoped model name.
|
|
46
|
-
*/
|
|
47
|
-
model: string;
|
|
48
|
-
/**
|
|
49
|
-
* STT provider name.
|
|
50
|
-
*/
|
|
51
|
-
provider: string;
|
|
52
|
-
/**
|
|
53
|
-
* Service surfaces this (provider, model) supports.
|
|
54
|
-
*/
|
|
55
|
-
service_types: Array<'streaming' | 'file_transcription' | 'in_call_transcription'>;
|
|
56
|
-
}
|
|
57
|
-
interface Meta {
|
|
58
|
-
/**
|
|
59
|
-
* Total number of entries returned.
|
|
60
|
-
*/
|
|
61
|
-
total: number;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export interface SpeechToTextListProvidersParams {
|
|
65
|
-
/**
|
|
66
|
-
* Filter to entries for a specific STT provider. The enum mirrors the providers
|
|
67
|
-
* advertised across the speech-to-text spec (including `google` and `telnyx`,
|
|
68
|
-
* which are accepted as WebSocket transcription engines). A provider that has no
|
|
69
|
-
* models currently registered for any service type will return an empty `data`
|
|
70
|
-
* array rather than an error.
|
|
71
|
-
*/
|
|
72
|
-
provider?: 'deepgram' | 'speechmatics' | 'assemblyai' | 'xai' | 'soniox' | 'azure' | 'openai' | 'google' | 'telnyx';
|
|
73
|
-
/**
|
|
74
|
-
* Filter to entries that support the given service type.
|
|
75
|
-
*/
|
|
76
|
-
service_type?: 'streaming' | 'file_transcription' | 'in_call_transcription';
|
|
77
|
-
}
|
|
78
|
-
export declare namespace SpeechToText {
|
|
79
|
-
export { type SpeechToTextListProvidersResponse as SpeechToTextListProvidersResponse, type SpeechToTextListProvidersParams as SpeechToTextListProvidersParams, };
|
|
80
|
-
}
|
|
1
|
+
export * from "./speech-to-text/index.mjs";
|
|
81
2
|
//# 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.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"speech-to-text.d.mts","sourceRoot":"","sources":["../src/resources/speech-to-text.ts"],"names":[],"mappings":"AAEA,2CAAuC"}
|
|
@@ -1,81 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
-
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
-
/**
|
|
5
|
-
* Discover available speech-to-text providers, models, and supported languages.
|
|
6
|
-
*/
|
|
7
|
-
export declare class SpeechToText extends APIResource {
|
|
8
|
-
/**
|
|
9
|
-
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
10
|
-
* accepted language codes, and the service types each model supports.
|
|
11
|
-
*
|
|
12
|
-
* Service types:
|
|
13
|
-
*
|
|
14
|
-
* - `streaming` — standalone WebSocket transcription via
|
|
15
|
-
* `/speech-to-text/transcription`.
|
|
16
|
-
* - `file_transcription` — file-based transcription via
|
|
17
|
-
* `/ai/audio/transcriptions`.
|
|
18
|
-
* - `in_call_transcription` — live call transcription via Call Control
|
|
19
|
-
* `transcription_start`.
|
|
20
|
-
*
|
|
21
|
-
* Use this endpoint to discover which (provider, model) combinations are available
|
|
22
|
-
* for the surface you need, and which language codes each accepts. `auto` in a
|
|
23
|
-
* `languages` array indicates the provider performs language detection.
|
|
24
|
-
*/
|
|
25
|
-
listProviders(query?: SpeechToTextListProvidersParams | null | undefined, options?: RequestOptions): APIPromise<SpeechToTextListProvidersResponse>;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* List of supported STT providers and models.
|
|
29
|
-
*/
|
|
30
|
-
export interface SpeechToTextListProvidersResponse {
|
|
31
|
-
data: Array<SpeechToTextListProvidersResponse.Data>;
|
|
32
|
-
meta: SpeechToTextListProvidersResponse.Meta;
|
|
33
|
-
}
|
|
34
|
-
export declare namespace SpeechToTextListProvidersResponse {
|
|
35
|
-
/**
|
|
36
|
-
* A (provider, model) tuple along with its supported service types and languages.
|
|
37
|
-
*/
|
|
38
|
-
interface Data {
|
|
39
|
-
/**
|
|
40
|
-
* Languages this (provider, model) accepts, in the provider's native code format.
|
|
41
|
-
* `auto` indicates the provider performs language detection.
|
|
42
|
-
*/
|
|
43
|
-
languages: Array<string>;
|
|
44
|
-
/**
|
|
45
|
-
* Provider-scoped model name.
|
|
46
|
-
*/
|
|
47
|
-
model: string;
|
|
48
|
-
/**
|
|
49
|
-
* STT provider name.
|
|
50
|
-
*/
|
|
51
|
-
provider: string;
|
|
52
|
-
/**
|
|
53
|
-
* Service surfaces this (provider, model) supports.
|
|
54
|
-
*/
|
|
55
|
-
service_types: Array<'streaming' | 'file_transcription' | 'in_call_transcription'>;
|
|
56
|
-
}
|
|
57
|
-
interface Meta {
|
|
58
|
-
/**
|
|
59
|
-
* Total number of entries returned.
|
|
60
|
-
*/
|
|
61
|
-
total: number;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
export interface SpeechToTextListProvidersParams {
|
|
65
|
-
/**
|
|
66
|
-
* Filter to entries for a specific STT provider. The enum mirrors the providers
|
|
67
|
-
* advertised across the speech-to-text spec (including `google` and `telnyx`,
|
|
68
|
-
* which are accepted as WebSocket transcription engines). A provider that has no
|
|
69
|
-
* models currently registered for any service type will return an empty `data`
|
|
70
|
-
* array rather than an error.
|
|
71
|
-
*/
|
|
72
|
-
provider?: 'deepgram' | 'speechmatics' | 'assemblyai' | 'xai' | 'soniox' | 'azure' | 'openai' | 'google' | 'telnyx';
|
|
73
|
-
/**
|
|
74
|
-
* Filter to entries that support the given service type.
|
|
75
|
-
*/
|
|
76
|
-
service_type?: 'streaming' | 'file_transcription' | 'in_call_transcription';
|
|
77
|
-
}
|
|
78
|
-
export declare namespace SpeechToText {
|
|
79
|
-
export { type SpeechToTextListProvidersResponse as SpeechToTextListProvidersResponse, type SpeechToTextListProvidersParams as SpeechToTextListProvidersParams, };
|
|
80
|
-
}
|
|
1
|
+
export * from "./speech-to-text/index.js";
|
|
81
2
|
//# 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.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"speech-to-text.d.ts","sourceRoot":"","sources":["../src/resources/speech-to-text.ts"],"names":[],"mappings":"AAEA,0CAAuC"}
|
|
@@ -1,36 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Discover available speech-to-text providers, models, and supported languages.
|
|
8
|
-
*/
|
|
9
|
-
class SpeechToText extends resource_1.APIResource {
|
|
10
|
-
/**
|
|
11
|
-
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
12
|
-
* accepted language codes, and the service types each model supports.
|
|
13
|
-
*
|
|
14
|
-
* Service types:
|
|
15
|
-
*
|
|
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`.
|
|
22
|
-
*
|
|
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
|
-
*/
|
|
27
|
-
listProviders(query = {}, options) {
|
|
28
|
-
return this._client.get('/speech-to-text/providers', {
|
|
29
|
-
query,
|
|
30
|
-
defaultBaseURL: 'https://api.telnyx.com/v2',
|
|
31
|
-
...options,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.SpeechToText = SpeechToText;
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./speech-to-text/index.js"), exports);
|
|
36
6
|
//# sourceMappingURL=speech-to-text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech-to-text.js","sourceRoot":"","sources":["../src/resources/speech-to-text.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"speech-to-text.js","sourceRoot":"","sources":["../src/resources/speech-to-text.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oEAAuC"}
|
|
@@ -1,32 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Discover available speech-to-text providers, models, and supported languages.
|
|
5
|
-
*/
|
|
6
|
-
export class SpeechToText extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* Retrieve the canonical list of supported speech-to-text providers, models,
|
|
9
|
-
* accepted language codes, and the service types each model supports.
|
|
10
|
-
*
|
|
11
|
-
* Service types:
|
|
12
|
-
*
|
|
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`.
|
|
19
|
-
*
|
|
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
|
-
*/
|
|
24
|
-
listProviders(query = {}, options) {
|
|
25
|
-
return this._client.get('/speech-to-text/providers', {
|
|
26
|
-
query,
|
|
27
|
-
defaultBaseURL: 'https://api.telnyx.com/v2',
|
|
28
|
-
...options,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
2
|
+
export * from "./speech-to-text/index.mjs";
|
|
32
3
|
//# sourceMappingURL=speech-to-text.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speech-to-text.mjs","sourceRoot":"","sources":["../src/resources/speech-to-text.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,
|
|
1
|
+
{"version":3,"file":"speech-to-text.mjs","sourceRoot":"","sources":["../src/resources/speech-to-text.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,2CAAuC"}
|