@ai-sdk/deepgram 3.0.0-beta.3 → 3.0.0-beta.30
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 +229 -4
- package/README.md +2 -0
- package/dist/index.d.ts +29 -12
- package/dist/index.js +123 -114
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/deepgram-config.ts +2 -2
- package/src/deepgram-provider.ts +11 -11
- package/src/deepgram-speech-model.ts +27 -10
- package/src/deepgram-transcription-model.ts +28 -11
- package/dist/index.d.mts +0 -128
- package/dist/index.mjs +0 -650
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,230 @@
|
|
|
1
1
|
# @ai-sdk/deepgram
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.30
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
|
|
8
|
+
- Updated dependencies [9bd6512]
|
|
9
|
+
- Updated dependencies [258c093]
|
|
10
|
+
- Updated dependencies [b6783da]
|
|
11
|
+
- @ai-sdk/provider-utils@5.0.0-beta.29
|
|
12
|
+
- @ai-sdk/provider@4.0.0-beta.14
|
|
13
|
+
|
|
14
|
+
## 3.0.0-beta.29
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 9f0e36c: trigger release for all packages after provenance setup
|
|
19
|
+
- Updated dependencies [9f0e36c]
|
|
20
|
+
- @ai-sdk/provider@4.0.0-beta.13
|
|
21
|
+
- @ai-sdk/provider-utils@5.0.0-beta.28
|
|
22
|
+
|
|
23
|
+
## 3.0.0-beta.28
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [785fe16]
|
|
28
|
+
- Updated dependencies [67df0a0]
|
|
29
|
+
- Updated dependencies [befb78c]
|
|
30
|
+
- Updated dependencies [0458559]
|
|
31
|
+
- Updated dependencies [5852c0a]
|
|
32
|
+
- Updated dependencies [fc92055]
|
|
33
|
+
- @ai-sdk/provider-utils@5.0.0-beta.27
|
|
34
|
+
|
|
35
|
+
## 3.0.0-beta.27
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [2e98477]
|
|
40
|
+
- @ai-sdk/provider-utils@5.0.0-beta.26
|
|
41
|
+
|
|
42
|
+
## 3.0.0-beta.26
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [eea8d98]
|
|
47
|
+
- @ai-sdk/provider-utils@5.0.0-beta.25
|
|
48
|
+
|
|
49
|
+
## 3.0.0-beta.25
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies [f807e45]
|
|
54
|
+
- @ai-sdk/provider-utils@5.0.0-beta.24
|
|
55
|
+
|
|
56
|
+
## 3.0.0-beta.24
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- Updated dependencies [350ea38]
|
|
61
|
+
- @ai-sdk/provider-utils@5.0.0-beta.23
|
|
62
|
+
|
|
63
|
+
## 3.0.0-beta.23
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [083947b]
|
|
68
|
+
- @ai-sdk/provider-utils@5.0.0-beta.22
|
|
69
|
+
|
|
70
|
+
## 3.0.0-beta.22
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [add1126]
|
|
75
|
+
- @ai-sdk/provider-utils@5.0.0-beta.21
|
|
76
|
+
|
|
77
|
+
## 3.0.0-beta.21
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
82
|
+
|
|
83
|
+
**`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
|
|
84
|
+
|
|
85
|
+
**All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
|
|
86
|
+
|
|
87
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
88
|
+
|
|
89
|
+
- Updated dependencies [b3976a2]
|
|
90
|
+
- Updated dependencies [ff5eba1]
|
|
91
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
92
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
93
|
+
|
|
94
|
+
## 3.0.0-beta.20
|
|
95
|
+
|
|
96
|
+
### Major Changes
|
|
97
|
+
|
|
98
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- Updated dependencies [ef992f8]
|
|
103
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
104
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
105
|
+
|
|
106
|
+
## 3.0.0-beta.19
|
|
107
|
+
|
|
108
|
+
### Patch Changes
|
|
109
|
+
|
|
110
|
+
- Updated dependencies [90e2d8a]
|
|
111
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
112
|
+
|
|
113
|
+
## 3.0.0-beta.18
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- Updated dependencies [3ae1786]
|
|
118
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
119
|
+
|
|
120
|
+
## 3.0.0-beta.17
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- Updated dependencies [176466a]
|
|
125
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
126
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
127
|
+
|
|
128
|
+
## 3.0.0-beta.16
|
|
129
|
+
|
|
130
|
+
### Patch Changes
|
|
131
|
+
|
|
132
|
+
- Updated dependencies [e311194]
|
|
133
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
134
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
135
|
+
|
|
136
|
+
## 3.0.0-beta.15
|
|
137
|
+
|
|
138
|
+
### Patch Changes
|
|
139
|
+
|
|
140
|
+
- Updated dependencies [34bd95d]
|
|
141
|
+
- Updated dependencies [008271d]
|
|
142
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
143
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
144
|
+
|
|
145
|
+
## 3.0.0-beta.14
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- Updated dependencies [b0c2869]
|
|
150
|
+
- Updated dependencies [7e26e81]
|
|
151
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
152
|
+
|
|
153
|
+
## 3.0.0-beta.13
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- Updated dependencies [46d1149]
|
|
158
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
159
|
+
|
|
160
|
+
## 3.0.0-beta.12
|
|
161
|
+
|
|
162
|
+
### Patch Changes
|
|
163
|
+
|
|
164
|
+
- Updated dependencies [6fd51c0]
|
|
165
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
166
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
167
|
+
|
|
168
|
+
## 3.0.0-beta.11
|
|
169
|
+
|
|
170
|
+
### Patch Changes
|
|
171
|
+
|
|
172
|
+
- Updated dependencies [c29a26f]
|
|
173
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
174
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
175
|
+
|
|
176
|
+
## 3.0.0-beta.10
|
|
177
|
+
|
|
178
|
+
### Patch Changes
|
|
179
|
+
|
|
180
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
181
|
+
|
|
182
|
+
## 3.0.0-beta.9
|
|
183
|
+
|
|
184
|
+
### Patch Changes
|
|
185
|
+
|
|
186
|
+
- Updated dependencies [2e17091]
|
|
187
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
188
|
+
|
|
189
|
+
## 3.0.0-beta.8
|
|
190
|
+
|
|
191
|
+
### Patch Changes
|
|
192
|
+
|
|
193
|
+
- Updated dependencies [986c6fd]
|
|
194
|
+
- Updated dependencies [493295c]
|
|
195
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
196
|
+
|
|
197
|
+
## 3.0.0-beta.7
|
|
198
|
+
|
|
199
|
+
### Patch Changes
|
|
200
|
+
|
|
201
|
+
- Updated dependencies [1f509d4]
|
|
202
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
203
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
204
|
+
|
|
205
|
+
## 3.0.0-beta.6
|
|
206
|
+
|
|
207
|
+
### Patch Changes
|
|
208
|
+
|
|
209
|
+
- Updated dependencies [3887c70]
|
|
210
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
211
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
212
|
+
|
|
213
|
+
## 3.0.0-beta.5
|
|
214
|
+
|
|
215
|
+
### Patch Changes
|
|
216
|
+
|
|
217
|
+
- Updated dependencies [776b617]
|
|
218
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
219
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
220
|
+
|
|
221
|
+
## 3.0.0-beta.4
|
|
222
|
+
|
|
223
|
+
### Patch Changes
|
|
224
|
+
|
|
225
|
+
- Updated dependencies [61753c3]
|
|
226
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
227
|
+
|
|
3
228
|
## 3.0.0-beta.3
|
|
4
229
|
|
|
5
230
|
### Patch Changes
|
|
@@ -226,13 +451,13 @@
|
|
|
226
451
|
Before
|
|
227
452
|
|
|
228
453
|
```ts
|
|
229
|
-
model.textEmbeddingModel(
|
|
454
|
+
model.textEmbeddingModel("my-model-id");
|
|
230
455
|
```
|
|
231
456
|
|
|
232
457
|
After
|
|
233
458
|
|
|
234
459
|
```ts
|
|
235
|
-
model.embeddingModel(
|
|
460
|
+
model.embeddingModel("my-model-id");
|
|
236
461
|
```
|
|
237
462
|
|
|
238
463
|
- 7f91f36: feat(deepgram): add language detection support
|
|
@@ -448,13 +673,13 @@
|
|
|
448
673
|
Before
|
|
449
674
|
|
|
450
675
|
```ts
|
|
451
|
-
model.textEmbeddingModel(
|
|
676
|
+
model.textEmbeddingModel("my-model-id");
|
|
452
677
|
```
|
|
453
678
|
|
|
454
679
|
After
|
|
455
680
|
|
|
456
681
|
```ts
|
|
457
|
-
model.embeddingModel(
|
|
682
|
+
model.embeddingModel("my-model-id");
|
|
458
683
|
```
|
|
459
684
|
|
|
460
685
|
- Updated dependencies [8d9e8ad]
|
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
The **[Deepgram provider](https://ai-sdk.dev/providers/ai-sdk-providers/deepgram)** for the [AI SDK](https://ai-sdk.dev/docs)
|
|
4
4
|
contains transcription model support for the Deepgram transcription API and speech model support for the Deepgram text-to-speech API.
|
|
5
5
|
|
|
6
|
+
> **Deploying to Vercel?** With Vercel's AI Gateway you can access Deepgram (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
|
|
7
|
+
|
|
6
8
|
## Setup
|
|
7
9
|
|
|
8
10
|
The Deepgram provider is available in the `@ai-sdk/deepgram` module. You can install it with
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as _ai_sdk_provider from '@ai-sdk/provider';
|
|
2
|
+
import { TranscriptionModelV4, ProviderV4, SpeechModelV4 } from '@ai-sdk/provider';
|
|
3
|
+
import { FetchFunction, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@ai-sdk/provider-utils';
|
|
3
4
|
import { z } from 'zod/v4';
|
|
4
5
|
|
|
5
6
|
type DeepgramConfig = {
|
|
@@ -8,7 +9,7 @@ type DeepgramConfig = {
|
|
|
8
9
|
modelId: string;
|
|
9
10
|
path: string;
|
|
10
11
|
}) => string;
|
|
11
|
-
headers
|
|
12
|
+
headers?: () => Record<string, string | undefined>;
|
|
12
13
|
fetch?: FetchFunction;
|
|
13
14
|
generateId?: () => string;
|
|
14
15
|
};
|
|
@@ -41,30 +42,38 @@ interface DeepgramTranscriptionModelConfig extends DeepgramConfig {
|
|
|
41
42
|
currentDate?: () => Date;
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
|
-
declare class DeepgramTranscriptionModel implements
|
|
45
|
+
declare class DeepgramTranscriptionModel implements TranscriptionModelV4 {
|
|
45
46
|
readonly modelId: DeepgramTranscriptionModelId;
|
|
46
47
|
private readonly config;
|
|
47
|
-
readonly specificationVersion = "
|
|
48
|
+
readonly specificationVersion = "v4";
|
|
48
49
|
get provider(): string;
|
|
50
|
+
static [WORKFLOW_SERIALIZE](model: DeepgramTranscriptionModel): {
|
|
51
|
+
modelId: string;
|
|
52
|
+
config: _ai_sdk_provider.JSONObject;
|
|
53
|
+
};
|
|
54
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
55
|
+
modelId: DeepgramTranscriptionModelId;
|
|
56
|
+
config: DeepgramTranscriptionModelConfig;
|
|
57
|
+
}): DeepgramTranscriptionModel;
|
|
49
58
|
constructor(modelId: DeepgramTranscriptionModelId, config: DeepgramTranscriptionModelConfig);
|
|
50
59
|
private getArgs;
|
|
51
|
-
doGenerate(options: Parameters<
|
|
60
|
+
doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
|
|
52
61
|
}
|
|
53
62
|
|
|
54
63
|
type DeepgramSpeechModelId = 'aura-asteria-en' | 'aura-2-asteria-en' | 'aura-2-thalia-en' | 'aura-2-helena-en' | 'aura-2-orpheus-en' | 'aura-2-zeus-en' | 'aura-luna-en' | 'aura-stella-en' | (string & {});
|
|
55
64
|
|
|
56
|
-
interface DeepgramProvider extends
|
|
65
|
+
interface DeepgramProvider extends ProviderV4 {
|
|
57
66
|
(modelId: 'nova-3', settings?: {}): {
|
|
58
67
|
transcription: DeepgramTranscriptionModel;
|
|
59
68
|
};
|
|
60
69
|
/**
|
|
61
70
|
* Creates a model for transcription.
|
|
62
71
|
*/
|
|
63
|
-
transcription(modelId: DeepgramTranscriptionModelId):
|
|
72
|
+
transcription(modelId: DeepgramTranscriptionModelId): TranscriptionModelV4;
|
|
64
73
|
/**
|
|
65
74
|
* Creates a model for speech generation.
|
|
66
75
|
*/
|
|
67
|
-
speech(modelId: DeepgramSpeechModelId):
|
|
76
|
+
speech(modelId: DeepgramSpeechModelId): SpeechModelV4;
|
|
68
77
|
/**
|
|
69
78
|
* @deprecated Use `embeddingModel` instead.
|
|
70
79
|
*/
|
|
@@ -113,14 +122,22 @@ interface DeepgramSpeechModelConfig extends DeepgramConfig {
|
|
|
113
122
|
currentDate?: () => Date;
|
|
114
123
|
};
|
|
115
124
|
}
|
|
116
|
-
declare class DeepgramSpeechModel implements
|
|
125
|
+
declare class DeepgramSpeechModel implements SpeechModelV4 {
|
|
117
126
|
readonly modelId: DeepgramSpeechModelId;
|
|
118
127
|
private readonly config;
|
|
119
|
-
readonly specificationVersion = "
|
|
128
|
+
readonly specificationVersion = "v4";
|
|
120
129
|
get provider(): string;
|
|
130
|
+
static [WORKFLOW_SERIALIZE](model: DeepgramSpeechModel): {
|
|
131
|
+
modelId: string;
|
|
132
|
+
config: _ai_sdk_provider.JSONObject;
|
|
133
|
+
};
|
|
134
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
135
|
+
modelId: DeepgramSpeechModelId;
|
|
136
|
+
config: DeepgramSpeechModelConfig;
|
|
137
|
+
}): DeepgramSpeechModel;
|
|
121
138
|
constructor(modelId: DeepgramSpeechModelId, config: DeepgramSpeechModelConfig);
|
|
122
139
|
private getArgs;
|
|
123
|
-
doGenerate(options: Parameters<
|
|
140
|
+
doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
|
|
124
141
|
}
|
|
125
142
|
|
|
126
143
|
declare const VERSION: string;
|