@volley/recognition-client-sdk 0.1.670 → 0.1.707
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 +59 -2
- package/dist/config-builder.d.ts +14 -1
- package/dist/config-builder.d.ts.map +1 -1
- package/dist/index.bundled.d.ts +118 -48
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +66 -4
- package/dist/index.js.map +3 -3
- package/dist/recog-client-sdk.browser.js +43 -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/dist/utils/url-builder.d.ts +4 -0
- package/dist/utils/url-builder.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/config-builder.ts +26 -0
- package/src/index.ts +1 -0
- package/src/recognition-client.ts +7 -1
- package/src/recognition-client.types.ts +10 -0
- package/src/utils/message-handler.ts +7 -1
- package/src/utils/url-builder.ts +14 -0
|
@@ -3746,6 +3746,7 @@ var RecognitionProvider;
|
|
|
3746
3746
|
RecognitionProvider2["MISTRAL_VOXTRAL"] = "mistral-voxtral";
|
|
3747
3747
|
RecognitionProvider2["CARTESIA"] = "cartesia";
|
|
3748
3748
|
RecognitionProvider2["DASHSCOPE"] = "dashscope";
|
|
3749
|
+
RecognitionProvider2["BEDROCK"] = "bedrock";
|
|
3749
3750
|
RecognitionProvider2["TEST_ASR_PROVIDER_QUOTA"] = "test-asr-provider-quota";
|
|
3750
3751
|
RecognitionProvider2["TEST_ASR_STREAMING"] = "test-asr-streaming";
|
|
3751
3752
|
})(RecognitionProvider || (RecognitionProvider = {}));
|
|
@@ -3813,6 +3814,11 @@ var DashScopeModel;
|
|
|
3813
3814
|
DashScopeModel2["QWEN3_ASR_FLASH_REALTIME_2602"] = "qwen3-asr-flash-realtime-2026-02-10";
|
|
3814
3815
|
DashScopeModel2["QWEN3_ASR_FLASH_REALTIME"] = "qwen3-asr-flash-realtime";
|
|
3815
3816
|
})(DashScopeModel || (DashScopeModel = {}));
|
|
3817
|
+
var BedrockModel;
|
|
3818
|
+
(function(BedrockModel2) {
|
|
3819
|
+
BedrockModel2["VOXTRAL_MINI_3B_2507"] = "mistral.voxtral-mini-3b-2507";
|
|
3820
|
+
BedrockModel2["VOXTRAL_SMALL_24B_2507"] = "mistral.voxtral-small-24b-2507";
|
|
3821
|
+
})(BedrockModel || (BedrockModel = {}));
|
|
3816
3822
|
var SelfServeVllmModel;
|
|
3817
3823
|
(function(SelfServeVllmModel2) {
|
|
3818
3824
|
SelfServeVllmModel2["QWEN3_ASR_1_7B"] = "qwen3-asr-1.7b";
|
|
@@ -3827,6 +3833,7 @@ var RecognitionResultTypeV1;
|
|
|
3827
3833
|
RecognitionResultTypeV12["ERROR"] = "Error";
|
|
3828
3834
|
RecognitionResultTypeV12["CLIENT_CONTROL_MESSAGE"] = "ClientControlMessage";
|
|
3829
3835
|
RecognitionResultTypeV12["AUDIO_METRICS"] = "AudioMetrics";
|
|
3836
|
+
RecognitionResultTypeV12["SESSION_CONFIGURED"] = "SessionConfigured";
|
|
3830
3837
|
})(RecognitionResultTypeV1 || (RecognitionResultTypeV1 = {}));
|
|
3831
3838
|
var TranscriptionResultSchemaV1 = z.object({
|
|
3832
3839
|
type: z.literal(RecognitionResultTypeV1.TRANSCRIPTION),
|
|
@@ -3948,6 +3955,22 @@ var ClientControlMessageSchemaV1 = z.object({
|
|
|
3948
3955
|
action: ClientControlActionsV1
|
|
3949
3956
|
// The control action to perform
|
|
3950
3957
|
});
|
|
3958
|
+
var SessionConfiguredSchemaV1 = z.object({
|
|
3959
|
+
type: z.literal(RecognitionResultTypeV1.SESSION_CONFIGURED),
|
|
3960
|
+
audioUtteranceId: z.string(),
|
|
3961
|
+
// Provider identification
|
|
3962
|
+
provider: z.string().optional(),
|
|
3963
|
+
model: z.string().optional(),
|
|
3964
|
+
sampleRate: z.number().optional(),
|
|
3965
|
+
encoding: z.string().optional(),
|
|
3966
|
+
apiType: z.nativeEnum(ASRApiType).optional(),
|
|
3967
|
+
isFallback: z.boolean().optional(),
|
|
3968
|
+
// Original ASR request as JSON string (includes prefixMode, prefixId, etc.)
|
|
3969
|
+
asrRequest: z.string().optional(),
|
|
3970
|
+
// Provider-specific config as JSON string (raw config sent to provider API, e.g. Deepgram's punctuate/endpointing)
|
|
3971
|
+
providerConfig: z.string().optional()
|
|
3972
|
+
// Stringified JSON of provider-specific config
|
|
3973
|
+
});
|
|
3951
3974
|
var AudioMetricsResultSchemaV1 = z.object({
|
|
3952
3975
|
type: z.literal(RecognitionResultTypeV1.AUDIO_METRICS),
|
|
3953
3976
|
valid: z.boolean(),
|
|
@@ -3971,7 +3994,8 @@ var RecognitionResultSchemaV1 = z.discriminatedUnion("type", [
|
|
|
3971
3994
|
ErrorResultSchemaV1,
|
|
3972
3995
|
// P1 - P2
|
|
3973
3996
|
FunctionCallResultSchemaV1,
|
|
3974
|
-
ClientControlMessageSchemaV1
|
|
3997
|
+
ClientControlMessageSchemaV1,
|
|
3998
|
+
SessionConfiguredSchemaV1
|
|
3975
3999
|
]);
|
|
3976
4000
|
|
|
3977
4001
|
// ../../libs/types/dist/provider-transcription.types.js
|
|
@@ -4414,8 +4438,10 @@ var RecognitionGameInfoSchema = z.object({
|
|
|
4414
4438
|
questionAskedId: z.string().optional(),
|
|
4415
4439
|
/** @deprecated Use questionAskedId instead. Kept for backward compatibility during migration. */
|
|
4416
4440
|
questionAnswerId: z.string().optional(),
|
|
4417
|
-
platform: z.string().optional()
|
|
4418
|
-
|
|
4441
|
+
platform: z.string().optional(),
|
|
4442
|
+
experimentCohort: z.enum(["treatment", "control"]).optional(),
|
|
4443
|
+
experimentMajorVersion: z.number().int().optional()
|
|
4444
|
+
// Explicit major version for ASR config selection (e.g. 1, 3)
|
|
4419
4445
|
});
|
|
4420
4446
|
var RecognitionQueryMetadataSchema = z.object({
|
|
4421
4447
|
audioUtteranceId: z.string(),
|
|
@@ -5042,6 +5068,12 @@ function buildWebSocketUrl(config) {
|
|
|
5042
5068
|
if (config.gameContext?.gamePhase) {
|
|
5043
5069
|
url.searchParams.set("gamePhase", config.gameContext.gamePhase);
|
|
5044
5070
|
}
|
|
5071
|
+
if (config.experimentCohort) {
|
|
5072
|
+
url.searchParams.set("experimentCohort", config.experimentCohort);
|
|
5073
|
+
}
|
|
5074
|
+
if (config.experimentMajorVersion !== void 0) {
|
|
5075
|
+
url.searchParams.set("experimentMajorVersion", String(config.experimentMajorVersion));
|
|
5076
|
+
}
|
|
5045
5077
|
return url.toString();
|
|
5046
5078
|
}
|
|
5047
5079
|
|
|
@@ -5224,6 +5256,9 @@ var MessageHandler = class {
|
|
|
5224
5256
|
case RecognitionResultTypeV1.CLIENT_CONTROL_MESSAGE:
|
|
5225
5257
|
this.callbacks.onControlMessage(msgData);
|
|
5226
5258
|
break;
|
|
5259
|
+
case RecognitionResultTypeV1.SESSION_CONFIGURED:
|
|
5260
|
+
this.callbacks.onSessionConfigured?.(msgData);
|
|
5261
|
+
break;
|
|
5227
5262
|
default:
|
|
5228
5263
|
if (this.callbacks.logger) {
|
|
5229
5264
|
this.callbacks.logger("debug", "[RecogSDK] Unknown message type", { type: msgType });
|
|
@@ -5309,7 +5344,9 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5309
5344
|
...config.questionAnswerId && { questionAnswerId: config.questionAnswerId },
|
|
5310
5345
|
...config.platform && { platform: config.platform },
|
|
5311
5346
|
...config.gameContext && { gameContext: config.gameContext },
|
|
5312
|
-
...config.gameId && { gameId: config.gameId }
|
|
5347
|
+
...config.gameId && { gameId: config.gameId },
|
|
5348
|
+
...config.experimentCohort && { experimentCohort: config.experimentCohort },
|
|
5349
|
+
...config.experimentMajorVersion !== void 0 && { experimentMajorVersion: config.experimentMajorVersion }
|
|
5313
5350
|
});
|
|
5314
5351
|
super({
|
|
5315
5352
|
url,
|
|
@@ -5342,6 +5379,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5342
5379
|
}),
|
|
5343
5380
|
onMetadata: config.onMetadata || (() => {
|
|
5344
5381
|
}),
|
|
5382
|
+
onSessionConfigured: config.onSessionConfigured,
|
|
5345
5383
|
onError: config.onError || (() => {
|
|
5346
5384
|
}),
|
|
5347
5385
|
onConnected: config.onConnected || (() => {
|
|
@@ -5369,6 +5407,7 @@ var RealTimeTwoWayWebSocketRecognitionClient = class _RealTimeTwoWayWebSocketRec
|
|
|
5369
5407
|
onMetadata: this.config.onMetadata,
|
|
5370
5408
|
onError: this.config.onError,
|
|
5371
5409
|
onControlMessage: this.handleControlMessage.bind(this),
|
|
5410
|
+
onSessionConfigured: this.config.onSessionConfigured,
|
|
5372
5411
|
...this.config.logger && { logger: this.config.logger }
|
|
5373
5412
|
});
|
|
5374
5413
|
}
|