@volley/recognition-client-sdk 0.1.424 → 0.1.622

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.
@@ -15,7 +15,11 @@ declare enum RecognitionProvider {
15
15
  GOOGLE = "google",
16
16
  GEMINI_BATCH = "gemini-batch",
17
17
  OPENAI_BATCH = "openai-batch",
18
- OPENAI_REALTIME = "openai-realtime"
18
+ OPENAI_REALTIME = "openai-realtime",
19
+ MISTRAL_VOXTRAL = "mistral-voxtral",
20
+ DASHSCOPE = "dashscope",
21
+ TEST_ASR_PROVIDER_QUOTA = "test-asr-provider-quota",
22
+ TEST_ASR_STREAMING = "test-asr-streaming"
19
23
  }
20
24
  /**
21
25
  * ASR API type - distinguishes between streaming and file-based transcription APIs
@@ -77,14 +81,31 @@ declare enum ElevenLabsModel {
77
81
  * OpenAI Realtime API transcription models
78
82
  * These are the verified `input_audio_transcription.model` values.
79
83
  * @see https://platform.openai.com/docs/guides/realtime
84
+ * @see https://platform.openai.com/docs/models/gpt-4o-transcribe
80
85
  */
81
86
  declare enum OpenAIRealtimeModel {
87
+ GPT_4O_TRANSCRIBE = "gpt-4o-transcribe",
82
88
  GPT_4O_MINI_TRANSCRIBE = "gpt-4o-mini-transcribe"
83
89
  }
90
+ /**
91
+ * Mistral Voxtral Realtime transcription models
92
+ * @see https://docs.mistral.ai/models/voxtral-mini-transcribe-realtime-26-02
93
+ */
94
+ declare enum MistralVoxtralModel {
95
+ VOXTRAL_MINI_REALTIME_2602 = "voxtral-mini-transcribe-realtime-2602"
96
+ }
97
+ /**
98
+ * DashScope Qwen-ASR Realtime transcription models
99
+ * @see https://www.alibabacloud.com/help/en/model-studio/qwen-real-time-speech-recognition
100
+ */
101
+ declare enum DashScopeModel {
102
+ QWEN3_ASR_FLASH_REALTIME_2602 = "qwen3-asr-flash-realtime-2026-02-10",
103
+ QWEN3_ASR_FLASH_REALTIME = "qwen3-asr-flash-realtime"
104
+ }
84
105
  /**
85
106
  * Type alias for any model from any provider
86
107
  */
87
- type RecognitionModel = DeepgramModel | GoogleModel | FireworksModel | ElevenLabsModel | OpenAIRealtimeModel | string;
108
+ type RecognitionModel = DeepgramModel | GoogleModel | FireworksModel | ElevenLabsModel | OpenAIRealtimeModel | MistralVoxtralModel | DashScopeModel | string;
88
109
 
89
110
  /**
90
111
  * Audio encoding types
@@ -230,47 +251,59 @@ declare const TranscriptionResultSchemaV1: z.ZodObject<{
230
251
  type: z.ZodLiteral<RecognitionResultTypeV1.TRANSCRIPTION>;
231
252
  audioUtteranceId: z.ZodString;
232
253
  finalTranscript: z.ZodString;
254
+ finalTranscriptRaw: z.ZodString;
233
255
  finalTranscriptConfidence: z.ZodOptional<z.ZodNumber>;
234
256
  pendingTranscript: z.ZodOptional<z.ZodString>;
257
+ pendingTranscriptRaw: z.ZodOptional<z.ZodString>;
235
258
  pendingTranscriptConfidence: z.ZodOptional<z.ZodNumber>;
236
259
  is_finished: z.ZodBoolean;
237
260
  voiceStart: z.ZodOptional<z.ZodNumber>;
238
261
  voiceDuration: z.ZodOptional<z.ZodNumber>;
239
262
  voiceEnd: z.ZodOptional<z.ZodNumber>;
263
+ lastNonSilence: z.ZodOptional<z.ZodNumber>;
240
264
  startTimestamp: z.ZodOptional<z.ZodNumber>;
241
265
  endTimestamp: z.ZodOptional<z.ZodNumber>;
242
266
  receivedAtMs: z.ZodOptional<z.ZodNumber>;
243
267
  accumulatedAudioTimeMs: z.ZodOptional<z.ZodNumber>;
268
+ rawAudioTimeMs: z.ZodOptional<z.ZodNumber>;
244
269
  }, "strip", z.ZodTypeAny, {
245
270
  type: RecognitionResultTypeV1.TRANSCRIPTION;
246
271
  audioUtteranceId: string;
247
272
  finalTranscript: string;
273
+ finalTranscriptRaw: string;
248
274
  is_finished: boolean;
249
275
  finalTranscriptConfidence?: number | undefined;
250
276
  pendingTranscript?: string | undefined;
277
+ pendingTranscriptRaw?: string | undefined;
251
278
  pendingTranscriptConfidence?: number | undefined;
252
279
  voiceStart?: number | undefined;
253
280
  voiceDuration?: number | undefined;
254
281
  voiceEnd?: number | undefined;
282
+ lastNonSilence?: number | undefined;
255
283
  startTimestamp?: number | undefined;
256
284
  endTimestamp?: number | undefined;
257
285
  receivedAtMs?: number | undefined;
258
286
  accumulatedAudioTimeMs?: number | undefined;
287
+ rawAudioTimeMs?: number | undefined;
259
288
  }, {
260
289
  type: RecognitionResultTypeV1.TRANSCRIPTION;
261
290
  audioUtteranceId: string;
262
291
  finalTranscript: string;
292
+ finalTranscriptRaw: string;
263
293
  is_finished: boolean;
264
294
  finalTranscriptConfidence?: number | undefined;
265
295
  pendingTranscript?: string | undefined;
296
+ pendingTranscriptRaw?: string | undefined;
266
297
  pendingTranscriptConfidence?: number | undefined;
267
298
  voiceStart?: number | undefined;
268
299
  voiceDuration?: number | undefined;
269
300
  voiceEnd?: number | undefined;
301
+ lastNonSilence?: number | undefined;
270
302
  startTimestamp?: number | undefined;
271
303
  endTimestamp?: number | undefined;
272
304
  receivedAtMs?: number | undefined;
273
305
  accumulatedAudioTimeMs?: number | undefined;
306
+ rawAudioTimeMs?: number | undefined;
274
307
  }>;
275
308
  type TranscriptionResultV1 = z.infer<typeof TranscriptionResultSchemaV1>;
276
309
  /**
@@ -300,11 +333,22 @@ type FunctionCallResultV1 = z.infer<typeof FunctionCallResultSchemaV1>;
300
333
  * - WITH_CONTENT → recog.client.websocket.transcript.final_with_content
301
334
  * - EMPTY → recog.client.websocket.transcript.final_empty
302
335
  * - NEVER_SENT → derived from sessions.streamed - final_with_content - final_empty
336
+ * - ERROR_* → 1:1 mapping to ErrorTypeV1 for error-caused outcomes
303
337
  */
304
338
  declare enum TranscriptOutcomeType {
305
339
  WITH_CONTENT = "with_content",
306
340
  EMPTY = "empty",
307
- NEVER_SENT = "never_sent"
341
+ NEVER_SENT = "never_sent",
342
+ ERROR_AUTHENTICATION = "error_authentication",
343
+ ERROR_VALIDATION = "error_validation",
344
+ ERROR_PROVIDER = "error_provider",
345
+ ERROR_TIMEOUT = "error_timeout",
346
+ ERROR_QUOTA = "error_quota",
347
+ ERROR_INTERNAL_QUOTA = "error_internal_quota",
348
+ ERROR_CONNECTION = "error_connection",
349
+ ERROR_NO_AUDIO = "error_no_audio",
350
+ ERROR_CIRCUIT_BREAKER = "error_circuit_breaker",
351
+ ERROR_UNKNOWN = "error_unknown"
308
352
  }
