voice-router-dev 0.8.3 → 0.8.5
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 +107 -1
- package/dist/constants.d.mts +7 -8
- package/dist/constants.d.ts +7 -8
- package/dist/constants.js +4 -8
- package/dist/constants.mjs +4 -8
- package/dist/{field-configs-t_lVCkE5.d.mts → field-configs-DXAGTUfv.d.mts} +3135 -1956
- package/dist/{field-configs-t_lVCkE5.d.ts → field-configs-DXAGTUfv.d.ts} +3135 -1956
- package/dist/field-configs.d.mts +1 -1
- package/dist/field-configs.d.ts +1 -1
- package/dist/field-configs.js +2320 -1634
- package/dist/field-configs.mjs +2320 -1634
- package/dist/index.d.mts +263 -711
- package/dist/index.d.ts +263 -711
- package/dist/index.js +2080 -1532
- package/dist/index.mjs +2080 -1531
- package/dist/{speechToTextChunkResponseModel-DjL2ncnf.d.ts → speechToTextChunkResponseModel-CmxWFIjf.d.ts} +1667 -1172
- package/dist/{speechToTextChunkResponseModel-DvIT4xai.d.mts → speechToTextChunkResponseModel-Dj3Weqv1.d.mts} +1667 -1172
- package/dist/webhooks.d.mts +9 -3
- package/dist/webhooks.d.ts +9 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -5,10 +5,116 @@ 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.
|
|
8
|
+
## [0.8.5] - 2026-04-07
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
#### AssemblyAI: Migrate to Live Docs Spec (100% OpenAPI Pipeline)
|
|
13
|
+
|
|
14
|
+
AssemblyAI deleted their `assemblyai-api-spec` GitHub repo, breaking `pnpm openapi:sync` with 404 errors. The spec source is now the live Fern-generated docs spec at `https://www.assemblyai.com/docs/openapi.json`.
|
|
15
|
+
|
|
16
|
+
**New pipeline** (follows the same pattern as ElevenLabs/OpenAI):
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
assemblyai.com/docs/openapi.json → fix-assemblyai-spec.js → Orval → adapter
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**`fix-assemblyai-spec.js`** normalizes the docs spec before Orval generation:
|
|
23
|
+
1. Filters paths to `/v2/*` STT endpoints (drops `/chat/completions`, `/understanding`, `/v3/token`)
|
|
24
|
+
2. Maps operationIds back to descriptive names (`submit` → `createTranscript`, `get` → `getTranscript`, etc.)
|
|
25
|
+
3. Strips inline `Authorization` header parameters (Orval handles auth via security schemes)
|
|
26
|
+
4. Collects `$ref` references, resolves transitive deps, removes unreferenced schemas
|
|
27
|
+
5. Fixes malformed array schemas and missing path parameters
|
|
28
|
+
6. Strips deprecated `speech_model` from `TranscriptParams` (see fix below)
|
|
29
|
+
|
|
30
|
+
**Schema changes from new spec:**
|
|
31
|
+
|
|
32
|
+
| Aspect | Old (v1.3.4, dead repo) | New (docs, live) |
|
|
33
|
+
|--------|------------------------|-------------------|
|
|
34
|
+
| `TranscriptParams` | Split: `TranscriptParams` + `TranscriptOptionalParams` | Single merged `TranscriptParams` |
|
|
35
|
+
| `language_code` | `string` | `TranscriptParamsLanguageCode` (proper enum) |
|
|
36
|
+
| `ListTranscriptParams` | Separate schema + 5 scalar types | Inline query params on `GET /v2/transcript` |
|
|
37
|
+
| LeMUR schemas | 7 schemas | Dropped (not STT) |
|
|
38
|
+
| Webhook notification schemas | 3 schemas | Dropped (handler uses local types) |
|
|
39
|
+
|
|
40
|
+
**Deleted:** `scripts/fix-assemblyai-missing-schemas.js` — the 5 scalar types (`AfterId`, `BeforeId`, `CreatedOn`, `Limit`, `ThrottledOnly`) are now inline query parameters in the new spec.
|
|
41
|
+
|
|
42
|
+
**No breaking changes for consumers.** API function names (`createTranscript`, `getTranscript`, etc.) are preserved via operationId mapping. The `assemblyai` passthrough options type changed from `Partial<TranscriptOptionalParams>` to `Partial<TranscriptParams>` — all fields from the old type exist in the new one.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
#### AssemblyAI: Strip Deprecated `speech_model` from Request Schema
|
|
47
|
+
|
|
48
|
+
The docs spec includes both `speech_model` (singular, deprecated) and `speech_models` (plural, required array) on `TranscriptParams`. The API rejects requests containing both fields with HTTP 400:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
"speech_model and speech_models cannot be used in the same request"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Two-level fix:**
|
|
55
|
+
|
|
56
|
+
1. **Spec level:** `fix-assemblyai-spec.js` strips `speech_model` from `TranscriptParams` before Orval generates types. This prevents it from appearing in generated Zod schemas and DynamicFieldForm UI.
|
|
57
|
+
|
|
58
|
+
2. **Adapter level:** If users pass `speech_model` via passthrough options (e.g., from older code), the adapter gracefully migrates it to `speech_models: [value]` instead of sending both fields.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// This still works — adapter migrates automatically
|
|
62
|
+
{ assemblyai: { speech_model: "universal-3-pro" } }
|
|
63
|
+
// → sent as: { speech_models: ["universal-3-pro"] }
|
|
64
|
+
|
|
65
|
+
// Preferred: use the new field directly
|
|
66
|
+
{ assemblyai: { speech_models: ["universal-3-pro", "universal-2"] } }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Note:** `speech_model` is preserved in the `Transcript` response schema (read-only — tells you which model was used).
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## [0.8.4] - 2026-04-06
|
|
9
74
|
|
|
10
75
|
### Fixed
|
|
11
76
|
|
|
77
|
+
#### AssemblyAI: Migrate `speech_model` → `speech_models` (API Breaking Change)
|
|
78
|
+
|
|
79
|
+
AssemblyAI deprecated the singular `speech_model` parameter and now requires `speech_models` (plural, array). The old field is rejected with HTTP 400:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
"speech_models" must be a non-empty list containing one or more of: "universal-3-pro", "universal-2"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**What changed:**
|
|
86
|
+
|
|
87
|
+
| | Before (0.8.3) | After (0.8.4) |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| **API field** | `speech_model: "best"` (singular, deprecated) | `speech_models: ["universal-3-pro"]` (array, required) |
|
|
90
|
+
| **Model values** | `best`, `slam-1`, `universal` | `universal-3-pro`, `universal-2` |
|
|
91
|
+
| **Constants** | `AssemblyAITranscriptionModel.best` | `AssemblyAITranscriptionModel["universal-3-pro"]` |
|
|
92
|
+
|
|
93
|
+
**Adapter fix:** `options.model` now maps to `request.speech_models = [model]` instead of `request.speech_model = model`.
|
|
94
|
+
|
|
95
|
+
**Generated types regenerated** from AssemblyAI's updated OpenAPI spec (v1.3.4):
|
|
96
|
+
- `SpeechModel` is now `string` (no enum — AssemblyAI removed the fixed list)
|
|
97
|
+
- `TranscriptOptionalParams.speech_models` added (required `SpeechModel[]`)
|
|
98
|
+
- `TranscriptOptionalParams.speech_model` marked `@deprecated`
|
|
99
|
+
- New response field: `speech_model_used` (which model actually ran)
|
|
100
|
+
|
|
101
|
+
**Migration:**
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// Before
|
|
105
|
+
import { AssemblyAITranscriptionModel } from 'voice-router-dev/constants'
|
|
106
|
+
{ model: AssemblyAITranscriptionModel.best }
|
|
107
|
+
|
|
108
|
+
// After
|
|
109
|
+
import { AssemblyAITranscriptionModel } from 'voice-router-dev/constants'
|
|
110
|
+
{ model: AssemblyAITranscriptionModel["universal-3-pro"] }
|
|
111
|
+
|
|
112
|
+
// Or pass directly via assemblyai-specific options for multi-model routing
|
|
113
|
+
{ assemblyai: { speech_models: ["universal-3-pro", "universal-2"] } }
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Note:** Streaming is unaffected — it still uses `speech_model` query parameter with streaming-specific model names (`universal-streaming-english`, `universal-streaming-multilingual`).
|
|
117
|
+
|
|
12
118
|
#### Unified Error Normalization Across All Providers
|
|
13
119
|
|
|
14
120
|
HTTP errors from all 8 providers now return semantic error codes and the actual provider error message instead of axios internals.
|
package/dist/constants.d.mts
CHANGED
|
@@ -2792,25 +2792,24 @@ declare const AssemblyAIEncoding: {
|
|
|
2792
2792
|
/**
|
|
2793
2793
|
* AssemblyAI batch transcription models
|
|
2794
2794
|
*
|
|
2795
|
-
*
|
|
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
|
-
* - `
|
|
2798
|
-
* - `
|
|
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
|
-
*
|
|
2806
|
+
* model: AssemblyAITranscriptionModel["universal-3-pro"]
|
|
2807
2807
|
* })
|
|
2808
2808
|
* ```
|
|
2809
2809
|
*/
|
|
2810
2810
|
declare const AssemblyAITranscriptionModel: {
|
|
2811
|
-
readonly
|
|
2812
|
-
readonly "
|
|
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.d.ts
CHANGED
|
@@ -2792,25 +2792,24 @@ declare const AssemblyAIEncoding: {
|
|
|
2792
2792
|
/**
|
|
2793
2793
|
* AssemblyAI batch transcription models
|
|
2794
2794
|
*
|
|
2795
|
-
*
|
|
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
|
-
* - `
|
|
2798
|
-
* - `
|
|
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
|
-
*
|
|
2806
|
+
* model: AssemblyAITranscriptionModel["universal-3-pro"]
|
|
2807
2807
|
* })
|
|
2808
2808
|
* ```
|
|
2809
2809
|
*/
|
|
2810
2810
|
declare const AssemblyAITranscriptionModel: {
|
|
2811
|
-
readonly
|
|
2812
|
-
readonly "
|
|
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 =
|
|
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 */
|
package/dist/constants.mjs
CHANGED
|
@@ -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 =
|
|
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 */
|