voice-router-dev 0.8.3 → 0.8.4

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/CHANGELOG.md CHANGED
@@ -5,10 +5,51 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.9.1] - 2026-04-05
8
+ ## [0.8.4] - 2026-04-06
9
9
 
10
10
  ### Fixed
11
11
 
12
+ #### AssemblyAI: Migrate `speech_model` → `speech_models` (API Breaking Change)
13
+
14
+ AssemblyAI deprecated the singular `speech_model` parameter and now requires `speech_models` (plural, array). The old field is rejected with HTTP 400:
15
+
16
+ ```
17
+ "speech_models" must be a non-empty list containing one or more of: "universal-3-pro", "universal-2"
18
+ ```
19
+
20
+ **What changed:**
21
+
22
+ | | Before (0.8.3) | After (0.8.4) |
23
+ |---|---|---|
24
+ | **API field** | `speech_model: "best"` (singular, deprecated) | `speech_models: ["universal-3-pro"]` (array, required) |
25
+ | **Model values** | `best`, `slam-1`, `universal` | `universal-3-pro`, `universal-2` |
26
+ | **Constants** | `AssemblyAITranscriptionModel.best` | `AssemblyAITranscriptionModel["universal-3-pro"]` |
27
+
28
+ **Adapter fix:** `options.model` now maps to `request.speech_models = [model]` instead of `request.speech_model = model`.
29
+
30
+ **Generated types regenerated** from AssemblyAI's updated OpenAPI spec (v1.3.4):
31
+ - `SpeechModel` is now `string` (no enum — AssemblyAI removed the fixed list)
32
+ - `TranscriptOptionalParams.speech_models` added (required `SpeechModel[]`)
33
+ - `TranscriptOptionalParams.speech_model` marked `@deprecated`
34
+ - New response field: `speech_model_used` (which model actually ran)
35
+
36
+ **Migration:**
37
+
38
+ ```typescript
39
+ // Before
40
+ import { AssemblyAITranscriptionModel } from 'voice-router-dev/constants'
41
+ { model: AssemblyAITranscriptionModel.best }
42
+
43
+ // After
44
+ import { AssemblyAITranscriptionModel } from 'voice-router-dev/constants'
45
+ { model: AssemblyAITranscriptionModel["universal-3-pro"] }
46
+
47
+ // Or pass directly via assemblyai-specific options for multi-model routing
48
+ { assemblyai: { speech_models: ["universal-3-pro", "universal-2"] } }
49
+ ```
50
+
51
+ **Note:** Streaming is unaffected — it still uses `speech_model` query parameter with streaming-specific model names (`universal-streaming-english`, `universal-streaming-multilingual`).
52
+
12
53
  #### Unified Error Normalization Across All Providers
13
54
 
14
55
  HTTP errors from all 8 providers now return semantic error codes and the actual provider error message instead of axios internals.