309
353
  /**
310
354
  * Metadata result V1 - contains metadata, timing information, and ASR config
@@ -314,6 +358,7 @@ declare enum TranscriptOutcomeType {
314
358
  declare const MetadataResultSchemaV1: z.ZodObject<{
315
359
  type: z.ZodLiteral<RecognitionResultTypeV1.METADATA>;
316
360
  audioUtteranceId: z.ZodString;
361
+ connectionInitiatedAtMs: z.ZodOptional<z.ZodNumber>;
317
362
  recordingStartMs: z.ZodOptional<z.ZodNumber>;
318
363
  recordingEndMs: z.ZodOptional<z.ZodNumber>;
319
364
  transcriptEndMs: z.ZodOptional<z.ZodNumber>;
@@ -321,14 +366,53 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
321
366
  duration: z.ZodOptional<z.ZodNumber>;
322
367
  volume: z.ZodOptional<z.ZodNumber>;
323
368
  accumulatedAudioTimeMs: z.ZodOptional<z.ZodNumber>;
369
+ rawAudioTimeMs: z.ZodOptional<z.ZodNumber>;
324
370
  costInUSD: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
325
371
  apiType: z.ZodOptional<z.ZodNativeEnum<typeof ASRApiType>>;
326
372
  asrConfig: z.ZodOptional<z.ZodString>;
327
373
  rawAsrMetadata: z.ZodOptional<z.ZodString>;
328
374
  transcriptOutcome: z.ZodOptional<z.ZodNativeEnum<typeof TranscriptOutcomeType>>;
375
+ audioMetrics: z.ZodOptional<z.ZodObject<{
376
+ valid: z.ZodBoolean;
377
+ audioBeginMs: z.ZodNumber;
378
+ audioEndMs: z.ZodNumber;
379
+ maxVolume: z.ZodNumber;
380
+ minVolume: z.ZodNumber;
381
+ avgVolume: z.ZodNumber;
382
+ silenceRatio: z.ZodNumber;
383
+ clippingRatio: z.ZodNumber;
384
+ snrEstimate: z.ZodNullable<z.ZodNumber>;
385
+ lastNonSilenceMs: z.ZodNumber;
386
+ timestamp: z.ZodString;
387
+ }, "strip", z.ZodTypeAny, {
388
+ valid: boolean;
389
+ audioBeginMs: number;
390
+ audioEndMs: number;
391
+ maxVolume: number;
392
+ minVolume: number;
393
+ avgVolume: number;
394
+ silenceRatio: number;
395
+ clippingRatio: number;
396
+ snrEstimate: number | null;
397
+ lastNonSilenceMs: number;
398
+ timestamp: string;
399
+ }, {
400
+ valid: boolean;
401
+ audioBeginMs: number;
402
+ audioEndMs: number;
403
+ maxVolume: number;
404
+ minVolume: number;
405
+ avgVolume: number;
406
+ silenceRatio: number;
407
+ clippingRatio: number;
408
+ snrEstimate: number | null;
409
+ lastNonSilenceMs: number;
410
+ timestamp: string;
411
+ }>>;
329
412
  }, "strip", z.ZodTypeAny, {
330
413
  type: RecognitionResultTypeV1.METADATA;
331
414
  audioUtteranceId: string;
415
+ connectionInitiatedAtMs?: number | undefined;
332
416
  recordingStartMs?: number | undefined;
333
417
  recordingEndMs?: number | undefined;
334
418
  transcriptEndMs?: number | undefined;
@@ -336,14 +420,29 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
336
420
  duration?: number | undefined;
337
421
  volume?: number | undefined;
338
422
  accumulatedAudioTimeMs?: number | undefined;
423
+ rawAudioTimeMs?: number | undefined;
339
424
  costInUSD?: number | undefined;
340
425
  apiType?: ASRApiType | undefined;
341
426
  asrConfig?: string | undefined;
342
427
  rawAsrMetadata?: string | undefined;
343
428
  transcriptOutcome?: TranscriptOutcomeType | undefined;
429
+ audioMetrics?: {
430
+ valid: boolean;
431
+ audioBeginMs: number;
432
+ audioEndMs: number;
433
+ maxVolume: number;
434
+ minVolume: number;
435
+ avgVolume: number;
436
+ silenceRatio: number;
437
+ clippingRatio: number;
438
+ snrEstimate: number | null;
439
+ lastNonSilenceMs: number;
440
+ timestamp: string;
441
+ } | undefined;
344
442
  }, {
345
443
  type: RecognitionResultTypeV1.METADATA;
346
444
  audioUtteranceId: string;
445
+ connectionInitiatedAtMs?: number | undefined;
347
446
  recordingStartMs?: number | undefined;
348
447
  recordingEndMs?: number | undefined;
349
448
  transcriptEndMs?: number | undefined;
@@ -351,11 +450,25 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
351
450
  duration?: number | undefined;
352
451
  volume?: number | undefined;
353
452
  accumulatedAudioTimeMs?: number | undefined;
453
+ rawAudioTimeMs?: number | undefined;
354
454
  costInUSD?: number | undefined;
355
455
  apiType?: ASRApiType | undefined;
356
456
  asrConfig?: string | undefined;
357
457
  rawAsrMetadata?: string | undefined;
358
458
  transcriptOutcome?: TranscriptOutcomeType | undefined;
459
+ audioMetrics?: {
460
+ valid: boolean;
461
+ audioBeginMs: number;
462
+ audioEndMs: number;
463
+ maxVolume: number;
464
+ minVolume: number;
465
+ avgVolume: number;
466
+ silenceRatio: number;
467
+ clippingRatio: number;
468
+ snrEstimate: number | null;
469
+ lastNonSilenceMs: number;
470
+ timestamp: string;
471
+ } | undefined;
359
472
  }>;
360
473
  type MetadataResultV1 = z.infer<typeof MetadataResultSchemaV1>;
361
474
  /**
@@ -367,7 +480,10 @@ declare enum ErrorTypeV1 {
367
480
  PROVIDER_ERROR = "provider_error",
368
481
  TIMEOUT_ERROR = "timeout_error",
369
482
  QUOTA_EXCEEDED = "quota_exceeded",
483
+ INTERNAL_QUOTA_EXHAUSTED = "internal_quota_exhausted",
370
484
  CONNECTION_ERROR = "connection_error",
485
+ NO_AUDIO_ERROR = "no_audio_error",
486
+ CIRCUIT_BREAKER_OPEN = "circuit_breaker_open",
371
487
  UNKNOWN_ERROR = "unknown_error"
372
488
  }
373
489
  /**
@@ -424,9 +540,9 @@ declare const AuthenticationExceptionSchema: z.ZodObject<{
424
540
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
425
541
  message: z.ZodString;
426
542
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
427
- description: z.ZodOptional<z.ZodString>;
428
543
  audioUtteranceId: z.ZodOptional<z.ZodString>;
429
544
  timestamp: z.ZodOptional<z.ZodNumber>;
545
+ description: z.ZodOptional<z.ZodString>;
430
546
  errorType: z.ZodLiteral<ErrorTypeV1.AUTHENTICATION_ERROR>;
431
547
  isImmediatelyAvailable: z.ZodLiteral<false>;
432
548
  service: z.ZodOptional<z.ZodString>;
@@ -437,9 +553,9 @@ declare const AuthenticationExceptionSchema: z.ZodObject<{
437
553
  isImmediatelyAvailable: false;
438
554
  code?: string | number | undefined;
439
555
  provider?: RecognitionProvider | undefined;
440
- description?: string | undefined;
441
556
  audioUtteranceId?: string | undefined;
442
557
  timestamp?: number | undefined;
558
+ description?: string | undefined;
443
559
  service?: string | undefined;
444
560
  authMethod?: string | undefined;
445
561
  }, {
@@ -448,9 +564,9 @@ declare const AuthenticationExceptionSchema: z.ZodObject<{
448
564
  isImmediatelyAvailable: false;
449
565
  code?: string | number | undefined;
450
566
  provider?: RecognitionProvider | undefined;
451
- description?: string | undefined;
452
567
  audioUtteranceId?: string | undefined;
453
568
  timestamp?: number | undefined;
569
+ description?: string | undefined;
454
570
  service?: string | undefined;
455
571
  authMethod?: string | undefined;
456
572
  }>;
@@ -464,9 +580,9 @@ declare const ValidationExceptionSchema: z.ZodObject<{
464
580
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
465
581
  message: z.ZodString;
466
582
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
467
- description: z.ZodOptional<z.ZodString>;
468
583
  audioUtteranceId: z.ZodOptional<z.ZodString>;
469
584
  timestamp: z.ZodOptional<z.ZodNumber>;
585
+ description: z.ZodOptional<z.ZodString>;
470
586
  errorType: z.ZodLiteral<ErrorTypeV1.VALIDATION_ERROR>;
471
587
  isImmediatelyAvailable: z.ZodLiteral<true>;
472
588
  field: z.ZodOptional<z.ZodString>;
@@ -478,9 +594,9 @@ declare const ValidationExceptionSchema: z.ZodObject<{
478
594
  isImmediatelyAvailable: true;
479
595
  code?: string | number | undefined;
480
596
  provider?: RecognitionProvider | undefined;
481
- description?: string | undefined;
482
597
  audioUtteranceId?: string | undefined;
483
598
  timestamp?: number | undefined;
599
+ description?: string | undefined;
484
600
  field?: string | undefined;
485
601
  expected?: string | undefined;
486
602
  received?: string | undefined;
@@ -490,9 +606,9 @@ declare const ValidationExceptionSchema: z.ZodObject<{
490
606
  isImmediatelyAvailable: true;
491
607
  code?: string | number | undefined;
492
608
  provider?: RecognitionProvider | undefined;
493
- description?: string | undefined;
494
609
  audioUtteranceId?: string | undefined;
495
610
  timestamp?: number | undefined;
611
+ description?: string | undefined;
496
612
  field?: string | undefined;
497
613
  expected?: string | undefined;
498
614
  received?: string | undefined;
@@ -506,9 +622,9 @@ type ValidationException = z.infer<typeof ValidationExceptionSchema>;
506
622
  declare const ProviderExceptionSchema: z.ZodObject<{
507
623
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
508
624
  message: z.ZodString;
509
- description: z.ZodOptional<z.ZodString>;
510
625
  audioUtteranceId: z.ZodOptional<z.ZodString>;
511
626
  timestamp: z.ZodOptional<z.ZodNumber>;
627
+ description: z.ZodOptional<z.ZodString>;
512
628
  errorType: z.ZodLiteral<ErrorTypeV1.PROVIDER_ERROR>;
513
629
  isImmediatelyAvailable: z.ZodLiteral<false>;
514
630
  provider: z.ZodOptional<z.ZodString>;
@@ -519,9 +635,9 @@ declare const ProviderExceptionSchema: z.ZodObject<{
519
635
  errorType: ErrorTypeV1.PROVIDER_ERROR;
520
636
  isImmediatelyAvailable: false;
521
637
  code?: string | number | undefined;
522
- description?: string | undefined;
523
638
  audioUtteranceId?: string | undefined;
524
639
  timestamp?: number | undefined;
640
+ description?: string | undefined;
525
641
  provider?: string | undefined;
526
642
  providerErrorCode?: string | number | undefined;
527
643
  isTransient?: boolean | undefined;
@@ -530,9 +646,9 @@ declare const ProviderExceptionSchema: z.ZodObject<{
530
646
  errorType: ErrorTypeV1.PROVIDER_ERROR;
531
647
  isImmediatelyAvailable: false;
532
648
  code?: string | number | undefined;
533
- description?: string | undefined;
534
649
  audioUtteranceId?: string | undefined;
535
650
  timestamp?: number | undefined;
651
+ description?: string | undefined;
536
652
  provider?: string | undefined;
537
653
  providerErrorCode?: string | number | undefined;
538
654
  isTransient?: boolean | undefined;
@@ -547,9 +663,9 @@ declare const TimeoutExceptionSchema: z.ZodObject<{
547
663
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
548
664
  message: z.ZodString;
549
665
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
550
- description: z.ZodOptional<z.ZodString>;
551
666
  audioUtteranceId: z.ZodOptional<z.ZodString>;
552
667
  timestamp: z.ZodOptional<z.ZodNumber>;
668
+ description: z.ZodOptional<z.ZodString>;
553
669
  errorType: z.ZodLiteral<ErrorTypeV1.TIMEOUT_ERROR>;
554
670
  isImmediatelyAvailable: z.ZodLiteral<true>;
555
671
  timeoutMs: z.ZodOptional<z.ZodNumber>;
@@ -560,9 +676,9 @@ declare const TimeoutExceptionSchema: z.ZodObject<{
560
676
  isImmediatelyAvailable: true;
561
677
  code?: string | number | undefined;
562
678
  provider?: RecognitionProvider | undefined;
563
- description?: string | undefined;
564
679
  audioUtteranceId?: string | undefined;
565
680
  timestamp?: number | undefined;
681
+ description?: string | undefined;
566
682
  timeoutMs?: number | undefined;
567
683
  operation?: string | undefined;
568
684
  }, {
@@ -571,9 +687,9 @@ declare const TimeoutExceptionSchema: z.ZodObject<{
571
687
  isImmediatelyAvailable: true;
572
688
  code?: string | number | undefined;
573
689
  provider?: RecognitionProvider | undefined;
574
- description?: string | undefined;
575
690
  audioUtteranceId?: string | undefined;
576
691
  timestamp?: number | undefined;
692
+ description?: string | undefined;
577
693
  timeoutMs?: number | undefined;
578
694
  operation?: string | undefined;
579
695
  }>;
@@ -587,9 +703,9 @@ declare const QuotaExceededExceptionSchema: z.ZodObject<{
587
703
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
588
704
  message: z.ZodString;
589
705
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
590
- description: z.ZodOptional<z.ZodString>;
591
706
  audioUtteranceId: z.ZodOptional<z.ZodString>;
592
707
  timestamp: z.ZodOptional<z.ZodNumber>;
708
+ description: z.ZodOptional<z.ZodString>;
593
709
  errorType: z.ZodLiteral<ErrorTypeV1.QUOTA_EXCEEDED>;
594
710
  isImmediatelyAvailable: z.ZodLiteral<true>;
595
711
  quotaType: z.ZodOptional<z.ZodString>;
@@ -601,9 +717,9 @@ declare const QuotaExceededExceptionSchema: z.ZodObject<{
601
717
  isImmediatelyAvailable: true;
602
718
  code?: string | number | undefined;
603
719
  provider?: RecognitionProvider | undefined;
604
- description?: string | undefined;
605
720
  audioUtteranceId?: string | undefined;
606
721
  timestamp?: number | undefined;
722
+ description?: string | undefined;
607
723
  quotaType?: string | undefined;
608
724
  resetAt?: number | undefined;
609
725
  retryAfterSeconds?: number | undefined;
@@ -613,9 +729,9 @@ declare const QuotaExceededExceptionSchema: z.ZodObject<{
613
729
  isImmediatelyAvailable: true;
614
730
  code?: string | number | undefined;
615
731
  provider?: RecognitionProvider | undefined;
616
- description?: string | undefined;
617
732
  audioUtteranceId?: string | undefined;
618
733
  timestamp?: number | undefined;
734
+ description?: string | undefined;
619
735
  quotaType?: string | undefined;
620
736
  resetAt?: number | undefined;
621
737
  retryAfterSeconds?: number | undefined;
@@ -630,9 +746,9 @@ declare const ConnectionExceptionSchema: z.ZodObject<{
630
746
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
631
747
  message: z.ZodString;
632
748
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
633
- description: z.ZodOptional<z.ZodString>;
634
749
  audioUtteranceId: z.ZodOptional<z.ZodString>;
635
750
  timestamp: z.ZodOptional<z.ZodNumber>;
751
+ description: z.ZodOptional<z.ZodString>;
636
752
  errorType: z.ZodLiteral<ErrorTypeV1.CONNECTION_ERROR>;
637
753
  isImmediatelyAvailable: z.ZodLiteral<true>;
638
754
  attempts: z.ZodOptional<z.ZodNumber>;
@@ -644,9 +760,9 @@ declare const ConnectionExceptionSchema: z.ZodObject<{
644
760
  isImmediatelyAvailable: true;
645
761
  code?: string | number | undefined;
646
762
  provider?: RecognitionProvider | undefined;
647
- description?: string | undefined;
648
763
  audioUtteranceId?: string | undefined;
649
764
  timestamp?: number | undefined;
765
+ description?: string | undefined;
650
766
  attempts?: number | undefined;
651
767
  url?: string | undefined;
652
768
  underlyingError?: string | undefined;
@@ -656,9 +772,9 @@ declare const ConnectionExceptionSchema: z.ZodObject<{
656
772
  isImmediatelyAvailable: true;
657
773
  code?: string | number | undefined;
658
774
  provider?: RecognitionProvider | undefined;
659
- description?: string | undefined;
660
775
  audioUtteranceId?: string | undefined;
661
776
  timestamp?: number | undefined;
777
+ description?: string | undefined;
662
778
  attempts?: number | undefined;
663
779
  url?: string | undefined;
664
780
  underlyingError?: string | undefined;
@@ -673,9 +789,9 @@ declare const UnknownExceptionSchema: z.ZodObject<{
673
789
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
674
790
  message: z.ZodString;
675
791
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
676
- description: z.ZodOptional<z.ZodString>;
677
792
  audioUtteranceId: z.ZodOptional<z.ZodString>;
678
793
  timestamp: z.ZodOptional<z.ZodNumber>;
794
+ description: z.ZodOptional<z.ZodString>;
679
795
  errorType: z.ZodLiteral<ErrorTypeV1.UNKNOWN_ERROR>;
680
796
  isImmediatelyAvailable: z.ZodLiteral<false>;
681
797
  stack: z.ZodOptional<z.ZodString>;
@@ -686,9 +802,9 @@ declare const UnknownExceptionSchema: z.ZodObject<{
686
802
  isImmediatelyAvailable: false;
687
803
  code?: string | number | undefined;
688
804
  provider?: RecognitionProvider | undefined;
689
- description?: string | undefined;
690
805
  audioUtteranceId?: string | undefined;
691
806
  timestamp?: number | undefined;
807
+ description?: string | undefined;
692
808
  stack?: string | undefined;
693
809
  context?: Record<string, unknown> | undefined;
694
810
  }, {
@@ -697,9 +813,9 @@ declare const UnknownExceptionSchema: z.ZodObject<{
697
813
  isImmediatelyAvailable: false;
698
814
  code?: string | number | undefined;
699
815
  provider?: RecognitionProvider | undefined;
700
- description?: string | undefined;
701
816
  audioUtteranceId?: string | undefined;
702
817
  timestamp?: number | undefined;
818
+ description?: string | undefined;
703
819
  stack?: string | undefined;
704
820
  context?: Record<string, unknown> | undefined;
705
821
  }>;
@@ -712,9 +828,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
712
828
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
713
829
  message: z.ZodString;
714
830
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
715
- description: z.ZodOptional<z.ZodString>;
716
831
  audioUtteranceId: z.ZodOptional<z.ZodString>;
717
832
  timestamp: z.ZodOptional<z.ZodNumber>;
833
+ description: z.ZodOptional<z.ZodString>;
718
834
  errorType: z.ZodLiteral<ErrorTypeV1.AUTHENTICATION_ERROR>;
719
835
  isImmediatelyAvailable: z.ZodLiteral<false>;
720
836
  service: z.ZodOptional<z.ZodString>;
@@ -725,9 +841,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
725
841
  isImmediatelyAvailable: false;
726
842
  code?: string | number | undefined;
727
843
  provider?: RecognitionProvider | undefined;
728
- description?: string | undefined;
729
844
  audioUtteranceId?: string | undefined;
730
845
  timestamp?: number | undefined;
846
+ description?: string | undefined;
731
847
  service?: string | undefined;
732
848
  authMethod?: string | undefined;
733
849
  }, {
@@ -736,18 +852,18 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
736
852
  isImmediatelyAvailable: false;
737
853
  code?: string | number | undefined;
738
854
  provider?: RecognitionProvider | undefined;
739
- description?: string | undefined;
740
855
  audioUtteranceId?: string | undefined;
741
856
  timestamp?: number | undefined;
857
+ description?: string | undefined;
742
858
  service?: string | undefined;
743
859
  authMethod?: string | undefined;
744
860
  }>, z.ZodObject<{
745
861
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
746
862
  message: z.ZodString;
747
863
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
748
- description: z.ZodOptional<z.ZodString>;
749
864
  audioUtteranceId: z.ZodOptional<z.ZodString>;
750
865
  timestamp: z.ZodOptional<z.ZodNumber>;
866
+ description: z.ZodOptional<z.ZodString>;
751
867
  errorType: z.ZodLiteral<ErrorTypeV1.VALIDATION_ERROR>;
752
868
  isImmediatelyAvailable: z.ZodLiteral<true>;
753
869
  field: z.ZodOptional<z.ZodString>;
@@ -759,9 +875,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
759
875
  isImmediatelyAvailable: true;
760
876
  code?: string | number | undefined;
761
877
  provider?: RecognitionProvider | undefined;
762
- description?: string | undefined;
763
878
  audioUtteranceId?: string | undefined;
764
879
  timestamp?: number | undefined;
880
+ description?: string | undefined;
765
881
  field?: string | undefined;
766
882
  expected?: string | undefined;
767
883
  received?: string | undefined;
@@ -771,18 +887,18 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
771
887
  isImmediatelyAvailable: true;
772
888
  code?: string | number | undefined;
773
889
  provider?: RecognitionProvider | undefined;
774
- description?: string | undefined;
775
890
  audioUtteranceId?: string | undefined;
776
891
  timestamp?: number | undefined;
892
+ description?: string | undefined;
777
893
  field?: string | undefined;
778
894
  expected?: string | undefined;
779
895
  received?: string | undefined;
780
896
  }>, z.ZodObject<{
781
897
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
782
898
  message: z.ZodString;
783
- description: z.ZodOptional<z.ZodString>;
784
899
  audioUtteranceId: z.ZodOptional<z.ZodString>;
785
900
  timestamp: z.ZodOptional<z.ZodNumber>;
901
+ description: z.ZodOptional<z.ZodString>;
786
902
  errorType: z.ZodLiteral<ErrorTypeV1.PROVIDER_ERROR>;
787
903
  isImmediatelyAvailable: z.ZodLiteral<false>;
788
904
  provider: z.ZodOptional<z.ZodString>;
@@ -793,9 +909,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
793
909
  errorType: ErrorTypeV1.PROVIDER_ERROR;
794
910
  isImmediatelyAvailable: false;
795
911
  code?: string | number | undefined;
796
- description?: string | undefined;
797
912
  audioUtteranceId?: string | undefined;
798
913
  timestamp?: number | undefined;
914
+ description?: string | undefined;
799
915
  provider?: string | undefined;
800
916
  providerErrorCode?: string | number | undefined;
801
917
  isTransient?: boolean | undefined;
@@ -804,9 +920,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
804
920
  errorType: ErrorTypeV1.PROVIDER_ERROR;
805
921
  isImmediatelyAvailable: false;
806
922
  code?: string | number | undefined;
807
- description?: string | undefined;
808
923
  audioUtteranceId?: string | undefined;
809
924
  timestamp?: number | undefined;
925
+ description?: string | undefined;
810
926
  provider?: string | undefined;
811
927
  providerErrorCode?: string | number | undefined;
812
928
  isTransient?: boolean | undefined;
@@ -814,9 +930,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
814
930
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
815
931
  message: z.ZodString;
816
932
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
817
- description: z.ZodOptional<z.ZodString>;
818
933
  audioUtteranceId: z.ZodOptional<z.ZodString>;
819
934
  timestamp: z.ZodOptional<z.ZodNumber>;
935
+ description: z.ZodOptional<z.ZodString>;
820
936
  errorType: z.ZodLiteral<ErrorTypeV1.TIMEOUT_ERROR>;
821
937
  isImmediatelyAvailable: z.ZodLiteral<true>;
822
938
  timeoutMs: z.ZodOptional<z.ZodNumber>;
@@ -827,9 +943,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
827
943
  isImmediatelyAvailable: true;
828
944
  code?: string | number | undefined;
829
945
  provider?: RecognitionProvider | undefined;
830
- description?: string | undefined;
831
946
  audioUtteranceId?: string | undefined;
832
947
  timestamp?: number | undefined;
948
+ description?: string | undefined;
833
949
  timeoutMs?: number | undefined;
834
950
  operation?: string | undefined;
835
951
  }, {
@@ -838,18 +954,18 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
838
954
  isImmediatelyAvailable: true;
839
955
  code?: string | number | undefined;
840
956
  provider?: RecognitionProvider | undefined;
841
- description?: string | undefined;
842
957
  audioUtteranceId?: string | undefined;
843
958
  timestamp?: number | undefined;
959
+ description?: string | undefined;
844
960
  timeoutMs?: number | undefined;
845
961
  operation?: string | undefined;
846
962
  }>, z.ZodObject<{
847
963
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
848
964
  message: z.ZodString;
849
965
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
850
- description: z.ZodOptional<z.ZodString>;
851
966
  audioUtteranceId: z.ZodOptional<z.ZodString>;
852
967
  timestamp: z.ZodOptional<z.ZodNumber>;
968
+ description: z.ZodOptional<z.ZodString>;
853
969
  errorType: z.ZodLiteral<ErrorTypeV1.QUOTA_EXCEEDED>;
854
970
  isImmediatelyAvailable: z.ZodLiteral<true>;
855
971
  quotaType: z.ZodOptional<z.ZodString>;
@@ -861,9 +977,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
861
977
  isImmediatelyAvailable: true;
862
978
  code?: string | number | undefined;
863
979
  provider?: RecognitionProvider | undefined;
864
- description?: string | undefined;
865
980
  audioUtteranceId?: string | undefined;
866
981
  timestamp?: number | undefined;
982
+ description?: string | undefined;
867
983
  quotaType?: string | undefined;
868
984
  resetAt?: number | undefined;
869
985
  retryAfterSeconds?: number | undefined;
@@ -873,9 +989,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
873
989
  isImmediatelyAvailable: true;
874
990
  code?: string | number | undefined;
875
991
  provider?: RecognitionProvider | undefined;
876
- description?: string | undefined;
877
992
  audioUtteranceId?: string | undefined;
878
993
  timestamp?: number | undefined;
994
+ description?: string | undefined;
879
995
  quotaType?: string | undefined;
880
996
  resetAt?: number | undefined;
881
997
  retryAfterSeconds?: number | undefined;
@@ -883,9 +999,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
883
999
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
884
1000
  message: z.ZodString;
885
1001
  provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
886
- description: z.ZodOptional<z.ZodString>;
887
1002
  audioUtteranceId: z.ZodOptional<z.ZodString>;
888
1003
  timestamp: z.ZodOptional<z.ZodNumber>;
1004
+ description: z.ZodOptional<z.ZodString>;
889
1005
  errorType: z.ZodLiteral<ErrorTypeV1.CONNECTION_ERROR>;
890
1006
  isImmediatelyAvailable: z.ZodLiteral<true>;
891
1007
  attempts: z.ZodOptional<z.ZodNumber>;
@@ -897,9 +1013,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
897
1013
  isImmediatelyAvailable: true;
898
1014
  code?: string | number | undefined;
899
1015
  provider?: RecognitionProvider | undefined;
900
- description?: string | undefined;
901
1016
  audioUtteranceId?: string | undefined;
902
1017
  timestamp?: number | undefined;
1018
+ description?: string | undefined;
903
1019
  attempts?: number | undefined;
904
1020
  url?: string | undefined;
905
1021
  underlyingError?: string | undefined;
@@ -909,19 +1025,49 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
909
1025
  isImmediatelyAvailable: true;
910
1026
  code?: string | number | undefined;
911
1027
  provider?: RecognitionProvider | undefined;
912
- description?: string | undefined;
913
1028
  audioUtteranceId?: string | undefined;
914
1029
  timestamp?: number | undefined;
1030
+ description?: string | undefined;
915
1031
  attempts?: number | undefined;
916
1032
  url?: string | undefined;
917
1033
  underlyingError?: string | undefined;
918
1034
  }>, z.ZodObject<{
919
1035
  code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
920
1036
  message: z.ZodString;
921
- provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
1037
+ audioUtteranceId: z.ZodOptional<z.ZodString>;
1038
+ timestamp: z.ZodOptional<z.ZodNumber>;
922
1039
  description: z.ZodOptional<z.ZodString>;
1040
+ errorType: z.ZodLiteral<ErrorTypeV1.CIRCUIT_BREAKER_OPEN>;
1041
+ isImmediatelyAvailable: z.ZodLiteral<true>;
1042
+ provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
1043
+ model: z.ZodOptional<z.ZodString>;
1044
+ }, "strip", z.ZodTypeAny, {
1045
+ message: string;
1046
+ errorType: ErrorTypeV1.CIRCUIT_BREAKER_OPEN;
1047
+ isImmediatelyAvailable: true;
1048
+ code?: string | number | undefined;
1049
+ audioUtteranceId?: string | undefined;
1050
+ timestamp?: number | undefined;
1051
+ description?: string | undefined;
1052
+ provider?: RecognitionProvider | undefined;
1053
+ model?: string | undefined;
1054
+ }, {
1055
+ message: string;
1056
+ errorType: ErrorTypeV1.CIRCUIT_BREAKER_OPEN;
1057
+ isImmediatelyAvailable: true;
1058
+ code?: string | number | undefined;
1059
+ audioUtteranceId?: string | undefined;
1060
+ timestamp?: number | undefined;
1061
+ description?: string | undefined;
1062
+ provider?: RecognitionProvider | undefined;
1063
+ model?: string | undefined;
1064
+ }>, z.ZodObject<{
1065
+ code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1066
+ message: z.ZodString;
1067
+ provider: z.ZodOptional<z.ZodNativeEnum<typeof RecognitionProvider>>;
923
1068
  audioUtteranceId: z.ZodOptional<z.ZodString>;
924
1069
  timestamp: z.ZodOptional<z.ZodNumber>;
1070
+ description: z.ZodOptional<z.ZodString>;
925
1071
  errorType: z.ZodLiteral<ErrorTypeV1.UNKNOWN_ERROR>;
926
1072
  isImmediatelyAvailable: z.ZodLiteral<false>;
927
1073
  stack: z.ZodOptional<z.ZodString>;
@@ -932,9 +1078,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
932
1078
  isImmediatelyAvailable: false;
933
1079
  code?: string | number | undefined;
934
1080
  provider?: RecognitionProvider | undefined;
935
- description?: string | undefined;
936
1081
  audioUtteranceId?: string | undefined;
937
1082
  timestamp?: number | undefined;
1083
+ description?: string | undefined;
938
1084
  stack?: string | undefined;
939
1085
  context?: Record<string, unknown> | undefined;
940
1086
  }, {
@@ -943,9 +1089,9 @@ declare const RecognitionExceptionSchema: z.ZodDiscriminatedUnion<"errorType", [
943
1089
  isImmediatelyAvailable: false;
944
1090
  code?: string | number | undefined;
945
1091
  provider?: RecognitionProvider | undefined;
946
- description?: string | undefined;
947
1092
  audioUtteranceId?: string | undefined;
948
1093
  timestamp?: number | undefined;
1094
+ description?: string | undefined;
949
1095
  stack?: string | undefined;
950
1096
  context?: Record<string, unknown> | undefined;
951
1097
  }>]>;
@@ -980,6 +1126,15 @@ declare enum ControlSignalTypeV1 {
980
1126
  START_RECORDING = "start_recording",
981
1127
  STOP_RECORDING = "stop_recording"
982
1128
  }
1129
+ /**
1130
+ * Prefix audio mode for ASR Request V1
1131
+ * Controls how prefix audio is handled during recognition
1132
+ */
1133
+ declare enum PrefixMode {
1134
+ NONE = "none",
1135
+ CLIENT = "client",
1136
+ STORED = "stored"
1137
+ }
983
1138
  /**
984
1139
  * SlotMap - A strongly typed map from slot names to lists of values
985
1140
  * Used for entity extraction and slot filling in voice interactions
@@ -1030,6 +1185,38 @@ declare const ASRRequestSchemaV1: z.ZodObject<{
1030
1185
  interimResults: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1031
1186
  useContext: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1032
1187
  finalTranscriptStability: z.ZodOptional<z.ZodString>;
1188
+ priority: z.ZodDefault<z.ZodOptional<z.ZodEnum<["low", "high"]>>>;
1189
+ fallbackModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
1190
+ provider: z.ZodString;
1191
+ model: z.ZodOptional<z.ZodString>;
1192
+ language: z.ZodOptional<z.ZodString>;
1193
+ sampleRate: z.ZodOptional<z.ZodNumber>;
1194
+ encoding: z.ZodOptional<z.ZodNumber>;
1195
+ interimResults: z.ZodOptional<z.ZodBoolean>;
1196
+ useContext: z.ZodOptional<z.ZodBoolean>;
1197
+ finalTranscriptStability: z.ZodOptional<z.ZodString>;
1198
+ }, "strip", z.ZodTypeAny, {
1199
+ provider: string;
1200
+ model?: string | undefined;
1201
+ language?: string | undefined;
1202
+ sampleRate?: number | undefined;
1203
+ encoding?: number | undefined;
1204
+ interimResults?: boolean | undefined;
1205
+ useContext?: boolean | undefined;
1206
+ finalTranscriptStability?: string | undefined;
1207
+ }, {
1208
+ provider: string;
1209
+ model?: string | undefined;
1210
+ language?: string | undefined;
1211
+ sampleRate?: number | undefined;
1212
+ encoding?: number | undefined;
1213
+ interimResults?: boolean | undefined;
1214
+ useContext?: boolean | undefined;
1215
+ finalTranscriptStability?: string | undefined;
1216
+ }>, "many">>;
1217
+ prefixMode: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof PrefixMode>>>;
1218
+ prefixId: z.ZodOptional<z.ZodString>;
1219
+ prefixTextToRemove: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1033
1220
  debugCommand: z.ZodOptional<z.ZodObject<{
1034
1221
  enableDebugLog: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1035
1222
  enableAudioStorage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -1047,16 +1234,30 @@ declare const ASRRequestSchemaV1: z.ZodObject<{
1047
1234
  enablePilotModels?: boolean | undefined;
1048
1235
  }>>;
1049
1236
  }, "strip", z.ZodTypeAny, {
1237
+ type: RecognitionContextTypeV1.ASR_REQUEST;
1050
1238
  provider: string;
1051
1239
  language: string;
1052
1240
  sampleRate: number;
1053
1241
  encoding: number;
1054
1242
  interimResults: boolean;
1055
1243
  useContext: boolean;
1056
- type: RecognitionContextTypeV1.ASR_REQUEST;
1244
+ priority: "low" | "high";
1245
+ prefixMode: PrefixMode;
1057
1246
  audioUtteranceId?: string | undefined;
1058
1247
  model?: string | undefined;
1059
1248
  finalTranscriptStability?: string | undefined;
1249
+ fallbackModels?: {
1250
+ provider: string;
1251
+ model?: string | undefined;
1252
+ language?: string | undefined;
1253
+ sampleRate?: number | undefined;
1254
+ encoding?: number | undefined;
1255
+ interimResults?: boolean | undefined;
1256
+ useContext?: boolean | undefined;
1257
+ finalTranscriptStability?: string | undefined;
1258
+ }[] | undefined;
1259
+ prefixId?: string | undefined;
1260
+ prefixTextToRemove?: string[] | undefined;
1060
1261
  debugCommand?: {
1061
1262
  enableDebugLog: boolean;
1062
1263
  enableAudioStorage: boolean;
@@ -1064,16 +1265,30 @@ declare const ASRRequestSchemaV1: z.ZodObject<{
1064
1265
  enablePilotModels: boolean;
1065
1266
  } | undefined;
1066
1267
  }, {
1268
+ type: RecognitionContextTypeV1.ASR_REQUEST;
1067
1269
  provider: string;
1068
1270
  language: string;
1069
1271
  sampleRate: number;
1070
1272
  encoding: number;
1071
- type: RecognitionContextTypeV1.ASR_REQUEST;
1072
1273
  audioUtteranceId?: string | undefined;
1073
1274
  model?: string | undefined;
1074
1275
  interimResults?: boolean | undefined;
1075
1276
  useContext?: boolean | undefined;
1076
1277
  finalTranscriptStability?: string | undefined;
1278
+ priority?: "low" | "high" | undefined;
1279
+ fallbackModels?: {
1280
+ provider: string;
1281
+ model?: string | undefined;
1282
+ language?: string | undefined;
1283
+ sampleRate?: number | undefined;
1284
+ encoding?: number | undefined;
1285
+ interimResults?: boolean | undefined;
1286
+ useContext?: boolean | undefined;
1287
+ finalTranscriptStability?: string | undefined;
1288
+ }[] | undefined;
1289
+ prefixMode?: PrefixMode | undefined;
1290
+ prefixId?: string | undefined;
1291
+ prefixTextToRemove?: string[] | undefined;
1077
1292
  debugCommand?: {
1078
1293
  enableDebugLog?: boolean | undefined;
1079
1294
  enableAudioStorage?: boolean | undefined;
@@ -1110,13 +1325,13 @@ declare enum FinalTranscriptStability {
1110
1325
  */
