@volley/recognition-client-sdk 0.1.384 → 0.1.417
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 +23 -1
- package/dist/config-builder.d.ts +5 -0
- package/dist/config-builder.d.ts.map +1 -1
- package/dist/index.bundled.d.ts +108 -79
- package/dist/index.js +122 -46
- package/dist/index.js.map +4 -4
- package/dist/recog-client-sdk.browser.js +62 -23
- package/dist/recog-client-sdk.browser.js.map +4 -4
- package/dist/recognition-client.d.ts.map +1 -1
- package/dist/recognition-client.types.d.ts +6 -0
- package/dist/recognition-client.types.d.ts.map +1 -1
- package/dist/simplified-vgf-recognition-client.d.ts +2 -0
- package/dist/simplified-vgf-recognition-client.d.ts.map +1 -1
- package/dist/utils/url-builder.d.ts +2 -0
- package/dist/utils/url-builder.d.ts.map +1 -1
- package/dist/vgf-recognition-mapper.d.ts +1 -5
- package/dist/vgf-recognition-mapper.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/config-builder.ts +9 -0
- package/src/recognition-client.ts +3 -2
- package/src/recognition-client.types.ts +7 -0
- package/src/simplified-vgf-recognition-client.integration.spec.ts +704 -0
- package/src/simplified-vgf-recognition-client.spec.ts +199 -13
- package/src/simplified-vgf-recognition-client.ts +70 -22
- package/src/utils/audio-ring-buffer.ts +2 -2
- package/src/utils/message-handler.ts +4 -4
- package/src/utils/url-builder.ts +10 -3
- package/src/vgf-recognition-mapper.ts +1 -23
package/dist/index.bundled.d.ts
CHANGED
|
@@ -218,7 +218,8 @@ declare enum RecognitionResultTypeV1 {
|
|
|
218
218
|
FUNCTION_CALL = "FunctionCall",
|
|
219
219
|
METADATA = "Metadata",
|
|
220
220
|
ERROR = "Error",
|
|
221
|
-
CLIENT_CONTROL_MESSAGE = "ClientControlMessage"
|
|
221
|
+
CLIENT_CONTROL_MESSAGE = "ClientControlMessage",
|
|
222
|
+
AUDIO_METRICS = "AudioMetrics"
|
|
222
223
|
}
|
|
223
224
|
/**
|
|
224
225
|
* Transcription result V1 - contains transcript message
|
|
@@ -293,6 +294,18 @@ declare const FunctionCallResultSchemaV1: z.ZodObject<{
|
|
|
293
294
|
functionArgJson: string;
|
|
294
295
|
}>;
|
|
295
296
|
type FunctionCallResultV1 = z.infer<typeof FunctionCallResultSchemaV1>;
|
|
297
|
+
/**
|
|
298
|
+
* Transcript outcome type - categorizes final transcript state
|
|
299
|
+
* Used in Metadata schema. Maps 1:1 with Datadog metrics:
|
|
300
|
+
* - WITH_CONTENT → recog.client.websocket.transcript.final_with_content
|
|
301
|
+
* - EMPTY → recog.client.websocket.transcript.final_empty
|
|
302
|
+
* - NEVER_SENT → derived from sessions.streamed - final_with_content - final_empty
|
|
303
|
+
*/
|
|
304
|
+
declare enum TranscriptOutcomeType {
|
|
305
|
+
WITH_CONTENT = "with_content",
|
|
306
|
+
EMPTY = "empty",
|
|
307
|
+
NEVER_SENT = "never_sent"
|
|
308
|
+
}
|
|
296
309
|
/**
|
|
297
310
|
* Metadata result V1 - contains metadata, timing information, and ASR config
|
|
298
311
|
* Sent when the provider connection closes to provide final timing metrics and config
|
|
@@ -312,6 +325,7 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
|
|
|
312
325
|
apiType: z.ZodOptional<z.ZodNativeEnum<typeof ASRApiType>>;
|
|
313
326
|
asrConfig: z.ZodOptional<z.ZodString>;
|
|
314
327
|
rawAsrMetadata: z.ZodOptional<z.ZodString>;
|
|
328
|
+
transcriptOutcome: z.ZodOptional<z.ZodNativeEnum<typeof TranscriptOutcomeType>>;
|
|
315
329
|
}, "strip", z.ZodTypeAny, {
|
|
316
330
|
type: RecognitionResultTypeV1.METADATA;
|
|
317
331
|
audioUtteranceId: string;
|
|
@@ -326,6 +340,7 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
|
|
|
326
340
|
apiType?: ASRApiType | undefined;
|
|
327
341
|
asrConfig?: string | undefined;
|
|
328
342
|
rawAsrMetadata?: string | undefined;
|
|
343
|
+
transcriptOutcome?: TranscriptOutcomeType | undefined;
|
|
329
344
|
}, {
|
|
330
345
|
type: RecognitionResultTypeV1.METADATA;
|
|
331
346
|
audioUtteranceId: string;
|
|
@@ -340,6 +355,7 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
|
|
|
340
355
|
apiType?: ASRApiType | undefined;
|
|
341
356
|
asrConfig?: string | undefined;
|
|
342
357
|
rawAsrMetadata?: string | undefined;
|
|
358
|
+
transcriptOutcome?: TranscriptOutcomeType | undefined;
|
|
343
359
|
}>;
|
|
344
360
|
type MetadataResultV1 = z.infer<typeof MetadataResultSchemaV1>;
|
|
345
361
|
/**
|
|
@@ -405,11 +421,11 @@ declare enum ClientControlActionV1 {
|
|
|
405
421
|
* These are system configuration issues, not user-facing
|
|
406
422
|
*/
|
|
407
423
|
declare const AuthenticationExceptionSchema: z.ZodObject<{
|
|
408
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
409
424
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
410
425
|
message: z.ZodString;
|
|
411
|
-
|
|
426
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
412
427
|
description: z.ZodOptional<z.ZodString>;
|
|
428
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
413
429
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
414
430
|
errorType: z.ZodLiteral<ErrorTypeV1.AUTHENTICATION_ERROR>;
|
|
415
431
|
isImmediatelyAvailable: z.ZodLiteral<false>;
|
|
@@ -419,10 +435,10 @@ declare const AuthenticationExceptionSchema: z.ZodObject<{
|
|
|
419
435
|
message: string;
|
|
420
436
|
errorType: ErrorTypeV1.AUTHENTICATION_ERROR;
|
|
421
437
|
isImmediatelyAvailable: false;
|
|
422
|
-
provider?: RecognitionProvider | undefined;
|
|
423
438
|
code?: string | number | undefined;
|
|
424
|
-
|
|
439
|
+
provider?: RecognitionProvider | undefined;
|
|
425
440
|
description?: string | undefined;
|
|
441
|
+
audioUtteranceId?: string | undefined;
|
|
426
442
|
timestamp?: number | undefined;
|
|
427
443
|
service?: string | undefined;
|
|
428
444
|
authMethod?: string | undefined;
|
|
@@ -430,10 +446,10 @@ declare const AuthenticationExceptionSchema: z.ZodObject<{
|
|
|
430
446
|
message: string;
|
|
431
447
|
errorType: ErrorTypeV1.AUTHENTICATION_ERROR;
|
|
432
448
|
isImmediatelyAvailable: false;
|
|
433
|
-
provider?: RecognitionProvider | undefined;
|
|
434
449
|
code?: string | number | undefined;
|
|
435
|
-
|
|
450
|
+
provider?: RecognitionProvider | undefined;
|
|
436
451
|
description?: string | undefined;
|
|
452
|
+
audioUtteranceId?: string | undefined;
|
|
437
453
|
timestamp?: number | undefined;
|
|
438
454
|
service?: string | undefined;
|
|
439
455
|
authMethod?: string | undefined;
|
|
@@ -445,11 +461,11 @@ type AuthenticationException = z.infer<typeof AuthenticationExceptionSchema>;
|
|
|
445
461
|
* User provided invalid input - can show them what's wrong
|
|
446
462
|
*/
|
|
447
463
|
declare const ValidationExceptionSchema: z.ZodObject<{
|
|
448
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
449
464
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
450
465
|
message: z.ZodString;
|
|
451
|
-
|
|
466
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
452
467
|
description: z.ZodOptional<z.ZodString>;
|
|
468
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
453
469
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
454
470
|
errorType: z.ZodLiteral<ErrorTypeV1.VALIDATION_ERROR>;
|
|
455
471
|
isImmediatelyAvailable: z.ZodLiteral<true>;
|
|
@@ -460,10 +476,10 @@ declare const ValidationExceptionSchema: z.ZodObject<{
|
|
|
460
476
|
message: string;
|
|
461
477
|
errorType: ErrorTypeV1.VALIDATION_ERROR;
|
|
462
478
|
isImmediatelyAvailable: true;
|
|
463
|
-
provider?: RecognitionProvider | undefined;
|
|
464
479
|
code?: string | number | undefined;
|
|
465
|
-
|
|
480
|
+
provider?: RecognitionProvider | undefined;
|
|
466
481
|
description?: string | undefined;
|
|
482
|
+
audioUtteranceId?: string | undefined;
|
|
467
483
|
timestamp?: number | undefined;
|
|
468
484
|
field?: string | undefined;
|
|
469
485
|
expected?: string | undefined;
|
|
@@ -472,10 +488,10 @@ declare const ValidationExceptionSchema: z.ZodObject<{
|
|
|
472
488
|
message: string;
|
|
473
489
|
errorType: ErrorTypeV1.VALIDATION_ERROR;
|
|
474
490
|
isImmediatelyAvailable: true;
|
|
475
|
-
provider?: RecognitionProvider | undefined;
|
|
476
491
|
code?: string | number | undefined;
|
|
477
|
-
|
|
492
|
+
provider?: RecognitionProvider | undefined;
|
|
478
493
|
description?: string | undefined;
|
|
494
|
+
audioUtteranceId?: string | undefined;
|
|
479
495
|
timestamp?: number | undefined;
|
|
480
496
|
field?: string | undefined;
|
|
481
497
|
expected?: string | undefined;
|
|
@@ -490,8 +506,8 @@ type ValidationException = z.infer<typeof ValidationExceptionSchema>;
|
|
|
490
506
|
declare const ProviderExceptionSchema: z.ZodObject<{
|
|
491
507
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
492
508
|
message: z.ZodString;
|
|
493
|
-
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
494
509
|
description: z.ZodOptional<z.ZodString>;
|
|
510
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
495
511
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
496
512
|
errorType: z.ZodLiteral<ErrorTypeV1.PROVIDER_ERROR>;
|
|
497
513
|
isImmediatelyAvailable: z.ZodLiteral<false>;
|
|
@@ -503,8 +519,8 @@ declare const ProviderExceptionSchema: z.ZodObject<{
|
|
|
503
519
|
errorType: ErrorTypeV1.PROVIDER_ERROR;
|
|
504
520
|
isImmediatelyAvailable: false;
|
|
505
521
|
code?: string | number | undefined;
|
|
506
|
-
audioUtteranceId?: string | undefined;
|
|
507
522
|
description?: string | undefined;
|
|
523
|
+
audioUtteranceId?: string | undefined;
|
|
508
524
|
timestamp?: number | undefined;
|
|
509
525
|
provider?: string | undefined;
|
|
510
526
|
providerErrorCode?: string | number | undefined;
|
|
@@ -514,8 +530,8 @@ declare const ProviderExceptionSchema: z.ZodObject<{
|
|
|
514
530
|
errorType: ErrorTypeV1.PROVIDER_ERROR;
|
|
515
531
|
isImmediatelyAvailable: false;
|
|
516
532
|
code?: string | number | undefined;
|
|
517
|
-
audioUtteranceId?: string | undefined;
|
|
518
533
|
description?: string | undefined;
|
|
534
|
+
audioUtteranceId?: string | undefined;
|
|
519
535
|
timestamp?: number | undefined;
|
|
520
536
|
provider?: string | undefined;
|
|
521
537
|
providerErrorCode?: string | number | undefined;
|
|
@@ -528,11 +544,11 @@ type ProviderException = z.infer<typeof ProviderExceptionSchema>;
|
|
|
528
544
|
* Request took too long - user should try again
|
|
529
545
|
*/
|
|
530
546
|
declare const TimeoutExceptionSchema: z.ZodObject<{
|
|
531
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
532
547
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
533
548
|
message: z.ZodString;
|
|
534
|
-
|
|
549
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
535
550
|
description: z.ZodOptional<z.ZodString>;
|
|
551
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
536
552
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
537
553
|
errorType: z.ZodLiteral<ErrorTypeV1.TIMEOUT_ERROR>;
|
|
538
554
|
isImmediatelyAvailable: z.ZodLiteral<true>;
|
|
@@ -542,10 +558,10 @@ declare const TimeoutExceptionSchema: z.ZodObject<{
|
|
|
542
558
|
message: string;
|
|
543
559
|
errorType: ErrorTypeV1.TIMEOUT_ERROR;
|
|
544
560
|
isImmediatelyAvailable: true;
|
|
545
|
-
provider?: RecognitionProvider | undefined;
|
|
546
561
|
code?: string | number | undefined;
|
|
547
|
-
|
|
562
|
+
provider?: RecognitionProvider | undefined;
|
|
548
563
|
description?: string | undefined;
|
|
564
|
+
audioUtteranceId?: string | undefined;
|
|
549
565
|
timestamp?: number | undefined;
|
|
550
566
|
timeoutMs?: number | undefined;
|
|
551
567
|
operation?: string | undefined;
|
|
@@ -553,10 +569,10 @@ declare const TimeoutExceptionSchema: z.ZodObject<{
|
|
|
553
569
|
message: string;
|
|
554
570
|
errorType: ErrorTypeV1.TIMEOUT_ERROR;
|
|
555
571
|
isImmediatelyAvailable: true;
|
|
556
|
-
provider?: RecognitionProvider | undefined;
|
|
557
572
|
code?: string | number | undefined;
|
|
558
|
-
|
|
573
|
+
provider?: RecognitionProvider | undefined;
|
|
559
574
|
description?: string | undefined;
|
|
575
|
+
audioUtteranceId?: string | undefined;
|
|
560
576
|
timestamp?: number | undefined;
|
|
561
577
|
timeoutMs?: number | undefined;
|
|
562
578
|
operation?: string | undefined;
|
|
@@ -568,11 +584,11 @@ type TimeoutException = z.infer<typeof TimeoutExceptionSchema>;
|
|
|
568
584
|
* Rate limit or quota exceeded - user should wait
|
|
569
585
|
*/
|
|
570
586
|
declare const QuotaExceededExceptionSchema: z.ZodObject<{
|
|
571
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
572
587
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
573
588
|
message: z.ZodString;
|
|
574
|
-
|
|
589
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
575
590
|
description: z.ZodOptional<z.ZodString>;
|
|
591
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
576
592
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
577
593
|
errorType: z.ZodLiteral<ErrorTypeV1.QUOTA_EXCEEDED>;
|
|
578
594
|
isImmediatelyAvailable: z.ZodLiteral<true>;
|
|
@@ -583,10 +599,10 @@ declare const QuotaExceededExceptionSchema: z.ZodObject<{
|
|
|
583
599
|
message: string;
|
|
584
600
|
errorType: ErrorTypeV1.QUOTA_EXCEEDED;
|
|
585
601
|
isImmediatelyAvailable: true;
|
|
586
|
-
provider?: RecognitionProvider | undefined;
|
|
587
602
|
code?: string | number | undefined;
|
|
588
|
-
|
|
603
|
+
provider?: RecognitionProvider | undefined;
|
|
589
604
|
description?: string | undefined;
|
|
605
|
+
audioUtteranceId?: string | undefined;
|
|
590
606
|
timestamp?: number | undefined;
|
|
591
607
|
quotaType?: string | undefined;
|
|
592
608
|
resetAt?: number | undefined;
|
|
@@ -595,10 +611,10 @@ declare const QuotaExceededExceptionSchema: z.ZodObject<{
|
|
|
595
611
|
message: string;
|
|
596
612
|
errorType: ErrorTypeV1.QUOTA_EXCEEDED;
|
|
597
613
|
isImmediatelyAvailable: true;
|
|
598
|
-
provider?: RecognitionProvider | undefined;
|
|
599
614
|
code?: string | number | undefined;
|
|
600
|
-
|
|
615
|
+
provider?: RecognitionProvider | undefined;
|
|
601
616
|
description?: string | undefined;
|
|
617
|
+
audioUtteranceId?: string | undefined;
|
|
602
618
|
timestamp?: number | undefined;
|
|
603
619
|
quotaType?: string | undefined;
|
|
604
620
|
resetAt?: number | undefined;
|
|
@@ -611,11 +627,11 @@ type QuotaExceededException = z.infer<typeof QuotaExceededExceptionSchema>;
|
|
|
611
627
|
* Connection establishment or network failure - user should check network or retry
|
|
612
628
|
*/
|
|
613
629
|
declare const ConnectionExceptionSchema: z.ZodObject<{
|
|
614
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
615
630
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
616
631
|
message: z.ZodString;
|
|
617
|
-
|
|
632
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
618
633
|
description: z.ZodOptional<z.ZodString>;
|
|
634
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
619
635
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
620
636
|
errorType: z.ZodLiteral<ErrorTypeV1.CONNECTION_ERROR>;
|
|
621
637
|
isImmediatelyAvailable: z.ZodLiteral<true>;
|
|
@@ -626,10 +642,10 @@ declare const ConnectionExceptionSchema: z.ZodObject<{
|
|
|
626
642
|
message: string;
|
|
627
643
|
errorType: ErrorTypeV1.CONNECTION_ERROR;
|
|
628
644
|
isImmediatelyAvailable: true;
|
|
629
|
-
provider?: RecognitionProvider | undefined;
|
|
630
645
|
code?: string | number | undefined;
|
|
631
|
-
|
|
646
|
+
provider?: RecognitionProvider | undefined;
|
|
632
647
|
description?: string | undefined;
|
|
648
|
+
audioUtteranceId?: string | undefined;
|
|
633
649
|
timestamp?: number | undefined;
|
|
634
650
|
attempts?: number | undefined;
|
|
635
651
|
url?: string | undefined;
|
|
@@ -638,10 +654,10 @@ declare const ConnectionExceptionSchema: z.ZodObject<{
|
|
|
638
654
|
message: string;
|
|
639
655
|
errorType: ErrorTypeV1.CONNECTION_ERROR;
|
|
640
656
|
isImmediatelyAvailable: true;
|
|
641
|
-
provider?: RecognitionProvider | undefined;
|
|
642
657
|
code?: string | number | undefined;
|
|
643
|
-
|
|
658
|
+
provider?: RecognitionProvider | undefined;
|
|
644
659
|
description?: string | undefined;
|
|
660
|
+
audioUtteranceId?: string | undefined;
|
|
645
661
|
timestamp?: number | undefined;
|
|
646
662
|
attempts?: number | undefined;
|
|
647
663
|
url?: string | undefined;
|
|
@@ -654,11 +670,11 @@ type ConnectionException = z.infer<typeof ConnectionExceptionSchema>;
|
|
|
654
670
|
* Unexpected error - needs investigation
|
|
655
671
|
*/
|
|
656
672
|
declare const UnknownExceptionSchema: z.ZodObject<{
|
|
657
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
658
673
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
659
674
|
message: z.ZodString;
|
|
660
|
-
|
|
675
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
661
676
|
description: z.ZodOptional<z.ZodString>;
|
|
677
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
662
678
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
663
679
|
errorType: z.ZodLiteral<ErrorTypeV1.UNKNOWN_ERROR>;
|
|
664
680
|
isImmediatelyAvailable: z.ZodLiteral<false>;
|
|
@@ -668,10 +684,10 @@ declare const UnknownExceptionSchema: z.ZodObject<{
|
|
|
668
684
|
message: string;
|
|
669
685
|
errorType: ErrorTypeV1.UNKNOWN_ERROR;
|
|
670
686
|
isImmediatelyAvailable: false;
|
|
671
|
-
provider?: RecognitionProvider | undefined;
|
|
672
687
|
code?: string | number | undefined;
|
|
673
|
-
|
|
688
|
+
provider?: RecognitionProvider | undefined;
|
|
674
689
|
description?: string | undefined;
|
|
690
|
+
audioUtteranceId?: string | undefined;
|
|
675
691
|
timestamp?: number | undefined;
|
|
676
692
|
stack?: string | undefined;
|
|
677
693
|
context?: Record<string, unknown> | undefined;
|
|
@@ -679,10 +695,10 @@ declare const UnknownExceptionSchema: z.ZodObject<{
|
|
|
679
695
|
message: string;
|
|
680
696
|
errorType: ErrorTypeV1.UNKNOWN_ERROR;
|
|
681
697
|
isImmediatelyAvailable: false;
|
|
682
|
-
provider?: RecognitionProvider | undefined;
|
|
683
698
|
code?: string | number | undefined;
|
|
684
|
-
|
|
699
|
+
provider?: RecognitionProvider | undefined;
|
|
685
700
|
description?: string | undefined;
|
|
701
|
+
audioUtteranceId?: string | undefined;
|
|
686
702
|
timestamp?: number | undefined;
|
|
687
703
|
stack?: string | undefined;
|
|
688
704
|
context?: Record<string, unknown> | undefined;
|
|
@@ -693,11 +709,11 @@ type UnknownException = z.infer<typeof UnknownExceptionSchema>;
|
|
|
693
709
|
* Use this for type-safe error handling
|
|
694
710
|
*/
|
|
695
711
|
declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [z.ZodObject<{
|
|
696
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
697
712
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
698
713
|
message: z.ZodString;
|
|
699
|
-
|
|
714
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
700
715
|
description: z.ZodOptional<z.ZodString>;
|
|
716
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
701
717
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
702
718
|
errorType: z.ZodLiteral<ErrorTypeV1.AUTHENTICATION_ERROR>;
|
|
703
719
|
isImmediatelyAvailable: z.ZodLiteral<false>;
|
|
@@ -707,10 +723,10 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
707
723
|
message: string;
|
|
708
724
|
errorType: ErrorTypeV1.AUTHENTICATION_ERROR;
|
|
709
725
|
isImmediatelyAvailable: false;
|
|
710
|
-
provider?: RecognitionProvider | undefined;
|
|
711
726
|
code?: string | number | undefined;
|
|
712
|
-
|
|
727
|
+
provider?: RecognitionProvider | undefined;
|
|
713
728
|
description?: string | undefined;
|
|
729
|
+
audioUtteranceId?: string | undefined;
|
|
714
730
|
timestamp?: number | undefined;
|
|
715
731
|
service?: string | undefined;
|
|
716
732
|
authMethod?: string | undefined;
|
|
@@ -718,19 +734,19 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
718
734
|
message: string;
|
|
719
735
|
errorType: ErrorTypeV1.AUTHENTICATION_ERROR;
|
|
720
736
|
isImmediatelyAvailable: false;
|
|
721
|
-
provider?: RecognitionProvider | undefined;
|
|
722
737
|
code?: string | number | undefined;
|
|
723
|
-
|
|
738
|
+
provider?: RecognitionProvider | undefined;
|
|
724
739
|
description?: string | undefined;
|
|
740
|
+
audioUtteranceId?: string | undefined;
|
|
725
741
|
timestamp?: number | undefined;
|
|
726
742
|
service?: string | undefined;
|
|
727
743
|
authMethod?: string | undefined;
|
|
728
744
|
}>, z.ZodObject<{
|
|
729
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
730
745
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
731
746
|
message: z.ZodString;
|
|
732
|
-
|
|
747
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
733
748
|
description: z.ZodOptional<z.ZodString>;
|
|
749
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
734
750
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
735
751
|
errorType: z.ZodLiteral<ErrorTypeV1.VALIDATION_ERROR>;
|
|
736
752
|
isImmediatelyAvailable: z.ZodLiteral<true>;
|
|
@@ -741,10 +757,10 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
741
757
|
message: string;
|
|
742
758
|
errorType: ErrorTypeV1.VALIDATION_ERROR;
|
|
743
759
|
isImmediatelyAvailable: true;
|
|
744
|
-
provider?: RecognitionProvider | undefined;
|
|
745
760
|
code?: string | number | undefined;
|
|
746
|
-
|
|
761
|
+
provider?: RecognitionProvider | undefined;
|
|
747
762
|
description?: string | undefined;
|
|
763
|
+
audioUtteranceId?: string | undefined;
|
|
748
764
|
timestamp?: number | undefined;
|
|
749
765
|
field?: string | undefined;
|
|
750
766
|
expected?: string | undefined;
|
|
@@ -753,10 +769,10 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
753
769
|
message: string;
|
|
754
770
|
errorType: ErrorTypeV1.VALIDATION_ERROR;
|
|
755
771
|
isImmediatelyAvailable: true;
|
|
756
|
-
provider?: RecognitionProvider | undefined;
|
|
757
772
|
code?: string | number | undefined;
|
|
758
|
-
|
|
773
|
+
provider?: RecognitionProvider | undefined;
|
|
759
774
|
description?: string | undefined;
|
|
775
|
+
audioUtteranceId?: string | undefined;
|
|
760
776
|
timestamp?: number | undefined;
|
|
761
777
|
field?: string | undefined;
|
|
762
778
|
expected?: string | undefined;
|
|
@@ -764,8 +780,8 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
764
780
|
}>, z.ZodObject<{
|
|
765
781
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
766
782
|
message: z.ZodString;
|
|
767
|
-
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
768
783
|
description: z.ZodOptional<z.ZodString>;
|
|
784
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
769
785
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
770
786
|
errorType: z.ZodLiteral<ErrorTypeV1.PROVIDER_ERROR>;
|
|
771
787
|
isImmediatelyAvailable: z.ZodLiteral<false>;
|
|
@@ -777,8 +793,8 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
777
793
|
errorType: ErrorTypeV1.PROVIDER_ERROR;
|
|
778
794
|
isImmediatelyAvailable: false;
|
|
779
795
|
code?: string | number | undefined;
|
|
780
|
-
audioUtteranceId?: string | undefined;
|
|
781
796
|
description?: string | undefined;
|
|
797
|
+
audioUtteranceId?: string | undefined;
|
|
782
798
|
timestamp?: number | undefined;
|
|
783
799
|
provider?: string | undefined;
|
|
784
800
|
providerErrorCode?: string | number | undefined;
|
|
@@ -788,18 +804,18 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
788
804
|
errorType: ErrorTypeV1.PROVIDER_ERROR;
|
|
789
805
|
isImmediatelyAvailable: false;
|
|
790
806
|
code?: string | number | undefined;
|
|
791
|
-
audioUtteranceId?: string | undefined;
|
|
792
807
|
description?: string | undefined;
|
|
808
|
+
audioUtteranceId?: string | undefined;
|
|
793
809
|
timestamp?: number | undefined;
|
|
794
810
|
provider?: string | undefined;
|
|
795
811
|
providerErrorCode?: string | number | undefined;
|
|
796
812
|
isTransient?: boolean | undefined;
|
|
797
813
|
}>, z.ZodObject<{
|
|
798
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
799
814
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
800
815
|
message: z.ZodString;
|
|
801
|
-
|
|
816
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
802
817
|
description: z.ZodOptional<z.ZodString>;
|
|
818
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
803
819
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
804
820
|
errorType: z.ZodLiteral<ErrorTypeV1.TIMEOUT_ERROR>;
|
|
805
821
|
isImmediatelyAvailable: z.ZodLiteral<true>;
|
|
@@ -809,10 +825,10 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
809
825
|
message: string;
|
|
810
826
|
errorType: ErrorTypeV1.TIMEOUT_ERROR;
|
|
811
827
|
isImmediatelyAvailable: true;
|
|
812
|
-
provider?: RecognitionProvider | undefined;
|
|
813
828
|
code?: string | number | undefined;
|
|
814
|
-
|
|
829
|
+
provider?: RecognitionProvider | undefined;
|
|
815
830
|
description?: string | undefined;
|
|
831
|
+
audioUtteranceId?: string | undefined;
|
|
816
832
|
timestamp?: number | undefined;
|
|
817
833
|
timeoutMs?: number | undefined;
|
|
818
834
|
operation?: string | undefined;
|
|
@@ -820,19 +836,19 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
820
836
|
message: string;
|
|
821
837
|
errorType: ErrorTypeV1.TIMEOUT_ERROR;
|
|
822
838
|
isImmediatelyAvailable: true;
|
|
823
|
-
provider?: RecognitionProvider | undefined;
|
|
824
839
|
code?: string | number | undefined;
|
|
825
|
-
|
|
840
|
+
provider?: RecognitionProvider | undefined;
|
|
826
841
|
description?: string | undefined;
|
|
842
|
+
audioUtteranceId?: string | undefined;
|
|
827
843
|
timestamp?: number | undefined;
|
|
828
844
|
timeoutMs?: number | undefined;
|
|
829
845
|
operation?: string | undefined;
|
|
830
846
|
}>, z.ZodObject<{
|
|
831
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
832
847
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
833
848
|
message: z.ZodString;
|
|
834
|
-
|
|
849
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
835
850
|
description: z.ZodOptional<z.ZodString>;
|
|
851
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
836
852
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
837
853
|
errorType: z.ZodLiteral<ErrorTypeV1.QUOTA_EXCEEDED>;
|
|
838
854
|
isImmediatelyAvailable: z.ZodLiteral<true>;
|
|
@@ -843,10 +859,10 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
843
859
|
message: string;
|
|
844
860
|
errorType: ErrorTypeV1.QUOTA_EXCEEDED;
|
|
845
861
|
isImmediatelyAvailable: true;
|
|
846
|
-
provider?: RecognitionProvider | undefined;
|
|
847
862
|
code?: string | number | undefined;
|
|
848
|
-
|
|
863
|
+
provider?: RecognitionProvider | undefined;
|
|
849
864
|
description?: string | undefined;
|
|
865
|
+
audioUtteranceId?: string | undefined;
|
|
850
866
|
timestamp?: number | undefined;
|
|
851
867
|
quotaType?: string | undefined;
|
|
852
868
|
resetAt?: number | undefined;
|
|
@@ -855,20 +871,20 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
855
871
|
message: string;
|
|
856
872
|
errorType: ErrorTypeV1.QUOTA_EXCEEDED;
|
|
857
873
|
isImmediatelyAvailable: true;
|
|
858
|
-
provider?: RecognitionProvider | undefined;
|
|
859
874
|
code?: string | number | undefined;
|
|
860
|
-
|
|
875
|
+
provider?: RecognitionProvider | undefined;
|
|
861
876
|
description?: string | undefined;
|
|
877
|
+
audioUtteranceId?: string | undefined;
|
|
862
878
|
timestamp?: number | undefined;
|
|
863
879
|
quotaType?: string | undefined;
|
|
864
880
|
resetAt?: number | undefined;
|
|
865
881
|
retryAfterSeconds?: number | undefined;
|
|
866
882
|
}>, z.ZodObject<{
|
|
867
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
868
883
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
869
884
|
message: z.ZodString;
|
|
870
|
-
|
|
885
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
871
886
|
description: z.ZodOptional<z.ZodString>;
|
|
887
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
872
888
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
873
889
|
errorType: z.ZodLiteral<ErrorTypeV1.CONNECTION_ERROR>;
|
|
874
890
|
isImmediatelyAvailable: z.ZodLiteral<true>;
|
|
@@ -879,10 +895,10 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
879
895
|
message: string;
|
|
880
896
|
errorType: ErrorTypeV1.CONNECTION_ERROR;
|
|
881
897
|
isImmediatelyAvailable: true;
|
|
882
|
-
provider?: RecognitionProvider | undefined;
|
|
883
898
|
code?: string | number | undefined;
|
|
884
|
-
|
|
899
|
+
provider?: RecognitionProvider | undefined;
|
|
885
900
|
description?: string | undefined;
|
|
901
|
+
audioUtteranceId?: string | undefined;
|
|
886
902
|
timestamp?: number | undefined;
|
|
887
903
|
attempts?: number | undefined;
|
|
888
904
|
url?: string | undefined;
|
|
@@ -891,20 +907,20 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
891
907
|
message: string;
|
|
892
908
|
errorType: ErrorTypeV1.CONNECTION_ERROR;
|
|
893
909
|
isImmediatelyAvailable: true;
|
|
894
|
-
provider?: RecognitionProvider | undefined;
|
|
895
910
|
code?: string | number | undefined;
|
|
896
|
-
|
|
911
|
+
provider?: RecognitionProvider | undefined;
|
|
897
912
|
description?: string | undefined;
|
|
913
|
+
audioUtteranceId?: string | undefined;
|
|
898
914
|
timestamp?: number | undefined;
|
|
899
915
|
attempts?: number | undefined;
|
|
900
916
|
url?: string | undefined;
|
|
901
917
|
underlyingError?: string | undefined;
|
|
902
918
|
}>, z.ZodObject<{
|
|
903
|
-
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
904
919
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
905
920
|
message: z.ZodString;
|
|
906
|
-
|
|
921
|
+
provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
|
|
907
922
|
description: z.ZodOptional<z.ZodString>;
|
|
923
|
+
audioUtteranceId: z.ZodOptional<z.ZodString>;
|
|
908
924
|
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
909
925
|
errorType: z.ZodLiteral<ErrorTypeV1.UNKNOWN_ERROR>;
|
|
910
926
|
isImmediatelyAvailable: z.ZodLiteral<false>;
|
|
@@ -914,10 +930,10 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
914
930
|
message: string;
|
|
915
931
|
errorType: ErrorTypeV1.UNKNOWN_ERROR;
|
|
916
932
|
isImmediatelyAvailable: false;
|
|
917
|
-
provider?: RecognitionProvider | undefined;
|
|
918
933
|
code?: string | number | undefined;
|
|
919
|
-
|
|
934
|
+
provider?: RecognitionProvider | undefined;
|
|
920
935
|
description?: string | undefined;
|
|
936
|
+
audioUtteranceId?: string | undefined;
|
|
921
937
|
timestamp?: number | undefined;
|
|
922
938
|
stack?: string | undefined;
|
|
923
939
|
context?: Record<string, unknown> | undefined;
|
|
@@ -925,10 +941,10 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
|
|
|
925
941
|
message: string;
|
|
926
942
|
errorType: ErrorTypeV1.UNKNOWN_ERROR;
|
|
927
943
|
isImmediatelyAvailable: false;
|
|
928
|
-
provider?: RecognitionProvider | undefined;
|
|
929
944
|
code?: string | number | undefined;
|
|
930
|
-
|
|
945
|
+
provider?: RecognitionProvider | undefined;
|
|
931
946
|
description?: string | undefined;
|
|
947
|
+
audioUtteranceId?: string | undefined;
|
|
932
948
|
timestamp?: number | undefined;
|
|
933
949
|
stack?: string | undefined;
|
|
934
950
|
context?: Record<string, unknown> | undefined;
|
|
@@ -1520,6 +1536,12 @@ interface IRecognitionClientConfig {
|
|
|
1520
1536
|
asrRequestConfig?: ASRRequestConfig;
|
|
1521
1537
|
/** Game context for improved recognition accuracy */
|
|
1522
1538
|
gameContext?: GameContextV1;
|
|
1539
|
+
/**
|
|
1540
|
+
* Game ID for tracking and routing purposes (optional)
|
|
1541
|
+
* If provided, this is added to the WebSocket URL as a query parameter.
|
|
1542
|
+
* If gameContext is also provided, this takes precedence over gameContext.gameId.
|
|
1543
|
+
*/
|
|
1544
|
+
gameId?: string;
|
|
1523
1545
|
/** Audio utterance ID (optional) - if not provided, a UUID v4 will be generated */
|
|
1524
1546
|
audioUtteranceId?: string;
|
|
1525
1547
|
/** Callback URLs for server-side notifications with optional message type filtering (optional)
|
|
@@ -1885,6 +1907,11 @@ declare class ConfigBuilder {
|
|
|
1885
1907
|
* Set game context
|
|
1886
1908
|
*/
|
|
1887
1909
|
gameContext(context: GameContextV1): this;
|
|
1910
|
+
/**
|
|
1911
|
+
* Set game ID directly (takes precedence over gameContext.gameId)
|
|
1912
|
+
* Use this when you only need to identify the game without full context.
|
|
1913
|
+
*/
|
|
1914
|
+
gameId(id: string): this;
|
|
1888
1915
|
/**
|
|
1889
1916
|
* Set audio utterance ID
|
|
1890
1917
|
*/
|
|
@@ -2237,6 +2264,7 @@ declare class SimplifiedVGFRecognitionClient implements ISimplifiedVGFRecognitio
|
|
|
2237
2264
|
private stateChangeCallback;
|
|
2238
2265
|
private expectedUuid;
|
|
2239
2266
|
private logger;
|
|
2267
|
+
private lastSentTerminalUuid;
|
|
2240
2268
|
constructor(config: SimplifiedVGFClientConfig);
|
|
2241
2269
|
connect(): Promise<void>;
|
|
2242
2270
|
sendAudio(audioData: ArrayBuffer | ArrayBufferView | Blob): void;
|
|
@@ -2251,6 +2279,7 @@ declare class SimplifiedVGFRecognitionClient implements ISimplifiedVGFRecognitio
|
|
|
2251
2279
|
isTranscriptionFinished(): boolean;
|
|
2252
2280
|
isBufferOverflowing(): boolean;
|
|
2253
2281
|
getVGFState(): RecognitionState;
|
|
2282
|
+
private isTerminalStatus;
|
|
2254
2283
|
private notifyStateChange;
|
|
2255
2284
|
}
|
|
2256
2285
|
/**
|