@volley/recognition-client-sdk 0.1.622 → 0.1.689

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.
@@ -12,11 +12,14 @@ declare enum RecognitionProvider {
12
12
  DEEPGRAM = "deepgram",
13
13
  ELEVENLABS = "elevenlabs",
14
14
  FIREWORKS = "fireworks",
15
+ GLADIA = "gladia",
15
16
  GOOGLE = "google",
16
17
  GEMINI_BATCH = "gemini-batch",
17
18
  OPENAI_BATCH = "openai-batch",
19
+ SELF_SERVE_VLLM = "self-serve-vllm",
18
20
  OPENAI_REALTIME = "openai-realtime",
19
21
  MISTRAL_VOXTRAL = "mistral-voxtral",
22
+ CARTESIA = "cartesia",
20
23
  DASHSCOPE = "dashscope",
21
24
  TEST_ASR_PROVIDER_QUOTA = "test-asr-provider-quota",
22
25
  TEST_ASR_STREAMING = "test-asr-streaming"
@@ -67,6 +70,13 @@ declare enum FireworksModel {
67
70
  WHISPER_V3 = "whisper-v3",
68
71
  WHISPER_V3_TURBO = "whisper-v3-turbo"
69
72
  }
73
+ /**
74
+ * Gladia Solaria realtime transcription models
75
+ * @see https://docs.gladia.io/api-reference/v2/live/init
76
+ */
77
+ declare enum GladiaModel {
78
+ SOLARIA_1 = "solaria-1"
79
+ }
70
80
  /**
71
81
  * ElevenLabs Scribe models for speech-to-text
72
82
  * @see https://elevenlabs.io/blog/introducing-scribe-v2-realtime
@@ -74,8 +84,7 @@ declare enum FireworksModel {
74
84
  * @see https://elevenlabs.io/docs/api-reference/speech-to-text/convert
75
85
  */
76
86
  declare enum ElevenLabsModel {
77
- SCRIBE_V2_REALTIME = "scribe_v2_realtime",
78
- SCRIBE_V1 = "scribe_v1"
87
+ SCRIBE_V2_REALTIME = "scribe_v2_realtime"
79
88
  }
80
89
  /**
81
90
  * OpenAI Realtime API transcription models
@@ -94,6 +103,14 @@ declare enum OpenAIRealtimeModel {
94
103
  declare enum MistralVoxtralModel {
95
104
  VOXTRAL_MINI_REALTIME_2602 = "voxtral-mini-transcribe-realtime-2602"
96
105
  }
106
+ /**
107
+ * Cartesia Ink-Whisper Realtime transcription models
108
+ * @see https://docs.cartesia.ai/build-with-cartesia/stt-models
109
+ */
110
+ declare enum CartesiaModel {
111
+ INK_WHISPER = "ink-whisper",
112
+ INK_WHISPER_20250604 = "ink-whisper-2025-06-04"
113
+ }
97
114
  /**
98
115
  * DashScope Qwen-ASR Realtime transcription models
99
116
  * @see https://www.alibabacloud.com/help/en/model-studio/qwen-real-time-speech-recognition
@@ -102,10 +119,17 @@ declare enum DashScopeModel {
102
119
  QWEN3_ASR_FLASH_REALTIME_2602 = "qwen3-asr-flash-realtime-2026-02-10",
103
120
  QWEN3_ASR_FLASH_REALTIME = "qwen3-asr-flash-realtime"
104
121
  }
122
+ /**
123
+ * Self-serve vLLM batch transcription models
124
+ * Backed by recognition-inference / RunPod `/transcribe`
125
+ */
126
+ declare enum SelfServeVllmModel {
127
+ QWEN3_ASR_1_7B = "qwen3-asr-1.7b"
128
+ }
105
129
  /**
106
130
  * Type alias for any model from any provider
107
131
  */
108
- type RecognitionModel = DeepgramModel | GoogleModel | FireworksModel | ElevenLabsModel | OpenAIRealtimeModel | MistralVoxtralModel | DashScopeModel | string;
132
+ type RecognitionModel = DeepgramModel | GoogleModel | FireworksModel | GladiaModel | ElevenLabsModel | OpenAIRealtimeModel | MistralVoxtralModel | CartesiaModel | DashScopeModel | SelfServeVllmModel | string;
109
133
 
110
134
  /**
111
135
  * Audio encoding types
@@ -240,7 +264,8 @@ declare enum RecognitionResultTypeV1 {
240
264
  METADATA = "Metadata",
241
265
  ERROR = "Error",
242
266
  CLIENT_CONTROL_MESSAGE = "ClientControlMessage",
243
- AUDIO_METRICS = "AudioMetrics"
267
+ AUDIO_METRICS = "AudioMetrics",
268
+ SESSION_CONFIGURED = "SessionConfigured"
244
269
  }
245
270
  /**
246
271
  * Transcription result V1 - contains transcript message
@@ -369,6 +394,8 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
369
394
  rawAudioTimeMs: z.ZodOptional<z.ZodNumber>;
370
395
  costInUSD: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
371
396
  apiType: z.ZodOptional<z.ZodNativeEnum<typeof ASRApiType>>;
397
+ provider: z.ZodOptional<z.ZodString>;
398
+ model: z.ZodOptional<z.ZodString>;
372
399
  asrConfig: z.ZodOptional<z.ZodString>;
373
400
  rawAsrMetadata: z.ZodOptional<z.ZodString>;
374
401
  transcriptOutcome: z.ZodOptional<z.ZodNativeEnum<typeof TranscriptOutcomeType>>;
@@ -423,6 +450,8 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
423
450
  rawAudioTimeMs?: number | undefined;
424
451
  costInUSD?: number | undefined;
425
452
  apiType?: ASRApiType | undefined;
453
+ provider?: string | undefined;
454
+ model?: string | undefined;
426
455
  asrConfig?: string | undefined;
427
456
  rawAsrMetadata?: string | undefined;
428
457
  transcriptOutcome?: TranscriptOutcomeType | undefined;
@@ -453,6 +482,8 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
453
482
  rawAudioTimeMs?: number | undefined;
454
483
  costInUSD?: number | undefined;
455
484
  apiType?: ASRApiType | undefined;
485
+ provider?: string | undefined;
486
+ model?: string | undefined;
456
487
  asrConfig?: string | undefined;
457
488
  rawAsrMetadata?: string | undefined;
458
489
  transcriptOutcome?: TranscriptOutcomeType | undefined;
@@ -513,6 +544,46 @@ declare const ErrorResultSchemaV1: z.ZodObject<{
513
544
  description?: string | undefined;
514
545
  }>;
515
546
  type ErrorResultV1 = z.infer<typeof ErrorResultSchemaV1>;
547
+ /**
548
+ * Session configured message V1 - sent after ASR provider is selected and configured
549
+ * Fires after circuit breaker checks pass and provider/model are finalized,
550
+ * before audio streaming begins. Contains the actual ASR config that will be used.
551
+ */
552
+ declare const SessionConfiguredSchemaV1: z.ZodObject<{
553
+ type: z.ZodLiteral<RecognitionResultTypeV1.SESSION_CONFIGURED>;
554
+ audioUtteranceId: z.ZodString;
555
+ provider: z.ZodOptional<z.ZodString>;
556
+ model: z.ZodOptional<z.ZodString>;
557
+ sampleRate: z.ZodOptional<z.ZodNumber>;
558
+ encoding: z.ZodOptional<z.ZodString>;
559
+ apiType: z.ZodOptional<z.ZodNativeEnum<typeof ASRApiType>>;
560
+ isFallback: z.ZodOptional<z.ZodBoolean>;
561
+ asrRequest: z.ZodOptional<z.ZodString>;
562
+ providerConfig: z.ZodOptional<z.ZodString>;
563
+ }, "strip", z.ZodTypeAny, {
564
+ type: RecognitionResultTypeV1.SESSION_CONFIGURED;
565
+ audioUtteranceId: string;
566
+ provider?: string | undefined;
567
+ model?: string | undefined;
568
+ sampleRate?: number | undefined;
569
+ encoding?: string | undefined;
570
+ apiType?: ASRApiType | undefined;
571
+ isFallback?: boolean | undefined;
572
+ asrRequest?: string | undefined;
573
+ providerConfig?: string | undefined;
574
+ }, {
575
+ type: RecognitionResultTypeV1.SESSION_CONFIGURED;
576
+ audioUtteranceId: string;
577
+ provider?: string | undefined;
578
+ model?: string | undefined;
579
+ sampleRate?: number | undefined;
580
+ encoding?: string | undefined;
581
+ apiType?: ASRApiType | undefined;
582
+ isFallback?: boolean | undefined;
583
+ asrRequest?: string | undefined;
584
+ providerConfig?: string | undefined;
585
+ }>;
586
+ type SessionConfiguredV1 = z.infer<typeof SessionConfiguredSchemaV1>;
516
587
 
517
588
  /**
518
589
  * Recognition Context Types V1
@@ -1072,6 +1143,8 @@ interface IRecognitionClientConfig {
1072
1143
  questionAnswerId?: string;
1073
1144
  /** Platform for audio recording device (optional, e.g., 'ios', 'android', 'web', 'unity') */
1074
1145
  platform?: string;
1146
+ /** Experiment cohort (optional). Defaults to 'control' if not provided. */
1147
+ experimentCohort?: 'treatment' | 'control';
1075
1148
  /** Callback when transcript is received */
1076
1149
  onTranscript?: (result: TranscriptionResultV1) => void;
1077
1150
  /**
@@ -1081,6 +1154,8 @@ interface IRecognitionClientConfig {
1081
1154
  onFunctionCall?: (result: FunctionCallResultV1) => void;
1082
1155
  /** Callback when metadata is received. Only once after transcription is complete.*/
1083
1156
  onMetadata?: (metadata: MetadataResultV1) => void;
1157
+ /** Callback when session is configured with actual ASR provider/model (optional) */
1158
+ onSessionConfigured?: (config: SessionConfiguredV1) => void;
1084
1159
  /** Callback when error occurs */
1085
1160
  onError?: (error: ErrorResultV1) => void;
1086
1161
  /** Callback when connected to WebSocket */
@@ -4,7 +4,7 @@
4
4
  * Simple builder pattern for RealTimeTwoWayWebSocketRecognitionClientConfig
5
5
  */
6
6
  import type { RealTimeTwoWayWebSocketRecognitionClientConfig, RecognitionCallbackUrl } from './recognition-client.types.js';
7
- import type { ASRRequestConfig, GameContextV1, TranscriptionResultV1, MetadataResultV1, ErrorResultV1, Stage } from '@recog/shared-types';
7
+ import type { ASRRequestConfig, GameContextV1, TranscriptionResultV1, MetadataResultV1, SessionConfiguredV1, ErrorResultV1, Stage } from '@recog/shared-types';
8
8
  /**
9
9
  * Builder for RealTimeTwoWayWebSocketRecognitionClientConfig
10
10
  *
@@ -86,6 +86,10 @@ export declare class ConfigBuilder {
86
86
  * Set platform
87
87
  */
88
88
  platform(platform: string): this;
89
+ /**
90
+ * Set experiment cohort (optional, defaults to 'control')
91
+ */
92
+ experimentCohort(cohort: 'treatment' | 'control'): this;
89
93
  /**
90
94
  * Set transcript callback
91
95
  */
@@ -94,6 +98,10 @@ export declare class ConfigBuilder {
94
98
  * Set metadata callback
95
99
  */
96
100
  onMetadata(callback: (metadata: MetadataResultV1) => void): this;
101
+ /**
102
+ * Set session configured callback (optional)
103
+ */
104
+ onSessionConfigured(callback: (config: SessionConfiguredV1) => void): this;
97
105
  /**
98
106
  * Set error callback
99
107
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config-builder.d.ts","sourceRoot":"","sources":["../src/config-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,8CAA8C,EAC9C,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,gBAAgB,EAChB,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AAI;IAKvC;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAKtE;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKlC;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKjC;;OAEG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK3C;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKrC;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAKvG;;OAEG;IACH,KAAK,IAAI,8CAA8C;CAGxD"}
@@ -12,11 +12,14 @@ declare enum RecognitionProvider {
12
12
  DEEPGRAM = "deepgram",
13
13
  ELEVENLABS = "elevenlabs",
14
14
  FIREWORKS = "fireworks",
15
+ GLADIA = "gladia",
15
16
  GOOGLE = "google",
16
17
  GEMINI_BATCH = "gemini-batch",
17
18
  OPENAI_BATCH = "openai-batch",
19
+ SELF_SERVE_VLLM = "self-serve-vllm",
18
20
  OPENAI_REALTIME = "openai-realtime",
19
21
  MISTRAL_VOXTRAL = "mistral-voxtral",
22
+ CARTESIA = "cartesia",
20
23
  DASHSCOPE = "dashscope",
21
24
  TEST_ASR_PROVIDER_QUOTA = "test-asr-provider-quota",
22
25
  TEST_ASR_STREAMING = "test-asr-streaming"
@@ -67,6 +70,13 @@ declare enum FireworksModel {
67
70
  WHISPER_V3 = "whisper-v3",
68
71
  WHISPER_V3_TURBO = "whisper-v3-turbo"
69
72
  }
73
+ /**
74
+ * Gladia Solaria realtime transcription models
75
+ * @see https://docs.gladia.io/api-reference/v2/live/init
76
+ */
77
+ declare enum GladiaModel {
78
+ SOLARIA_1 = "solaria-1"
79
+ }
70
80
  /**
71
81
  * ElevenLabs Scribe models for speech-to-text
72
82
  * @see https://elevenlabs.io/blog/introducing-scribe-v2-realtime
@@ -74,8 +84,7 @@ declare enum FireworksModel {
74
84
  * @see https://elevenlabs.io/docs/api-reference/speech-to-text/convert
75
85
  */
76
86
  declare enum ElevenLabsModel {
77
- SCRIBE_V2_REALTIME = "scribe_v2_realtime",
78
- SCRIBE_V1 = "scribe_v1"
87
+ SCRIBE_V2_REALTIME = "scribe_v2_realtime"
79
88
  }
80
89
  /**
81
90
  * OpenAI Realtime API transcription models
@@ -94,6 +103,14 @@ declare enum OpenAIRealtimeModel {
94
103
  declare enum MistralVoxtralModel {
95
104
  VOXTRAL_MINI_REALTIME_2602 = "voxtral-mini-transcribe-realtime-2602"
96
105
  }
106
+ /**
107
+ * Cartesia Ink-Whisper Realtime transcription models
108
+ * @see https://docs.cartesia.ai/build-with-cartesia/stt-models
109
+ */
110
+ declare enum CartesiaModel {
111
+ INK_WHISPER = "ink-whisper",
112
+ INK_WHISPER_20250604 = "ink-whisper-2025-06-04"
113
+ }
97
114
  /**
98
115
  * DashScope Qwen-ASR Realtime transcription models
99
116
  * @see https://www.alibabacloud.com/help/en/model-studio/qwen-real-time-speech-recognition
@@ -102,10 +119,17 @@ declare enum DashScopeModel {
102
119
  QWEN3_ASR_FLASH_REALTIME_2602 = "qwen3-asr-flash-realtime-2026-02-10",
103
120
  QWEN3_ASR_FLASH_REALTIME = "qwen3-asr-flash-realtime"
104
121
  }
122
+ /**
123
+ * Self-serve vLLM batch transcription models
124
+ * Backed by recognition-inference / RunPod `/transcribe`
125
+ */
126
+ declare enum SelfServeVllmModel {
127
+ QWEN3_ASR_1_7B = "qwen3-asr-1.7b"
128
+ }
105
129
  /**
106
130
  * Type alias for any model from any provider
107
131
  */
108
- type RecognitionModel = DeepgramModel | GoogleModel | FireworksModel | ElevenLabsModel | OpenAIRealtimeModel | MistralVoxtralModel | DashScopeModel | string;
132
+ type RecognitionModel = DeepgramModel | GoogleModel | FireworksModel | GladiaModel | ElevenLabsModel | OpenAIRealtimeModel | MistralVoxtralModel | CartesiaModel | DashScopeModel | SelfServeVllmModel | string;
109
133
 
110
134
  /**
111
135
  * Audio encoding types
@@ -240,7 +264,8 @@ declare enum RecognitionResultTypeV1 {
240
264
  METADATA = "Metadata",
241
265
  ERROR = "Error",
242
266
  CLIENT_CONTROL_MESSAGE = "ClientControlMessage",
243
- AUDIO_METRICS = "AudioMetrics"
267
+ AUDIO_METRICS = "AudioMetrics",
268
+ SESSION_CONFIGURED = "SessionConfigured"
244
269
  }
245
270
  /**
246
271
  * Transcription result V1 - contains transcript message
@@ -369,6 +394,8 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
369
394
  rawAudioTimeMs: z.ZodOptional<z.ZodNumber>;
370
395
  costInUSD: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
371
396
  apiType: z.ZodOptional<z.ZodNativeEnum<typeof ASRApiType>>;
397
+ provider: z.ZodOptional<z.ZodString>;
398
+ model: z.ZodOptional<z.ZodString>;
372
399
  asrConfig: z.ZodOptional<z.ZodString>;
373
400
  rawAsrMetadata: z.ZodOptional<z.ZodString>;
374
401
  transcriptOutcome: z.ZodOptional<z.ZodNativeEnum<typeof TranscriptOutcomeType>>;
@@ -423,6 +450,8 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
423
450
  rawAudioTimeMs?: number | undefined;
424
451
  costInUSD?: number | undefined;
425
452
  apiType?: ASRApiType | undefined;
453
+ provider?: string | undefined;
454
+ model?: string | undefined;
426
455
  asrConfig?: string | undefined;
427
456
  rawAsrMetadata?: string | undefined;
428
457
  transcriptOutcome?: TranscriptOutcomeType | undefined;
@@ -453,6 +482,8 @@ declare const MetadataResultSchemaV1: z.ZodObject<{
453
482
  rawAudioTimeMs?: number | undefined;
454
483
  costInUSD?: number | undefined;
455
484
  apiType?: ASRApiType | undefined;
485
+ provider?: string | undefined;
486
+ model?: string | undefined;
456
487
  asrConfig?: string | undefined;
457
488
  rawAsrMetadata?: string | undefined;
458
489
  transcriptOutcome?: TranscriptOutcomeType | undefined;
@@ -522,6 +553,46 @@ declare enum ClientControlActionV1 {
522
553
  READY_FOR_UPLOADING_RECORDING = "ready_for_uploading_recording",
523
554
  STOP_RECORDING = "stop_recording"
524
555
  }
556
+ /**
557
+ * Session configured message V1 - sent after ASR provider is selected and configured
558
+ * Fires after circuit breaker checks pass and provider/model are finalized,
559
+ * before audio streaming begins. Contains the actual ASR config that will be used.
560
+ */
561
+ declare const SessionConfiguredSchemaV1: z.ZodObject<{
562
+ type: z.ZodLiteral<RecognitionResultTypeV1.SESSION_CONFIGURED>;
563
+ audioUtteranceId: z.ZodString;
564
+ provider: z.ZodOptional<z.ZodString>;
565
+ model: z.ZodOptional<z.ZodString>;
566
+ sampleRate: z.ZodOptional<z.ZodNumber>;
567
+ encoding: z.ZodOptional<z.ZodString>;
568
+ apiType: z.ZodOptional<z.ZodNativeEnum<typeof ASRApiType>>;
569
+ isFallback: z.ZodOptional<z.ZodBoolean>;
570
+ asrRequest: z.ZodOptional<z.ZodString>;
571
+ providerConfig: z.ZodOptional<z.ZodString>;
572
+ }, "strip", z.ZodTypeAny, {
573
+ type: RecognitionResultTypeV1.SESSION_CONFIGURED;
574
+ audioUtteranceId: string;
575
+ provider?: string | undefined;
576
+ model?: string | undefined;
577
+ sampleRate?: number | undefined;
578
+ encoding?: string | undefined;
579
+ apiType?: ASRApiType | undefined;
580
+ isFallback?: boolean | undefined;
581
+ asrRequest?: string | undefined;
582
+ providerConfig?: string | undefined;
583
+ }, {
584
+ type: RecognitionResultTypeV1.SESSION_CONFIGURED;
585
+ audioUtteranceId: string;
586
+ provider?: string | undefined;
587
+ model?: string | undefined;
588
+ sampleRate?: number | undefined;
589
+ encoding?: string | undefined;
590
+ apiType?: ASRApiType | undefined;
591
+ isFallback?: boolean | undefined;
592
+ asrRequest?: string | undefined;
593
+ providerConfig?: string | undefined;
594
+ }>;
595
+ type SessionConfiguredV1 = z.infer<typeof SessionConfiguredSchemaV1>;
525
596
 
526
597
  /**
527
598
  * Error Exception Types
@@ -1832,6 +1903,8 @@ interface IRecognitionClientConfig {
1832
1903
  questionAnswerId?: string;
1833
1904
  /** Platform for audio recording device (optional, e.g., 'ios', 'android', 'web', 'unity') */
1834
1905
  platform?: string;
1906
+ /** Experiment cohort (optional). Defaults to 'control' if not provided. */
1907
+ experimentCohort?: 'treatment' | 'control';
1835
1908
  /** Callback when transcript is received */
1836
1909
  onTranscript?: (result: TranscriptionResultV1) => void;
1837
1910
  /**
@@ -1841,6 +1914,8 @@ interface IRecognitionClientConfig {
1841
1914
  onFunctionCall?: (result: FunctionCallResultV1) => void;
1842
1915
  /** Callback when metadata is received. Only once after transcription is complete.*/
1843
1916
  onMetadata?: (metadata: MetadataResultV1) => void;
1917
+ /** Callback when session is configured with actual ASR provider/model (optional) */
1918
+ onSessionConfigured?: (config: SessionConfiguredV1) => void;
1844
1919
  /** Callback when error occurs */
1845
1920
  onError?: (error: ErrorResultV1) => void;
1846
1921
  /** Callback when connected to WebSocket */
@@ -2267,6 +2342,10 @@ declare class ConfigBuilder {
2267
2342
  * Set platform
2268
2343
  */
2269
2344
  platform(platform: string): this;
2345
+ /**
2346
+ * Set experiment cohort (optional, defaults to 'control')
2347
+ */
2348
+ experimentCohort(cohort: 'treatment' | 'control'): this;
2270
2349
  /**
2271
2350
  * Set transcript callback
2272
2351
  */
@@ -2275,6 +2354,10 @@ declare class ConfigBuilder {
2275
2354
  * Set metadata callback
2276
2355
  */
2277
2356
  onMetadata(callback: (metadata: MetadataResultV1) => void): this;
2357
+ /**
2358
+ * Set session configured callback (optional)
2359
+ */
2360
+ onSessionConfigured(callback: (config: SessionConfiguredV1) => void): this;
2278
2361
  /**
2279
2362
  * Set error callback
2280
2363
  */
@@ -2737,5 +2820,5 @@ declare function getRecognitionConductorHttpBase(stage?: Stage | string | null |
2737
2820
  declare function getRecognitionConductorWsBase(stage?: Stage | string | null | undefined): string;
2738
2821
  declare function getRecognitionConductorHost(stage?: Stage | string | null | undefined): string;
2739
2822
 
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 };
2823
+ export { AudioEncoding, CartesiaModel, ClientControlActionV1, ClientState, ConfigBuilder, ConnectionError, ControlSignalTypeV1 as ControlSignal, ControlSignalTypeV1, DashScopeModel, DeepgramModel, ElevenLabsModel, ErrorTypeV1, FinalTranscriptStability, FireworksModel, GeminiModel, GladiaModel, GoogleModel, Language, MistralVoxtralModel, OpenAIModel, OpenAIRealtimeModel, RECOGNITION_CONDUCTOR_BASES, RECOGNITION_SERVICE_BASES, RealTimeTwoWayWebSocketRecognitionClient, RecognitionContextTypeV1, RecognitionError, RecognitionProvider, RecognitionResultTypeV1, RecognitionVGFStateSchema, RecordingStatus, STAGES, SampleRate, SelfServeVllmModel, SimplifiedVGFRecognitionClient, TimeoutError, TranscriptionStatus, ValidationError, createClient, createClientWithBuilder, createDefaultASRConfig, createInitialRecognitionState, createSimplifiedVGFClient, getRecognitionConductorBase, getRecognitionConductorHost, getRecognitionConductorHttpBase, getRecognitionConductorWsBase, getRecognitionServiceBase, getRecognitionServiceHost, getRecognitionServiceHttpBase, getRecognitionServiceWsBase, getUserFriendlyMessage, isExceptionImmediatelyAvailable, isNormalDisconnection, isValidRecordingStatusTransition, normalizeStage, resetRecognitionVGFState };
2741
2824
  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 };
package/dist/index.d.ts CHANGED
@@ -11,6 +11,6 @@ export { type RecognitionState, RecognitionVGFStateSchema, RecordingStatus, Tran
11
11
  export { resetRecognitionVGFState } from './vgf-recognition-mapper.js';
12
12
  export { AudioEncoding } from '@recog/websocket';
13
13
  export { type GameContextV1, type SlotMap, RecognitionContextTypeV1, ControlSignalTypeV1, ControlSignalTypeV1 as ControlSignal, // Alias for backward compatibility
14
- type TranscriptionResultV1, type FunctionCallResultV1, type MetadataResultV1, type ErrorResultV1, RecognitionResultTypeV1, ClientControlActionV1, type ASRRequestConfig, type ASRRequestV1, FinalTranscriptStability, createDefaultASRConfig, RecognitionProvider, DeepgramModel, ElevenLabsModel, FireworksModel, GoogleModel, GeminiModel, OpenAIModel, OpenAIRealtimeModel, MistralVoxtralModel, DashScopeModel, Language, SampleRate, STAGES, type Stage } from '@recog/shared-types';
14
+ type TranscriptionResultV1, type FunctionCallResultV1, type MetadataResultV1, type ErrorResultV1, RecognitionResultTypeV1, ClientControlActionV1, type ASRRequestConfig, type ASRRequestV1, FinalTranscriptStability, createDefaultASRConfig, RecognitionProvider, DeepgramModel, ElevenLabsModel, FireworksModel, GladiaModel, GoogleModel, GeminiModel, OpenAIModel, SelfServeVllmModel, OpenAIRealtimeModel, MistralVoxtralModel, CartesiaModel, DashScopeModel, Language, SampleRate, STAGES, type Stage } from '@recog/shared-types';
15
15
  export { getRecognitionServiceBase, getRecognitionServiceHttpBase, getRecognitionServiceWsBase, getRecognitionServiceHost, getRecognitionConductorBase, getRecognitionConductorHttpBase, getRecognitionConductorWsBase, getRecognitionConductorHost, normalizeStage, RECOGNITION_SERVICE_BASES, RECOGNITION_CONDUCTOR_BASES } from '@recog/shared-config';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wCAAwC,EACxC,KAAK,8CAA8C,EACnD,KAAK,mBAAmB,EACxB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGrE,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,eAAe,EAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,+BAA+B,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