1111
1326
  AGGRESSIVE = "aggressive",
1112
1327
  /**
1113
- * Balanced mode: 200ms timeout (default)
1328
+ * Balanced mode: 500ms timeout (default)
1114
1329
  * Natural middle ground for most conversational scenarios
1115
1330
  * Use cases: General customer support, tech support, typical voice interactions
1116
1331
  */
1117
1332
  BALANCED = "balanced",
1118
1333
  /**
1119
- * Conservative mode: 400ms timeout
1334
+ * Conservative mode: 1000ms timeout
1120
1335
  * Wait longer for providers, optimized for complex/reflective speech
1121
1336
  * Use cases: Healthcare, complex queries, careful thought processes
1122
1337
  */
@@ -1208,13 +1423,70 @@ interface ASRRequestConfig {
1208
1423
  * doesn't respond with is_final=true after stopRecording().
1209
1424
  *
1210
1425
  * - aggressive: 100ms - fast response, may cut off slow providers
1211
- * - balanced: 200ms - current default, good for most cases
1212
- * - conservative: 400ms - wait longer for complex utterances
1426
+ * - balanced: 500ms - current default, good for most cases
1427
+ * - conservative: 1000ms - wait longer for complex utterances
1213
1428
  *
1214
1429
  * @default 'balanced'
1215
1430
  * @see FinalTranscriptStability enum for detailed descriptions
1216
1431
  */
1217
1432
  finalTranscriptStability?: FinalTranscriptStability | string;
1433
+ /**
1434
+ * Traffic control priority for quota slot allocation
1435
+ *
1436
+ * Controls which quota slots this request can use when traffic control is enabled.
1437
+ * The quota system reserves a portion of slots for high-priority requests.
1438
+ *
1439
+ * - 'high': Can use all quota slots (reserved for critical games like song-quiz)
1440
+ * - 'low': Limited to non-reserved slots (default for most requests)
1441
+ *
1442
+ * @default 'low'
1443
+ */
1444
+ priority?: 'low' | 'high';
1445
+ /**
1446
+ * Prefix audio injection mode
1447
+ *
1448
+ * Controls how prefix audio is handled:
1449
+ * - 'none': No prefix audio (default)
1450
+ * - 'client': Client sends PREFIX_AUDIO before user audio
1451
+ * - 'stored': Server injects stored prefix audio by prefixId
1452
+ *
1453
+ * @default 'none'
1454
+ */
1455
+ prefixMode?: PrefixMode | string;
1456
+ /**
1457
+ * Stored prefix audio identifier
1458
+ *
1459
+ * Only used when prefixMode='stored'. The server will look up this ID
1460
+ * in the PrefixAudioCache and inject the corresponding audio before
1461
+ * user audio is processed.
1462
+ *
1463
+ * @example 'song_quiz'
1464
+ */
1465
+ prefixId?: string;
1466
+ /**
1467
+ * Prefix text patterns to remove from transcripts
1468
+ *
1469
+ * Array of prefix text variants that should be stripped from the transcript.
1470
+ * This is used when prefix audio is injected and the ASR transcribes both
1471
+ * the prefix and user speech - we remove the prefix portion.
1472
+ *
1473
+ * Multiple variants are supported because ASR may transcribe contractions
1474
+ * differently (e.g., "What's this song" vs "What is this song").
1475
+ *
1476
+ * Matching rules:
1477
+ * - Case insensitive
1478
+ * - Leading/trailing whitespace trimmed
1479
+ * - Multiple spaces collapsed
1480
+ * - Punctuation (?.!,) stripped for matching
1481
+ * - Apostrophes preserved (part of contractions)
1482
+ *
1483
+ * Can be set via:
1484
+ * - Server-side game config (production)
1485
+ * - Client-side ASRRequest (testing/override) - takes precedence
1486
+ *
1487
+ * @example ["What's this song", "What is this song"]
1488
+ */
1489
+ prefixTextToRemove?: string[];
1218
1490
  /**
1219
1491
  * Additional provider-specific options
1220
1492
  *
@@ -1710,6 +1982,26 @@ interface IRecognitionClient {
1710
1982
  * @returns WebSocket URL string
1711
1983
  */
1712
1984
  getUrl(): string;
1985
+ /**
1986
+ * Send game context after connection is established (for preconnect flow).
1987
+ *
1988
+ * Preconnect flow: Create client with asrRequestConfig (useContext: true) but
1989
+ * WITHOUT gameContext → call connect() → WS opens, ASRRequest sent, server
1990
+ * waits in PENDING_CONTEXT → later call sendGameContext() with slotMap →
1991
+ * server attaches provider and sends READY.
1992
+ *
1993
+ * This enables connecting early (before slotMap is known) and sending
1994
+ * game context later when question data is available.
1995
+ *
1996
+ * @param context - Game context including slotMap for keyword boosting
1997
+ */
1998
+ sendGameContext(context: GameContextV1): void;
1999
+ /**
2000
+ * Check if server has sent READY signal (provider is connected and ready for audio).
2001
+ * In preconnect flow, this becomes true after sendGameContext() triggers provider attachment.
2002
+ * @returns true if server is ready to receive audio
2003
+ */
2004
+ isServerReady(): boolean;
1713
2005
  }
