@volley/recognition-client-sdk 0.1.707 → 0.1.767
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/dist/browser.bundled.d.ts +90 -1
- package/dist/config-builder.d.ts +6 -1
- package/dist/config-builder.d.ts.map +1 -1
- package/dist/index.bundled.d.ts +145 -48
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -4
- package/dist/index.js.map +3 -3
- package/dist/recog-client-sdk.browser.js +30 -4
- package/dist/recog-client-sdk.browser.js.map +3 -3
- package/dist/recognition-client.d.ts.map +1 -1
- package/dist/recognition-client.types.d.ts +7 -1
- package/dist/recognition-client.types.d.ts.map +1 -1
- package/dist/utils/message-handler.d.ts +2 -1
- package/dist/utils/message-handler.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/config-builder.ts +11 -0
- package/src/index.ts +2 -0
- package/src/recognition-client.ts +9 -0
- package/src/recognition-client.types.ts +9 -0
- package/src/utils/message-handler.ts +14 -3
- package/src/utils/url-builder.spec.ts +43 -0
|
@@ -3747,6 +3747,8 @@ var RecognitionProvider;
|
|
|
3747
3747
|
RecognitionProvider2["CARTESIA"] = "cartesia";
|
|
3748
3748
|
RecognitionProvider2["DASHSCOPE"] = "dashscope";
|
|
3749
3749
|
RecognitionProvider2["BEDROCK"] = "bedrock";
|
|
3750
|
+
RecognitionProvider2["INWORLD_STT"] = "inworld-stt";
|
|
3751
|
+
RecognitionProvider2["AWS_TRANSCRIBE"] = "aws-transcribe";
|
|
3750
3752
|
RecognitionProvider2["TEST_ASR_PROVIDER_QUOTA"] = "test-asr-provider-quota";
|
|
3751
3753
|
RecognitionProvider2["TEST_ASR_STREAMING"] = "test-asr-streaming";
|
|
3752
3754
|
})(RecognitionProvider || (RecognitionProvider = {}));
|
|
@@ -3819,6 +3821,14 @@ var BedrockModel;
|
|
|
3819
3821
|
BedrockModel2["VOXTRAL_MINI_3B_2507"] = "mistral.voxtral-mini-3b-2507";
|
|
3820
3822
|
BedrockModel2["VOXTRAL_SMALL_24B_2507"] = "mistral.voxtral-small-24b-2507";
|
|
3821
3823
|
})(BedrockModel || (BedrockModel = {}));
|
|
3824
|
+
var InworldSttModel;
|
|
3825
|
+
(function(InworldSttModel2) {
|
|
3826
|
+
InworldSttModel2["INWORLD_STT_1"] = "inworld/inworld-stt-1";
|
|
3827
|
+
})(InworldSttModel || (InworldSttModel = {}));
|
|
3828
|
+
var AwsTranscribeModel;
|
|
3829
|
+
(function(AwsTranscribeModel2) {
|
|
3830
|
+
AwsTranscribeModel2["DEFAULT"] = "default";
|
|
3831
|
+
})(AwsTranscribeModel || (AwsTranscribeModel = {}));
|
|
3822
3832
|
var SelfServeVllmModel;
|
|
3823
3833
|
(function(SelfServeVllmModel2) {
|
|
3824
3834
|
SelfServeVllmModel2["QWEN3_ASR_1_7B"] = "qwen3-asr-1.7b";
|
|
@@ -3944,9 +3954,9 @@ var ErrorResultSchemaV1 = z.object({
|
|
|
3944
3954
|
// Detailed description
|
|
3945
3955
|
});
|
|
3946
3956
|
var ClientControlActionV1;
|
|
3947
|
-
(function(
|
|
3948
|
-
|
|
3949
|
-
|
|
3957
|
+
(function(ClientControlActionV12) {
|
|
3958
|
+
ClientControlActionV12["READY_FOR_UPLOADING_RECORDING"] = "ready_for_uploading_recording";
|
|
3959
|
+
ClientControlActionV12["STOP_RECORDING"] = "stop_recording";
|
|
3950
3960
|
})(ClientControlActionV1 || (ClientControlActionV1 = {}));
|
|
3951
3961
|
var ClientControlActionsV1 = z.nativeEnum(ClientControlActionV1);
|
|
3952
3962
|
var ClientControlMessageSchemaV1 = z.object({
|
|
@@ -3979,6 +3989,8 @@ var AudioMetricsResultSchemaV1 = z.object({
|
|
|
3979
3989
|
maxVolume: z.number(),
|
|
3980
3990
|
minVolume: z.number(),
|
|
3981
3991
|
avgVolume: z.number(),
|
|
3992
|
+
peakVolumeDb: z.number().nullable(),
|
|
3993
|
+
avgVolumeDb: z.number().nullable(),
|
|
3982
3994
|
silenceRatio: z.number(),
|
|
3983
3995
|
clippingRatio: z.number(),
|
|
3984
3996
|
snrEstimate: z.number().nullable(),
|
|
@@ -3995,7 +4007,8 @@ var RecognitionResultSchemaV1 = z.discriminatedUnion("type", [
|
|
|
3995
4007
|
// P1 - P2
|
|
3996
4008
|
FunctionCallResultSchemaV1,
|
|
3997
4009
|
ClientControlMessageSchemaV1,
|
|
3998
|
-
SessionConfiguredSchemaV1
|
|
4010
|
+
SessionConfiguredSchemaV1,
|
|
4011
|
+
AudioMetricsResultSchemaV1
|
|
3999
4012
|
]);
|
|
4000
4013
|
|
|
4001
4014
|
// ../../libs/types/dist/provider-transcription.types.js
|
|
@@ -4418,6 +4431,9 @@ var ASRRequestSchemaV1 = z.object({
|
|
|
4418
4431
|
prefixMode: z.nativeEnum(PrefixMode).optional().default(PrefixMode.NONE),
|
|
4419
4432
|
prefixId: z.string().optional(),
|
|
4420
4433
|
prefixTextToRemove: z.array(z.string()).optional(),
|
|
4434
|
+
// Streaming audio metrics opt-in: when > 0, server emits AudioMetrics results throttled to this interval (ms).
|
|
4435
|
+
// Undefined / 0 disables streaming audio metrics (final metrics still embedded in Metadata).
|
|
4436
|
+
audioMetricsIntervalMs: z.number().optional(),
|
|
4421
4437
|
// Debug options (FOR DEBUG/TESTING ONLY - not for production use)
|
|
4422
4438
|
debugCommand: RequestDebugCommandSchema
|
|
4423
4439
|
});
|
|
@@ -5221,6 +5237,7 @@ var MessageHandler = class {
|
|
|
5221
5237
|
/**
|
|
5222
5238
|
* Handle incoming WebSocket message
|
|
5223
5239
|
*/
|
|
5240
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5224
5241
|
handleMessage(msg) {
|
|
5225
5242
|
if (this.callbacks.logger) {
|
|
5226
5243
|
this.callbacks.logger("debug", "[RecogSDK] Received WebSocket message", {
|
|
@@ -5259,6 +5276,9 @@ var MessageHandler = class {
|
|
|
5259
5276
|
case RecognitionResultTypeV1.SESSION_CONFIGURED:
|
|
5260
5277
|
this.callbacks.onSessionConfigured?.(msgData);
|
|
5261
5278
|
break;
|
|
5279
|
+
case RecognitionResultTypeV1.AUDIO_METRICS:
|
|
5280
|
+
this.callbacks.onAudioMetrics?.(msgData);
|
|
5281
|
+
break;
|
|
5262
5282
|
default:
|
|
5263
5283
|
if (this.callbacks.logger) {
|
|
5264
5284
|
this.callbacks.logger("debug", "[RecogSDK] Unknown message type", { type: msgType });
|
|
@@ -5380,6 +5400,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5380
5400
|
onMetadata: config.onMetadata || (() => {
|
|
5381
5401
|
}),
|
|
5382
5402
|
onSessionConfigured: config.onSessionConfigured,
|
|
5403
|
+
onAudioMetrics: config.onAudioMetrics,
|
|
5383
5404
|
onError: config.onError || (() => {
|
|
5384
5405
|
}),
|
|
5385
5406
|
onConnected: config.onConnected || (() => {
|
|
@@ -5408,6 +5429,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5408
5429
|
onError: this.config.onError,
|
|
5409
5430
|
onControlMessage: this.handleControlMessage.bind(this),
|
|
5410
5431
|
onSessionConfigured: this.config.onSessionConfigured,
|
|
5432
|
+
onAudioMetrics: this.config.onAudioMetrics,
|
|
5411
5433
|
...this.config.logger && { logger: this.config.logger }
|
|
5412
5434
|
});
|
|
5413
5435
|
}
|
|
@@ -5733,6 +5755,10 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5733
5755
|
// Include prefix text to remove if provided (for server-side prefix text removal)
|
|
5734
5756
|
...this.config.asrRequestConfig.prefixTextToRemove && {
|
|
5735
5757
|
prefixTextToRemove: this.config.asrRequestConfig.prefixTextToRemove
|
|
5758
|
+
},
|
|
5759
|
+
// Streaming audio metrics opt-in (ms interval). Server only forwards metrics if > 0.
|
|
5760
|
+
...this.config.asrRequestConfig.audioMetricsIntervalMs !== void 0 && {
|
|
5761
|
+
audioMetricsIntervalMs: this.config.asrRequestConfig.audioMetricsIntervalMs
|
|
5736
5762
|
}
|
|
5737
5763
|
};
|
|
5738
5764
|
super.sendMessage(
|