@@ -2792,25 +2792,24 @@ declare const AssemblyAIEncoding: {
2792
2792
  /**
2793
2793
  * AssemblyAI batch transcription models
2794
2794
  *
2795
- * Values: `best`, `slam-1`, `universal`
2795
+ * Uses the `speech_models` (plural) API parameter — pass as array.
2796
+ * AssemblyAI routes audio to the best available model from the list.
2796
2797
  *
2797
- * - `best`: Highest accuracy, best for most use cases (default)
2798
- * - `slam-1`: Speech-Language Aligned Model, optimized for specific domains
2799
- * - `universal`: General-purpose model with broad language support
2798
+ * - `universal-3-pro`: Highest accuracy, latest generation
2799
+ * - `universal-2`: Previous generation, broad language support
2800
2800
  *
2801
2801
  * @example
2802
2802
  * ```typescript
2803
2803
  * import { AssemblyAITranscriptionModel } from 'voice-router-dev/constants'
2804
2804
  *
2805
2805
  * await router.transcribe('assemblyai', audioUrl, {
2806
- * speechModel: AssemblyAITranscriptionModel.best
2806
+ * model: AssemblyAITranscriptionModel["universal-3-pro"]
2807
2807
  * })
2808
2808
  * ```
2809
2809
  */
2810
2810
  declare const AssemblyAITranscriptionModel: {
2811
- readonly best: "best";
2812
- readonly "slam-1": "slam-1";
2813
- readonly universal: "universal";
2811
+ readonly "universal-3-pro": "universal-3-pro";
2812
+ readonly "universal-2": "universal-2";
2814
2813
  };
2815
2814
  /**
2816
2815
  * AssemblyAI language codes for transcription
@@ -2792,25 +2792,24 @@ declare const AssemblyAIEncoding: {
2792
2792
  /**
2793
2793
  * AssemblyAI batch transcription models
2794
2794
  *
2795
- * Values: `best`, `slam-1`, `universal`
2795
+ * Uses the `speech_models` (plural) API parameter — pass as array.
2796
+ * AssemblyAI routes audio to the best available model from the list.
2796
2797
  *
2797
- * - `best`: Highest accuracy, best for most use cases (default)
2798
- * - `slam-1`: Speech-Language Aligned Model, optimized for specific domains
2799
- * - `universal`: General-purpose model with broad language support
2798
+ * - `universal-3-pro`: Highest accuracy, latest generation
2799
+ * - `universal-2`: Previous generation, broad language support
2800
2800
  *
2801
2801
  * @example
2802
2802
  * ```typescript
2803
2803
  * import { AssemblyAITranscriptionModel } from 'voice-router-dev/constants'
2804
2804
  *
2805
2805
  * await router.transcribe('assemblyai', audioUrl, {
2806
- * speechModel: AssemblyAITranscriptionModel.best
2806
+ * model: AssemblyAITranscriptionModel["universal-3-pro"]
2807
2807
  * })
2808
2808
  * ```
2809
2809
  */
2810
2810
  declare const AssemblyAITranscriptionModel: {
2811
- readonly best: "best";
2812
- readonly "slam-1": "slam-1";
2813
- readonly universal: "universal";
2811
+ readonly "universal-3-pro": "universal-3-pro";
2812
+ readonly "universal-2": "universal-2";
2814
2813
  };
2815
2814
  /**
2816
2815
  * AssemblyAI language codes for transcription
package/dist/constants.js CHANGED
@@ -2982,13 +2982,6 @@ var TranslationLanguageCodeEnum = {
2982
2982
  zh: "zh"
2983
2983
  };
2984
2984
 
2985
- // src/generated/assemblyai/schema/speechModel.ts
2986
- var SpeechModel = {
2987
- best: "best",
2988
- "slam-1": "slam-1",
2989
- universal: "universal"
2990
- };
2991
-
2992
2985
  // src/generated/assemblyai/schema/transcriptLanguageCode.ts
2993
2986
  var TranscriptLanguageCode = {
2994
2987
  en: "en",
@@ -3372,7 +3365,10 @@ var AssemblyAIEncoding = {
3372
3365
  /** μ-law (telephony) */
3373
3366
  pcmMulaw: "pcm_mulaw"
3374
3367
  };
3375
- var AssemblyAITranscriptionModel = SpeechModel;
3368
+ var AssemblyAITranscriptionModel = {
3369
+ "universal-3-pro": "universal-3-pro",
3370
+ "universal-2": "universal-2"
3371
+ };
3376
3372
  var AssemblyAILanguage = TranscriptLanguageCode;
3377
3373
  var AssemblyAISpeechModel = {
3378
3374
  /** Optimized for English */
@@ -2877,13 +2877,6 @@ var TranslationLanguageCodeEnum = {
2877
2877
  zh: "zh"
2878
2878
  };
2879
2879
 
2880
- // src/generated/assemblyai/schema/speechModel.ts
2881
- var SpeechModel = {
2882
- best: "best",
2883
- "slam-1": "slam-1",
2884
- universal: "universal"
2885
- };
2886
-
2887
2880
  // src/generated/assemblyai/schema/transcriptLanguageCode.ts
2888
2881
  var TranscriptLanguageCode = {
2889
2882
  en: "en",
@@ -3267,7 +3260,10 @@ var AssemblyAIEncoding = {
3267
3260
  /** μ-law (telephony) */
3268
3261
  pcmMulaw: "pcm_mulaw"
3269
3262
  };
3270
- var AssemblyAITranscriptionModel = SpeechModel;
3263
+ var AssemblyAITranscriptionModel = {
3264
+ "universal-3-pro": "universal-3-pro",
3265
+ "universal-2": "universal-2"
3266
+ };
3271
3267
  var AssemblyAILanguage = TranscriptLanguageCode;
3272
3268
  var AssemblyAISpeechModel = {
3273
3269
  /** Optimized for English */