1714
2006
  /**
1715
2007
  * Client statistics interface
@@ -1790,8 +2082,11 @@ type TranscriptionResult = TranscriptionResultV1;
1790
2082
  */
1791
2083
  declare class RealTimeTwoWayWebSocketRecognitionClient extends WebSocketAudioClient<number, any, any> implements IRecognitionClient {
1792
2084
  private static readonly PROTOCOL_VERSION;
2085
+ private static readonly MAX_PREFIX_BUFFER_BYTES;
1793
2086
  private config;
1794
2087
  private audioBuffer;
2088
+ private prefixBuffer;
2089
+ private prefixBufferBytes;
1795
2090
  private messageHandler;
1796
2091
  private state;
1797
2092
  private connectionPromise;
@@ -1836,6 +2131,8 @@ declare class RealTimeTwoWayWebSocketRecognitionClient extends WebSocketAudioCli
1836
2131
  isStopping(): boolean;
1837
2132
  isTranscriptionFinished(): boolean;
1838
2133
  isBufferOverflowing(): boolean;
2134
+ isServerReady(): boolean;
2135
+ sendGameContext(context: GameContextV1): void;
1839
2136
  getStats(): IRecognitionClientStats;
1840
2137
  protected onConnected(): void;
1841
2138
  protected onDisconnected(code: number, reason: string): void;
@@ -1859,6 +2156,28 @@ declare class RealTimeTwoWayWebSocketRecognitionClient extends WebSocketAudioCli
1859
2156
  * @param audioData - Audio data to send
1860
2157
  */
1861
2158
  private sendAudioNow;
2159
+ /**
2160
+ * Send prefix audio to the server.
2161
+ * Prefix audio is sent before user audio and is used for context/priming.
2162
+ * The server will process it but adjust timing so transcripts reflect user audio timing.
2163
+ *
2164
+ * Note: Prefix audio is buffered until READY state, then flushed before user audio.
2165
+ * This ensures proper ordering even if called before server is ready.
2166
+ *
2167
+ * @param audioData - Prefix audio data (ArrayBuffer, ArrayBufferView, or Blob)
2168
+ */
2169
+ sendPrefixAudio(audioData: ArrayBuffer | ArrayBufferView | Blob): void;
2170
+ /**
2171
+ * Internal method to handle prefix audio with buffering
2172
+ * Buffers if not READY, sends immediately if READY
2173
+ */
2174
+ private sendPrefixAudioInternal;
2175
+ /**
2176
+ * Send prefix audio immediately to the server (without buffering)
2177
+ * Uses encoding offset to mark as prefix audio
2178
+ * @param audioData - Prefix audio data to send
2179
+ */
2180
+ private sendPrefixAudioNow;
1862
2181
  }
