@ondewo/s2t-client-typescript 7.4.1 → 7.5.1
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/README.md +170 -1
- package/api/google/protobuf/empty_pb.js +2 -8
- package/api/google/protobuf/struct_pb.js +13 -13
- package/api/ondewo/s2t/speech-to-text_pb.d.ts +161 -0
- package/api/ondewo/s2t/speech-to-text_pb.js +1206 -217
- package/auth/grpcWebEndpoint.d.ts +80 -0
- package/auth/grpcWebEndpoint.js +121 -0
- package/auth/offlineTokenProvider.d.ts +218 -0
- package/auth/offlineTokenProvider.js +422 -0
- package/package.json +2 -2
- package/public-api.d.ts +4 -2
- package/public-api.js +5 -3
package/README.md
CHANGED
|
@@ -52,13 +52,18 @@ npm
|
|
|
52
52
|
│ ├── google
|
|
53
53
|
│ │ └── protobuf
|
|
54
54
|
│ │ ├── empty_pb.d.ts
|
|
55
|
-
│ │
|
|
55
|
+
│ │ ├── empty_pb.js
|
|
56
|
+
│ │ ├── struct_pb.d.ts
|
|
57
|
+
│ │ └── struct_pb.js
|
|
56
58
|
│ └── ondewo
|
|
57
59
|
│ └── s2t
|
|
58
60
|
│ ├── speech-to-text_grpc_web_pb.d.ts
|
|
59
61
|
│ ├── speech-to-text_grpc_web_pb.js
|
|
60
62
|
│ ├── speech-to-text_pb.d.ts
|
|
61
63
|
│ └── speech-to-text_pb.js
|
|
64
|
+
├── auth
|
|
65
|
+
│ ├── offlineTokenProvider.d.ts
|
|
66
|
+
│ └── offlineTokenProvider.js
|
|
62
67
|
├── LICENSE
|
|
63
68
|
├── package.json
|
|
64
69
|
├── public-api.d.ts
|
|
@@ -66,3 +71,167 @@ npm
|
|
|
66
71
|
└── README.md
|
|
67
72
|
```
|
|
68
73
|
|
|
74
|
+
`api/` and `public-api.*` are generated from `ondewo/s2t/speech-to-text.proto` by the
|
|
75
|
+
[ONDEWO PROTO COMPILER](https://github.com/ondewo/ondewo-proto-compiler); `auth/` is hand-written and compiled into
|
|
76
|
+
the package by `make create_npm_package`.
|
|
77
|
+
|
|
78
|
+
## Authentication
|
|
79
|
+
|
|
80
|
+
The service expects a Keycloak bearer token in the `authorization` gRPC metadata header. `auth/offlineTokenProvider`
|
|
81
|
+
performs the headless (2FA-exempt) ROPC + `offline_access` login against the public SDK client and keeps the
|
|
82
|
+
short-lived access token fresh in the background until `tokenExpirationInS` elapses:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { login, OfflineTokenProvider } from '@ondewo/s2t-client-typescript/auth/offlineTokenProvider';
|
|
86
|
+
import { Speech2TextPromiseClient } from '@ondewo/s2t-client-typescript/api/ondewo/s2t/speech-to-text_grpc_web_pb';
|
|
87
|
+
import { ListS2tPipelinesRequest } from '@ondewo/s2t-client-typescript/api/ondewo/s2t/speech-to-text_pb';
|
|
88
|
+
|
|
89
|
+
const provider: OfflineTokenProvider = await login({
|
|
90
|
+
keycloakUrl: 'https://auth.ondewo.com/auth',
|
|
91
|
+
realm: 'ondewo-ccai-platform',
|
|
92
|
+
clientId: 'ondewo-nlu-cai-sdk-public',
|
|
93
|
+
username: process.env.KEYCLOAK_USER_NAME ?? '',
|
|
94
|
+
password: process.env.KEYCLOAK_PASSWORD ?? ''
|
|
95
|
+
// keycloakVerifySsl: false // ONLY for a self-signed local Envoy; Node-only, ignored in a browser
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const client = new Speech2TextPromiseClient('http://localhost:8080');
|
|
99
|
+
const request = new ListS2tPipelinesRequest();
|
|
100
|
+
request.setLanguagesList(['en-US']);
|
|
101
|
+
const response = await client.listS2tPipelines(request, { Authorization: provider.getAuthorizationHeader() });
|
|
102
|
+
|
|
103
|
+
provider.stop(); // stops the background refresh loop so the process can exit
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
A runnable version of exactly this flow, configured from `examples/environment.env`, lives in
|
|
107
|
+
`examples/ts-client.ts`.
|
|
108
|
+
|
|
109
|
+
## TLS, mutual TLS and certificates
|
|
110
|
+
|
|
111
|
+
This package is a **gRPC-web** client. Its generated clients send every call through the browser's `XMLHttpRequest`
|
|
112
|
+
to a gRPC-web proxy (Envoy) in front of the ONDEWO service, so TLS is the browser's TLS: the browser verifies the
|
|
113
|
+
server certificate against its own (operating system / browser) trust store, and a client certificate for mutual TLS
|
|
114
|
+
can only come from the browser's own certificate store. Page code cannot hand a CA certificate, a client certificate
|
|
115
|
+
or a private key to the browser, so this SDK takes none of them; never ship a private key to a browser.
|
|
116
|
+
|
|
117
|
+
`createGrpcWebEndpoint` turns `host` / `port` / `useSecureChannel` into the `hostname` URL and the client options
|
|
118
|
+
every generated `*Client` / `*PromiseClient` takes:
|
|
119
|
+
|
|
120
|
+
| Mode | `createGrpcWebEndpoint` config | Where the certificates live |
|
|
121
|
+
|--------------------------------|---------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
122
|
+
| Plaintext (not for production) | `useSecureChannel: false` | none; builds `http://host:port` and logs a warning naming `host:port` |
|
|
123
|
+
| TLS, publicly trusted server | `useSecureChannel: true` (the default) | the server certificate chains to a CA the browser already trusts |
|
|
124
|
+
| TLS, private CA | `useSecureChannel: true` | install the CA (`ca.pem`) in the operating system or browser trust store |
|
|
125
|
+
| Mutual TLS | `useSecureChannel: true`, plus `withCredentials: true` cross-origin | install the client certificate and key (`client.p12`) in the operating system or browser certificate store; the proxy requests it and verifies it against its CA |
|
|
126
|
+
|
|
127
|
+
Rules the code enforces:
|
|
128
|
+
|
|
129
|
+
- A config carrying `grpcCert`, `grpcClientCert` or `grpcClientKey` (or the Python spellings `grpc_cert`,
|
|
130
|
+
`grpc_client_cert`, `grpc_client_key`) with a non-empty value throws an `Error` naming the field, instead of
|
|
131
|
+
silently ignoring a certificate you meant to use. Empty values are ignored, so a config ported from another ONDEWO
|
|
132
|
+
SDK with blank TLS fields still works.
|
|
133
|
+
- `host` is a bare host name or IP address (no scheme, credentials, path or port); a bare IPv6 literal is bracketed
|
|
134
|
+
(`::1` becomes `https://[::1]:50051`). `port` is an integer 1-65535 (number or numeric string).
|
|
135
|
+
- `useSecureChannel` and `withCredentials` must be booleans: parse environment strings yourself (`'false'` is refused,
|
|
136
|
+
not read as `true`).
|
|
137
|
+
- `useSecureChannel: false` logs a warning naming `host:port` through `console.warn`, or through the logger passed as
|
|
138
|
+
the second argument. No error message renders a value of a refused field or the host of a refused URL.
|
|
139
|
+
- `withCredentials: true` is gRPC-web's option for cross-origin calls: only then does the browser send cookies, HTTP
|
|
140
|
+
authentication **and its TLS client certificate** to a proxy on another origin. A same-origin proxy does not need it.
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
import { createGrpcWebEndpoint } from '@ondewo/s2t-client-typescript/auth/offlineTokenProvider';
|
|
144
|
+
import { Speech2TextPromiseClient } from '@ondewo/s2t-client-typescript/api/ondewo/s2t/speech-to-text_grpc_web_pb';
|
|
145
|
+
|
|
146
|
+
const endpoint = createGrpcWebEndpoint({
|
|
147
|
+
host: 's2t.example.com',
|
|
148
|
+
port: 443,
|
|
149
|
+
withCredentials: true // only for mutual TLS against a proxy on another origin
|
|
150
|
+
});
|
|
151
|
+
const client = new Speech2TextPromiseClient(endpoint.hostname, null, endpoint.options);
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Node.js.** The generated clients need `XMLHttpRequest`, which Node.js does not provide (a call fails with
|
|
155
|
+
`XMLHttpRequest is not defined`), so this package's gRPC calls run in browsers only; in Node.js only the Keycloak
|
|
156
|
+
`login` helper is usable. There is therefore no Node.js path for a custom CA or a client certificate in this SDK: for
|
|
157
|
+
a server-side client use the ONDEWO Python SDK, or generate a native `@grpc/grpc-js` client from the
|
|
158
|
+
[API protos](https://github.com/ondewo/ondewo-s2t-api) and pass your PEM files to `credentials.createSsl(ca, clientKey, clientCert)`.
|
|
159
|
+
|
|
160
|
+
### The proxy side of mutual TLS
|
|
161
|
+
|
|
162
|
+
The browser only offers a client certificate when the TLS server asks for one. With Envoy as the gRPC-web proxy:
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
transport_socket:
|
|
166
|
+
name: envoy.transport_sockets.tls
|
|
167
|
+
typed_config:
|
|
168
|
+
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext
|
|
169
|
+
require_client_certificate: true
|
|
170
|
+
common_tls_context:
|
|
171
|
+
tls_certificates:
|
|
172
|
+
- certificate_chain: { filename: /etc/envoy/certs/server.pem }
|
|
173
|
+
private_key: { filename: /etc/envoy/certs/server.key }
|
|
174
|
+
validation_context:
|
|
175
|
+
trusted_ca: { filename: /etc/envoy/certs/ca.pem }
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
For a cross-origin page the CORS policy must allow credentials with an explicit origin (`allow_credentials: true`;
|
|
179
|
+
`Access-Control-Allow-Origin: *` is rejected by the browser for a credentialed request). Envoy may in turn connect to
|
|
180
|
+
the ONDEWO service over TLS or mutual TLS with its own (upstream) certificate.
|
|
181
|
+
|
|
182
|
+
### A test PKI with openssl
|
|
183
|
+
|
|
184
|
+
A CA, a server certificate with SANs, and a client certificate with the `clientAuth` extended key usage, bundled as
|
|
185
|
+
PKCS#12 for import into a browser or operating system certificate store. For tests only: the keys are unencrypted.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 365 \
|
|
189
|
+
-subj "/CN=Test CA" -keyout ca.key -out ca.pem
|
|
190
|
+
|
|
191
|
+
printf 'subjectAltName=DNS:localhost,IP:127.0.0.1\nextendedKeyUsage=serverAuth\n' > server.ext
|
|
192
|
+
openssl req -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes \
|
|
193
|
+
-subj "/CN=localhost" -keyout server.key -out server.csr
|
|
194
|
+
openssl x509 -req -in server.csr -CA ca.pem -CAkey ca.key -CAcreateserial -days 365 \
|
|
195
|
+
-extfile server.ext -out server.pem
|
|
196
|
+
|
|
197
|
+
printf 'extendedKeyUsage=clientAuth\n' > client.ext
|
|
198
|
+
openssl req -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes \
|
|
199
|
+
-subj "/CN=my-client" -keyout client.key -out client.csr
|
|
200
|
+
openssl x509 -req -in client.csr -CA ca.pem -CAkey ca.key -CAcreateserial -days 365 \
|
|
201
|
+
-extfile client.ext -out client.pem
|
|
202
|
+
openssl pkcs12 -export -in client.pem -inkey client.key -certfile ca.pem -name my-client -out client.p12
|
|
203
|
+
|
|
204
|
+
chmod 600 *.key client.p12
|
|
205
|
+
openssl verify -CAfile ca.pem server.pem client.pem
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Envoy uses `server.pem` / `server.key` and trusts `ca.pem` for its clients; the browser trusts `ca.pem` and imports
|
|
209
|
+
`client.p12`.
|
|
210
|
+
|
|
211
|
+
### TLS security notes
|
|
212
|
+
|
|
213
|
+
- The private key of a client certificate belongs in the operating system / browser certificate store, never in page
|
|
214
|
+
code, a bundle, `localStorage` or a config file served to the browser. This SDK refuses one rather than carry it.
|
|
215
|
+
- `createGrpcWebEndpoint` returns only the URL and `{ withCredentials }`; logging it reveals no secret.
|
|
216
|
+
- The Keycloak tokens are secrets too: `JSON.stringify(provider)`, `console.log(provider)` and `util.inspect(provider)`
|
|
217
|
+
of the `OfflineTokenProvider` (also nested in another object) render the access and refresh tokens as
|
|
218
|
+
`***REDACTED***` (`getAuthorizationHeader()` still returns the real one). Do not log the `Authorization` header
|
|
219
|
+
yourself.
|
|
220
|
+
- `withCredentials: true` also sends the page's cookies for the proxy's origin; restrict the proxy's allowed origins.
|
|
221
|
+
|
|
222
|
+
### TLS troubleshooting
|
|
223
|
+
|
|
224
|
+
grpc-web reports a failed TLS connection only as a generic error (the browser hides the TLS cause from JavaScript);
|
|
225
|
+
the cause is in the browser's developer tools (Console / Network tab):
|
|
226
|
+
|
|
227
|
+
- **`net::ERR_CERT_AUTHORITY_INVALID`**: the server certificate does not chain to a CA the browser trusts. Install
|
|
228
|
+
the CA in the trust store, or use a publicly trusted certificate.
|
|
229
|
+
- **`net::ERR_CERT_COMMON_NAME_INVALID`**: the host you connect to is not among the certificate's subject alternative
|
|
230
|
+
names. Connect by a name in the SAN, or reissue the certificate (an IP needs an `IP:` SAN).
|
|
231
|
+
- **`net::ERR_BAD_SSL_CLIENT_AUTH_CERT`** / **`net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED`**: the proxy requires a client
|
|
232
|
+
certificate and the browser offered none, or one not signed by the proxy's `trusted_ca`. Import `client.p12`, pick
|
|
233
|
+
it when the browser asks, and check `openssl verify -CAfile ca.pem client.pem`.
|
|
234
|
+
- **Mixed content blocked**: an `https://` page cannot call an `http://` endpoint; use `useSecureChannel: true`.
|
|
235
|
+
- **CORS error only with `withCredentials: true`**: the proxy answers with `Access-Control-Allow-Origin: *` or
|
|
236
|
+
without `Access-Control-Allow-Credentials: true`.
|
|
237
|
+
|
|
@@ -13,13 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
var jspb = require('google-protobuf');
|
|
15
15
|
var goog = jspb;
|
|
16
|
-
var global =
|
|
17
|
-
(typeof globalThis !== 'undefined' && globalThis) ||
|
|
18
|
-
(typeof window !== 'undefined' && window) ||
|
|
19
|
-
(typeof global !== 'undefined' && global) ||
|
|
20
|
-
(typeof self !== 'undefined' && self) ||
|
|
21
|
-
(function () { return this; }).call(null) ||
|
|
22
|
-
Function('return this')();
|
|
16
|
+
var global = globalThis;
|
|
23
17
|
|
|
24
18
|
goog.exportSymbol('proto.google.protobuf.Empty', null, global);
|
|
25
19
|
/**
|
|
@@ -88,7 +82,7 @@ proto.google.protobuf.Empty.toObject = function(includeInstance, msg) {
|
|
|
88
82
|
|
|
89
83
|
/**
|
|
90
84
|
* Deserializes binary data (in protobuf wire format).
|
|
91
|
-
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
85
|
+
* @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
|
|
92
86
|
* @return {!proto.google.protobuf.Empty}
|
|
93
87
|
*/
|
|
94
88
|
proto.google.protobuf.Empty.deserializeBinary = function(bytes) {
|
|
@@ -13,13 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
var jspb = require('google-protobuf');
|
|
15
15
|
var goog = jspb;
|
|
16
|
-
var global =
|
|
17
|
-
(typeof globalThis !== 'undefined' && globalThis) ||
|
|
18
|
-
(typeof window !== 'undefined' && window) ||
|
|
19
|
-
(typeof global !== 'undefined' && global) ||
|
|
20
|
-
(typeof self !== 'undefined' && self) ||
|
|
21
|
-
(function () { return this; }).call(null) ||
|
|
22
|
-
Function('return this')();
|
|
16
|
+
var global = globalThis;
|
|
23
17
|
|
|
24
18
|
goog.exportSymbol('proto.google.protobuf.ListValue', null, global);
|
|
25
19
|
goog.exportSymbol('proto.google.protobuf.NullValue', null, global);
|
|
@@ -134,7 +128,7 @@ fieldsMap: (f = msg.getFieldsMap()) ? f.toObject(includeInstance, proto.google.p
|
|
|
134
128
|
|
|
135
129
|
/**
|
|
136
130
|
* Deserializes binary data (in protobuf wire format).
|
|
137
|
-
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
131
|
+
* @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
|
|
138
132
|
* @return {!proto.google.protobuf.Struct}
|
|
139
133
|
*/
|
|
140
134
|
proto.google.protobuf.Struct.deserializeBinary = function(bytes) {
|
|
@@ -161,7 +155,7 @@ proto.google.protobuf.Struct.deserializeBinaryFromReader = function(msg, reader)
|
|
|
161
155
|
case 1:
|
|
162
156
|
var value = msg.getFieldsMap();
|
|
163
157
|
reader.readMessage(value, function(message, reader) {
|
|
164
|
-
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.
|
|
158
|
+
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readStringRequireUtf8, jspb.BinaryReader.prototype.readMessage, proto.google.protobuf.Value.deserializeBinaryFromReader, "", new proto.google.protobuf.Value());
|
|
165
159
|
});
|
|
166
160
|
break;
|
|
167
161
|
default:
|
|
@@ -195,7 +189,13 @@ proto.google.protobuf.Struct.serializeBinaryToWriter = function(message, writer)
|
|
|
195
189
|
var f = undefined;
|
|
196
190
|
f = message.getFieldsMap(true);
|
|
197
191
|
if (f && f.getLength() > 0) {
|
|
198
|
-
|
|
192
|
+
jspb.internal.public_for_gencode.serializeMapToBinary(
|
|
193
|
+
message.getFieldsMap(true),
|
|
194
|
+
1,
|
|
195
|
+
writer,
|
|
196
|
+
jspb.BinaryWriter.prototype.writeString,
|
|
197
|
+
jspb.BinaryWriter.prototype.writeMessage,
|
|
198
|
+
proto.google.protobuf.Value.serializeBinaryToWriter);
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
|
|
@@ -303,7 +303,7 @@ listValue: (f = msg.getListValue()) && proto.google.protobuf.ListValue.toObject(
|
|
|
303
303
|
|
|
304
304
|
/**
|
|
305
305
|
* Deserializes binary data (in protobuf wire format).
|
|
306
|
-
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
306
|
+
* @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
|
|
307
307
|
* @return {!proto.google.protobuf.Value}
|
|
308
308
|
*/
|
|
309
309
|
proto.google.protobuf.Value.deserializeBinary = function(bytes) {
|
|
@@ -336,7 +336,7 @@ proto.google.protobuf.Value.deserializeBinaryFromReader = function(msg, reader)
|
|
|
336
336
|
msg.setNumberValue(value);
|
|
337
337
|
break;
|
|
338
338
|
case 3:
|
|
339
|
-
var value = /** @type {string} */ (reader.
|
|
339
|
+
var value = /** @type {string} */ (reader.readStringRequireUtf8());
|
|
340
340
|
msg.setStringValue(value);
|
|
341
341
|
break;
|
|
342
342
|
case 4:
|
|
@@ -700,7 +700,7 @@ valuesList: jspb.Message.toObjectList(msg.getValuesList(),
|
|
|
700
700
|
|
|
701
701
|
/**
|
|
702
702
|
* Deserializes binary data (in protobuf wire format).
|
|
703
|
-
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
|
703
|
+
* @param {jspb.binary.bytesource.ByteSource} bytes The bytes to deserialize.
|
|
704
704
|
* @return {!proto.google.protobuf.ListValue}
|
|
705
705
|
*/
|
|
706
706
|
proto.google.protobuf.ListValue.deserializeBinary = function(bytes) {
|
|
@@ -2091,6 +2091,22 @@ export class VoiceActivityDetection extends jspb.Message {
|
|
|
2091
2091
|
hasPyannote(): boolean;
|
|
2092
2092
|
clearPyannote(): VoiceActivityDetection;
|
|
2093
2093
|
|
|
2094
|
+
getSilero(): Silero | undefined;
|
|
2095
|
+
setSilero(value?: Silero): VoiceActivityDetection;
|
|
2096
|
+
hasSilero(): boolean;
|
|
2097
|
+
clearSilero(): VoiceActivityDetection;
|
|
2098
|
+
|
|
2099
|
+
getWespeakerTsd(): WespeakerTsd | undefined;
|
|
2100
|
+
setWespeakerTsd(value?: WespeakerTsd): VoiceActivityDetection;
|
|
2101
|
+
hasWespeakerTsd(): boolean;
|
|
2102
|
+
clearWespeakerTsd(): VoiceActivityDetection;
|
|
2103
|
+
|
|
2104
|
+
getVadMethod(): VadMethod;
|
|
2105
|
+
setVadMethod(value: VadMethod): VoiceActivityDetection;
|
|
2106
|
+
|
|
2107
|
+
getTsdMethod(): TsdMethod;
|
|
2108
|
+
setTsdMethod(value: TsdMethod): VoiceActivityDetection;
|
|
2109
|
+
|
|
2094
2110
|
serializeBinary(): Uint8Array;
|
|
2095
2111
|
toObject(includeInstance?: boolean): VoiceActivityDetection.AsObject;
|
|
2096
2112
|
static toObject(includeInstance: boolean, msg: VoiceActivityDetection): VoiceActivityDetection.AsObject;
|
|
@@ -2104,6 +2120,10 @@ export namespace VoiceActivityDetection {
|
|
|
2104
2120
|
active: string,
|
|
2105
2121
|
samplingRate: number,
|
|
2106
2122
|
pyannote?: Pyannote.AsObject,
|
|
2123
|
+
silero?: Silero.AsObject,
|
|
2124
|
+
wespeakerTsd?: WespeakerTsd.AsObject,
|
|
2125
|
+
vadMethod: VadMethod,
|
|
2126
|
+
tsdMethod: TsdMethod,
|
|
2107
2127
|
}
|
|
2108
2128
|
}
|
|
2109
2129
|
|
|
@@ -2145,6 +2165,136 @@ export namespace Pyannote {
|
|
|
2145
2165
|
}
|
|
2146
2166
|
}
|
|
2147
2167
|
|
|
2168
|
+
export class Silero extends jspb.Message {
|
|
2169
|
+
getModelName(): string;
|
|
2170
|
+
setModelName(value: string): Silero;
|
|
2171
|
+
|
|
2172
|
+
getMinAudioSize(): number;
|
|
2173
|
+
setMinAudioSize(value: number): Silero;
|
|
2174
|
+
|
|
2175
|
+
getThreshold(): number;
|
|
2176
|
+
setThreshold(value: number): Silero;
|
|
2177
|
+
hasThreshold(): boolean;
|
|
2178
|
+
clearThreshold(): Silero;
|
|
2179
|
+
|
|
2180
|
+
getMinSpeechDurationMs(): number;
|
|
2181
|
+
setMinSpeechDurationMs(value: number): Silero;
|
|
2182
|
+
hasMinSpeechDurationMs(): boolean;
|
|
2183
|
+
clearMinSpeechDurationMs(): Silero;
|
|
2184
|
+
|
|
2185
|
+
getMinSilenceDurationMs(): number;
|
|
2186
|
+
setMinSilenceDurationMs(value: number): Silero;
|
|
2187
|
+
hasMinSilenceDurationMs(): boolean;
|
|
2188
|
+
clearMinSilenceDurationMs(): Silero;
|
|
2189
|
+
|
|
2190
|
+
getSpeechPadMs(): number;
|
|
2191
|
+
setSpeechPadMs(value: number): Silero;
|
|
2192
|
+
hasSpeechPadMs(): boolean;
|
|
2193
|
+
clearSpeechPadMs(): Silero;
|
|
2194
|
+
|
|
2195
|
+
getTritonServerHost(): string;
|
|
2196
|
+
setTritonServerHost(value: string): Silero;
|
|
2197
|
+
|
|
2198
|
+
getTritonServerPort(): number;
|
|
2199
|
+
setTritonServerPort(value: number): Silero;
|
|
2200
|
+
|
|
2201
|
+
serializeBinary(): Uint8Array;
|
|
2202
|
+
toObject(includeInstance?: boolean): Silero.AsObject;
|
|
2203
|
+
static toObject(includeInstance: boolean, msg: Silero): Silero.AsObject;
|
|
2204
|
+
static serializeBinaryToWriter(message: Silero, writer: jspb.BinaryWriter): void;
|
|
2205
|
+
static deserializeBinary(bytes: Uint8Array): Silero;
|
|
2206
|
+
static deserializeBinaryFromReader(message: Silero, reader: jspb.BinaryReader): Silero;
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
export namespace Silero {
|
|
2210
|
+
export type AsObject = {
|
|
2211
|
+
modelName: string,
|
|
2212
|
+
minAudioSize: number,
|
|
2213
|
+
threshold?: number,
|
|
2214
|
+
minSpeechDurationMs?: number,
|
|
2215
|
+
minSilenceDurationMs?: number,
|
|
2216
|
+
speechPadMs?: number,
|
|
2217
|
+
tritonServerHost: string,
|
|
2218
|
+
tritonServerPort: number,
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
export enum ThresholdCase {
|
|
2222
|
+
_THRESHOLD_NOT_SET = 0,
|
|
2223
|
+
THRESHOLD = 3,
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
export enum MinSpeechDurationMsCase {
|
|
2227
|
+
_MIN_SPEECH_DURATION_MS_NOT_SET = 0,
|
|
2228
|
+
MIN_SPEECH_DURATION_MS = 4,
|
|
2229
|
+
}
|
|
2230
|
+
|
|
2231
|
+
export enum MinSilenceDurationMsCase {
|
|
2232
|
+
_MIN_SILENCE_DURATION_MS_NOT_SET = 0,
|
|
2233
|
+
MIN_SILENCE_DURATION_MS = 5,
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
export enum SpeechPadMsCase {
|
|
2237
|
+
_SPEECH_PAD_MS_NOT_SET = 0,
|
|
2238
|
+
SPEECH_PAD_MS = 6,
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
export class WespeakerTsd extends jspb.Message {
|
|
2243
|
+
getActive(): boolean;
|
|
2244
|
+
setActive(value: boolean): WespeakerTsd;
|
|
2245
|
+
|
|
2246
|
+
getModelName(): string;
|
|
2247
|
+
setModelName(value: string): WespeakerTsd;
|
|
2248
|
+
|
|
2249
|
+
getTritonServerHost(): string;
|
|
2250
|
+
setTritonServerHost(value: string): WespeakerTsd;
|
|
2251
|
+
|
|
2252
|
+
getTritonServerPort(): number;
|
|
2253
|
+
setTritonServerPort(value: number): WespeakerTsd;
|
|
2254
|
+
|
|
2255
|
+
getSimilarityThreshold(): number;
|
|
2256
|
+
setSimilarityThreshold(value: number): WespeakerTsd;
|
|
2257
|
+
hasSimilarityThreshold(): boolean;
|
|
2258
|
+
clearSimilarityThreshold(): WespeakerTsd;
|
|
2259
|
+
|
|
2260
|
+
getMinAudioLength(): number;
|
|
2261
|
+
setMinAudioLength(value: number): WespeakerTsd;
|
|
2262
|
+
hasMinAudioLength(): boolean;
|
|
2263
|
+
clearMinAudioLength(): WespeakerTsd;
|
|
2264
|
+
|
|
2265
|
+
getReferenceMaxLength(): number;
|
|
2266
|
+
setReferenceMaxLength(value: number): WespeakerTsd;
|
|
2267
|
+
|
|
2268
|
+
serializeBinary(): Uint8Array;
|
|
2269
|
+
toObject(includeInstance?: boolean): WespeakerTsd.AsObject;
|
|
2270
|
+
static toObject(includeInstance: boolean, msg: WespeakerTsd): WespeakerTsd.AsObject;
|
|
2271
|
+
static serializeBinaryToWriter(message: WespeakerTsd, writer: jspb.BinaryWriter): void;
|
|
2272
|
+
static deserializeBinary(bytes: Uint8Array): WespeakerTsd;
|
|
2273
|
+
static deserializeBinaryFromReader(message: WespeakerTsd, reader: jspb.BinaryReader): WespeakerTsd;
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
export namespace WespeakerTsd {
|
|
2277
|
+
export type AsObject = {
|
|
2278
|
+
active: boolean,
|
|
2279
|
+
modelName: string,
|
|
2280
|
+
tritonServerHost: string,
|
|
2281
|
+
tritonServerPort: number,
|
|
2282
|
+
similarityThreshold?: number,
|
|
2283
|
+
minAudioLength?: number,
|
|
2284
|
+
referenceMaxLength: number,
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
export enum SimilarityThresholdCase {
|
|
2288
|
+
_SIMILARITY_THRESHOLD_NOT_SET = 0,
|
|
2289
|
+
SIMILARITY_THRESHOLD = 5,
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
export enum MinAudioLengthCase {
|
|
2293
|
+
_MIN_AUDIO_LENGTH_NOT_SET = 0,
|
|
2294
|
+
MIN_AUDIO_LENGTH = 6,
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2148
2298
|
export class PostProcessing extends jspb.Message {
|
|
2149
2299
|
getPipelineList(): Array<string>;
|
|
2150
2300
|
setPipelineList(value: Array<string>): PostProcessing;
|
|
@@ -2964,3 +3114,14 @@ export enum ReasoningEffort {
|
|
|
2964
3114
|
REASONING_EFFORT_MEDIUM = 3,
|
|
2965
3115
|
REASONING_EFFORT_HIGH = 4,
|
|
2966
3116
|
}
|
|
3117
|
+
export enum VadMethod {
|
|
3118
|
+
VAD_METHOD_UNSPECIFIED = 0,
|
|
3119
|
+
VAD_METHOD_PYANNOTE = 1,
|
|
3120
|
+
VAD_METHOD_SILERO = 2,
|
|
3121
|
+
}
|
|
3122
|
+
export enum TsdMethod {
|
|
3123
|
+
TSD_METHOD_UNSPECIFIED = 0,
|
|
3124
|
+
TSD_METHOD_NONE = 1,
|
|
3125
|
+
TSD_METHOD_PYANNOTE = 2,
|
|
3126
|
+
TSD_METHOD_WESPEAKER = 3,
|
|
3127
|
+
}
|