1863
2182
 
1864
2183
  /**
@@ -2089,6 +2408,8 @@ declare const RecognitionVGFStateSchema: z.ZodObject<{
2089
2408
  transcriptionStatus: z.ZodOptional<z.ZodString>;
2090
2409
  finalTranscript: z.ZodOptional<z.ZodString>;
2091
2410
  finalConfidence: z.ZodOptional<z.ZodNumber>;
2411
+ voiceEnd: z.ZodOptional<z.ZodNumber>;
2412
+ lastNonSilence: z.ZodOptional<z.ZodNumber>;
2092
2413
  asrConfig: z.ZodOptional<z.ZodString>;
2093
2414
  startRecordingTimestamp: z.ZodOptional<z.ZodString>;
2094
2415
  finalRecordingTimestamp: z.ZodOptional<z.ZodString>;
@@ -2107,6 +2428,8 @@ declare const RecognitionVGFStateSchema: z.ZodObject<{
2107
2428
  transcriptionStatus?: string | undefined;
2108
2429
  finalTranscript?: string | undefined;
2109
2430
  finalConfidence?: number | undefined;
2431
+ voiceEnd?: number | undefined;
2432
+ lastNonSilence?: number | undefined;
2110
2433
  asrConfig?: string | undefined;
2111
2434
  startRecordingTimestamp?: string | undefined;
2112
2435
  finalRecordingTimestamp?: string | undefined;
@@ -2123,6 +2446,8 @@ declare const RecognitionVGFStateSchema: z.ZodObject<{
2123
2446
  transcriptionStatus?: string | undefined;
2124
2447
  finalTranscript?: string | undefined;
2125
2448
  finalConfidence?: number | undefined;
2449
+ voiceEnd?: number | undefined;
2450
+ lastNonSilence?: number | undefined;
2126
2451
  asrConfig?: string | undefined;
2127
2452
  startRecordingTimestamp?: string | undefined;
2128
2453
  finalRecordingTimestamp?: string | undefined;
@@ -2244,6 +2569,20 @@ interface ISimplifiedVGFRecognitionClient {
2244
2569
  * Check if the audio buffer has overflowed
2245
2570
  */
2246
2571
  isBufferOverflowing(): boolean;
2572
+ /**
2573
+ * Send game context after connection is established (for preconnect flow).
2574
+ *
2575
+ * Preconnect flow: Create client with asrRequestConfig (useContext: true) but
2576
+ * WITHOUT gameContext → call connect() → later call sendGameContext() with slotMap.
2577
+ *
2578
+ * @param context - Game context including slotMap for keyword boosting
2579
+ */
2580
+ sendGameContext(context: GameContextV1): void;
2581
+ /**
2582
+ * Check if server has sent READY signal (provider connected, ready for audio).
2583
+ * In preconnect flow, this becomes true after sendGameContext() triggers provider attachment.
2584
+ */
2585
+ isServerReady(): boolean;
2247
2586
  /**
2248
2587
  * Get the audio utterance ID for this session
2249
2588
  */
@@ -2282,6 +2621,8 @@ declare class SimplifiedVGFRecognitionClient implements ISimplifiedVGFRecognitio
2282
2621
  isStopping(): boolean;
2283
2622
  isTranscriptionFinished(): boolean;
2284
2623
  isBufferOverflowing(): boolean;
2624
+ sendGameContext(context: GameContextV1): void;
2625
+ isServerReady(): boolean;
2285
2626
  getVGFState(): RecognitionState;
2286
2627
  private isTerminalStatus;
2287
2628
  private notifyStateChange;
@@ -2396,5 +2737,5 @@ declare function getRecognitionConductorHttpBase(stage?: Stage | string | null |
2396
2737
  declare function getRecognitionConductorWsBase(stage?: Stage | string | null | undefined): string;
2397
2738
  declare function getRecognitionConductorHost(stage?: Stage | string | null | undefined): string;
2398
2739
 
2399
- export { AudioEncoding, ClientControlActionV1, ClientState, ConfigBuilder, ConnectionError, ControlSignalTypeV1 as ControlSignal, ControlSignalTypeV1, DeepgramModel, ElevenLabsModel, ErrorTypeV1, FinalTranscriptStability, FireworksModel, GeminiModel, GoogleModel, Language, OpenAIModel, RECOGNITION_CONDUCTOR_BASES, RECOGNITION_SERVICE_BASES, RealTimeTwoWayWebSocketRecognitionClient, RecognitionContextTypeV1, RecognitionError, RecognitionProvider, RecognitionResultTypeV1, RecognitionVGFStateSchema, RecordingStatus, STAGES, SampleRate, SimplifiedVGFRecognitionClient, TimeoutError, TranscriptionStatus, ValidationError, createClient, createClientWithBuilder, createDefaultASRConfig, createInitialRecognitionState, createSimplifiedVGFClient, getRecognitionConductorBase, getRecognitionConductorHost, getRecognitionConductorHttpBase, getRecognitionConductorWsBase, getRecognitionServiceBase, getRecognitionServiceHost, getRecognitionServiceHttpBase, getRecognitionServiceWsBase, getUserFriendlyMessage, isExceptionImmediatelyAvailable, isNormalDisconnection, isValidRecordingStatusTransition, normalizeStage, resetRecognitionVGFState };
2740
+ export { AudioEncoding, ClientControlActionV1, ClientState, ConfigBuilder, ConnectionError, ControlSignalTypeV1 as ControlSignal, ControlSignalTypeV1, DashScopeModel, DeepgramModel, ElevenLabsModel, ErrorTypeV1, FinalTranscriptStability, FireworksModel, GeminiModel, GoogleModel, Language, MistralVoxtralModel, OpenAIModel, OpenAIRealtimeModel, RECOGNITION_CONDUCTOR_BASES, RECOGNITION_SERVICE_BASES, RealTimeTwoWayWebSocketRecognitionClient, RecognitionContextTypeV1, RecognitionError, RecognitionProvider, RecognitionResultTypeV1, RecognitionVGFStateSchema, RecordingStatus, STAGES, SampleRate, SimplifiedVGFRecognitionClient, TimeoutError, TranscriptionStatus, ValidationError, createClient, createClientWithBuilder, createDefaultASRConfig, createInitialRecognitionState, createSimplifiedVGFClient, getRecognitionConductorBase, getRecognitionConductorHost, getRecognitionConductorHttpBase, getRecognitionConductorWsBase, getRecognitionServiceBase, getRecognitionServiceHost, getRecognitionServiceHttpBase, getRecognitionServiceWsBase, getUserFriendlyMessage, isExceptionImmediatelyAvailable, isNormalDisconnection, isValidRecordingStatusTransition, normalizeStage, resetRecognitionVGFState };
2400
2741
  export type { ASRRequestConfig, ASRRequestV1, AuthenticationException, ConnectionException, ErrorResultV1, FunctionCallResultV1, GameContextV1, IRecognitionClient, IRecognitionClientConfig, IRecognitionClientStats, ISimplifiedVGFRecognitionClient, MetadataResultV1, ProviderException, QuotaExceededException, RealTimeTwoWayWebSocketRecognitionClientConfig, RecognitionCallbackUrl, RecognitionException, RecognitionState, RecordingStatusType, SimplifiedVGFClientConfig, SlotMap, Stage, TimeoutException, TranscriptionResult, TranscriptionResultV1, TranscriptionStatusType, UnknownException, ValidationException };