@ai-sdk/deepgram 3.0.0-beta.3 → 3.0.0-beta.31

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
@@ -1,5 +1,243 @@
1
1
  # @ai-sdk/deepgram
2
2
 
3
+ ## 3.0.0-beta.31
4
+
5
+ ### Major Changes
6
+
7
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
8
+
9
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [08d2129]
14
+ - @ai-sdk/provider-utils@5.0.0-beta.30
15
+
16
+ ## 3.0.0-beta.30
17
+
18
+ ### Patch Changes
19
+
20
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
21
+ - Updated dependencies [9bd6512]
22
+ - Updated dependencies [258c093]
23
+ - Updated dependencies [b6783da]
24
+ - @ai-sdk/provider-utils@5.0.0-beta.29
25
+ - @ai-sdk/provider@4.0.0-beta.14
26
+
27
+ ## 3.0.0-beta.29
28
+
29
+ ### Patch Changes
30
+
31
+ - 9f0e36c: trigger release for all packages after provenance setup
32
+ - Updated dependencies [9f0e36c]
33
+ - @ai-sdk/provider@4.0.0-beta.13
34
+ - @ai-sdk/provider-utils@5.0.0-beta.28
35
+
36
+ ## 3.0.0-beta.28
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [785fe16]
41
+ - Updated dependencies [67df0a0]
42
+ - Updated dependencies [befb78c]
43
+ - Updated dependencies [0458559]
44
+ - Updated dependencies [5852c0a]
45
+ - Updated dependencies [fc92055]
46
+ - @ai-sdk/provider-utils@5.0.0-beta.27
47
+
48
+ ## 3.0.0-beta.27
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [2e98477]
53
+ - @ai-sdk/provider-utils@5.0.0-beta.26
54
+
55
+ ## 3.0.0-beta.26
56
+
57
+ ### Patch Changes
58
+
59
+ - Updated dependencies [eea8d98]
60
+ - @ai-sdk/provider-utils@5.0.0-beta.25
61
+
62
+ ## 3.0.0-beta.25
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [f807e45]
67
+ - @ai-sdk/provider-utils@5.0.0-beta.24
68
+
69
+ ## 3.0.0-beta.24
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [350ea38]
74
+ - @ai-sdk/provider-utils@5.0.0-beta.23
75
+
76
+ ## 3.0.0-beta.23
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [083947b]
81
+ - @ai-sdk/provider-utils@5.0.0-beta.22
82
+
83
+ ## 3.0.0-beta.22
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [add1126]
88
+ - @ai-sdk/provider-utils@5.0.0-beta.21
89
+
90
+ ## 3.0.0-beta.21
91
+
92
+ ### Patch Changes
93
+
94
+ - b3976a2: Add workflow serialization support to all provider models.
95
+
96
+ **`@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.
97
+
98
+ **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.
99
+
100
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
101
+
102
+ - Updated dependencies [b3976a2]
103
+ - Updated dependencies [ff5eba1]
104
+ - @ai-sdk/provider-utils@5.0.0-beta.20
105
+ - @ai-sdk/provider@4.0.0-beta.12
106
+
107
+ ## 3.0.0-beta.20
108
+
109
+ ### Major Changes
110
+
111
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies [ef992f8]
116
+ - @ai-sdk/provider@4.0.0-beta.11
117
+ - @ai-sdk/provider-utils@5.0.0-beta.19
118
+
119
+ ## 3.0.0-beta.19
120
+
121
+ ### Patch Changes
122
+
123
+ - Updated dependencies [90e2d8a]
124
+ - @ai-sdk/provider-utils@5.0.0-beta.18
125
+
126
+ ## 3.0.0-beta.18
127
+
128
+ ### Patch Changes
129
+
130
+ - Updated dependencies [3ae1786]
131
+ - @ai-sdk/provider-utils@5.0.0-beta.17
132
+
133
+ ## 3.0.0-beta.17
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [176466a]
138
+ - @ai-sdk/provider@4.0.0-beta.10
139
+ - @ai-sdk/provider-utils@5.0.0-beta.16
140
+
141
+ ## 3.0.0-beta.16
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies [e311194]
146
+ - @ai-sdk/provider@4.0.0-beta.9
147
+ - @ai-sdk/provider-utils@5.0.0-beta.15
148
+
149
+ ## 3.0.0-beta.15
150
+
151
+ ### Patch Changes
152
+
153
+ - Updated dependencies [34bd95d]
154
+ - Updated dependencies [008271d]
155
+ - @ai-sdk/provider@4.0.0-beta.8
156
+ - @ai-sdk/provider-utils@5.0.0-beta.14
157
+
158
+ ## 3.0.0-beta.14
159
+
160
+ ### Patch Changes
161
+
162
+ - Updated dependencies [b0c2869]
163
+ - Updated dependencies [7e26e81]
164
+ - @ai-sdk/provider-utils@5.0.0-beta.13
165
+
166
+ ## 3.0.0-beta.13
167
+
168
+ ### Patch Changes
169
+
170
+ - Updated dependencies [46d1149]
171
+ - @ai-sdk/provider-utils@5.0.0-beta.12
172
+
173
+ ## 3.0.0-beta.12
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies [6fd51c0]
178
+ - @ai-sdk/provider-utils@5.0.0-beta.11
179
+ - @ai-sdk/provider@4.0.0-beta.7
180
+
181
+ ## 3.0.0-beta.11
182
+
183
+ ### Patch Changes
184
+
185
+ - Updated dependencies [c29a26f]
186
+ - @ai-sdk/provider-utils@5.0.0-beta.10
187
+ - @ai-sdk/provider@4.0.0-beta.6
188
+
189
+ ## 3.0.0-beta.10
190
+
191
+ ### Patch Changes
192
+
193
+ - 38fc777: Add AI Gateway hint to provider READMEs
194
+
195
+ ## 3.0.0-beta.9
196
+
197
+ ### Patch Changes
198
+
199
+ - Updated dependencies [2e17091]
200
+ - @ai-sdk/provider-utils@5.0.0-beta.9
201
+
202
+ ## 3.0.0-beta.8
203
+
204
+ ### Patch Changes
205
+
206
+ - Updated dependencies [986c6fd]
207
+ - Updated dependencies [493295c]
208
+ - @ai-sdk/provider-utils@5.0.0-beta.8
209
+
210
+ ## 3.0.0-beta.7
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [1f509d4]
215
+ - @ai-sdk/provider-utils@5.0.0-beta.7
216
+ - @ai-sdk/provider@4.0.0-beta.5
217
+
218
+ ## 3.0.0-beta.6
219
+
220
+ ### Patch Changes
221
+
222
+ - Updated dependencies [3887c70]
223
+ - @ai-sdk/provider-utils@5.0.0-beta.6
224
+ - @ai-sdk/provider@4.0.0-beta.4
225
+
226
+ ## 3.0.0-beta.5
227
+
228
+ ### Patch Changes
229
+
230
+ - Updated dependencies [776b617]
231
+ - @ai-sdk/provider-utils@5.0.0-beta.5
232
+ - @ai-sdk/provider@4.0.0-beta.3
233
+
234
+ ## 3.0.0-beta.4
235
+
236
+ ### Patch Changes
237
+
238
+ - Updated dependencies [61753c3]
239
+ - @ai-sdk/provider-utils@5.0.0-beta.4
240
+
3
241
  ## 3.0.0-beta.3
4
242
 
5
243
  ### Patch Changes
@@ -226,13 +464,13 @@
226
464
  Before
227
465
 
228
466
  ```ts
229
- model.textEmbeddingModel('my-model-id');
467
+ model.textEmbeddingModel("my-model-id");
230
468
  ```
231
469
 
232
470
  After
233
471
 
234
472
  ```ts
235
- model.embeddingModel('my-model-id');
473
+ model.embeddingModel("my-model-id");
236
474
  ```
237
475
 
238
476
  - 7f91f36: feat(deepgram): add language detection support
@@ -448,13 +686,13 @@
448
686
  Before
449
687
 
450
688
  ```ts
451
- model.textEmbeddingModel('my-model-id');
689
+ model.textEmbeddingModel("my-model-id");
452
690
  ```
453
691
 
454
692
  After
455
693
 
456
694
  ```ts
457
- model.embeddingModel('my-model-id');
695
+ model.embeddingModel("my-model-id");
458
696
  ```
459
697
 
460
698
  - 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 { TranscriptionModelV3, ProviderV3, SpeechModelV3 } from '@ai-sdk/provider';
2
- import { FetchFunction } from '@ai-sdk/provider-utils';
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,63 +9,50 @@ type DeepgramConfig = {
8
9
  modelId: string;
9
10
  path: string;
10
11
  }) => string;
11
- headers: () => Record<string, string | undefined>;
12
+ headers?: () => Record<string, string | undefined>;
12
13
  fetch?: FetchFunction;
13
14
  generateId?: () => string;
14
15
  };
15
16
 
16
17
  type DeepgramTranscriptionModelId = 'base' | 'base-general' | 'base-meeting' | 'base-phonecall' | 'base-finance' | 'base-conversationalai' | 'base-voicemail' | 'base-video' | 'enhanced' | 'enhanced-general' | 'enhanced-meeting' | 'enhanced-phonecall' | 'enhanced-finance' | 'nova' | 'nova-general' | 'nova-phonecall' | 'nova-medical' | 'nova-2' | 'nova-2-general' | 'nova-2-meeting' | 'nova-2-phonecall' | 'nova-2-finance' | 'nova-2-conversationalai' | 'nova-2-voicemail' | 'nova-2-video' | 'nova-2-medical' | 'nova-2-drivethru' | 'nova-2-automotive' | 'nova-2-atc' | 'nova-3' | 'nova-3-general' | 'nova-3-medical' | (string & {});
17
18
 
18
- declare const deepgramTranscriptionModelOptionsSchema: z.ZodObject<{
19
- language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
- detectLanguage: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
21
- smartFormat: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
22
- punctuate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
23
- paragraphs: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
24
- summarize: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"v2">, z.ZodLiteral<false>]>>>;
25
- topics: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
26
- intents: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
27
- sentiment: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
28
- detectEntities: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
29
- redact: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
30
- replace: z.ZodOptional<z.ZodNullable<z.ZodString>>;
31
- search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
32
- keyterm: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- diarize: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
34
- utterances: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
35
- uttSplit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
36
- fillerWords: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
37
- }, z.core.$strip>;
38
- type DeepgramTranscriptionModelOptions = z.infer<typeof deepgramTranscriptionModelOptionsSchema>;
39
19
  interface DeepgramTranscriptionModelConfig extends DeepgramConfig {
40
20
  _internal?: {
41
21
  currentDate?: () => Date;
42
22
  };
43
23
  }
44
- declare class DeepgramTranscriptionModel implements TranscriptionModelV3 {
24
+ declare class DeepgramTranscriptionModel implements TranscriptionModelV4 {
45
25
  readonly modelId: DeepgramTranscriptionModelId;
46
26
  private readonly config;
47
- readonly specificationVersion = "v3";
27
+ readonly specificationVersion = "v4";
48
28
  get provider(): string;
29
+ static [WORKFLOW_SERIALIZE](model: DeepgramTranscriptionModel): {
30
+ modelId: string;
31
+ config: _ai_sdk_provider.JSONObject;
32
+ };
33
+ static [WORKFLOW_DESERIALIZE](options: {
34
+ modelId: DeepgramTranscriptionModelId;
35
+ config: DeepgramTranscriptionModelConfig;
36
+ }): DeepgramTranscriptionModel;
49
37
  constructor(modelId: DeepgramTranscriptionModelId, config: DeepgramTranscriptionModelConfig);
50
38
  private getArgs;
51
- doGenerate(options: Parameters<TranscriptionModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV3['doGenerate']>>>;
39
+ doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
52
40
  }
53
41
 
54
42
  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
43
 
56
- interface DeepgramProvider extends ProviderV3 {
44
+ interface DeepgramProvider extends ProviderV4 {
57
45
  (modelId: 'nova-3', settings?: {}): {
58
46
  transcription: DeepgramTranscriptionModel;
59
47
  };
60
48
  /**
61
49
  * Creates a model for transcription.
62
50
  */
63
- transcription(modelId: DeepgramTranscriptionModelId): TranscriptionModelV3;
51
+ transcription(modelId: DeepgramTranscriptionModelId): TranscriptionModelV4;
64
52
  /**
65
53
  * Creates a model for speech generation.
66
54
  */
67
- speech(modelId: DeepgramSpeechModelId): SpeechModelV3;
55
+ speech(modelId: DeepgramSpeechModelId): SpeechModelV4;
68
56
  /**
69
57
  * @deprecated Use `embeddingModel` instead.
70
58
  */
@@ -94,6 +82,29 @@ declare function createDeepgram(options?: DeepgramProviderSettings): DeepgramPro
94
82
  */
95
83
  declare const deepgram: DeepgramProvider;
96
84
 
85
+ interface DeepgramSpeechModelConfig extends DeepgramConfig {
86
+ _internal?: {
87
+ currentDate?: () => Date;
88
+ };
89
+ }
90
+ declare class DeepgramSpeechModel implements SpeechModelV4 {
91
+ readonly modelId: DeepgramSpeechModelId;
92
+ private readonly config;
93
+ readonly specificationVersion = "v4";
94
+ get provider(): string;
95
+ static [WORKFLOW_SERIALIZE](model: DeepgramSpeechModel): {
96
+ modelId: string;
97
+ config: _ai_sdk_provider.JSONObject;
98
+ };
99
+ static [WORKFLOW_DESERIALIZE](options: {
100
+ modelId: DeepgramSpeechModelId;
101
+ config: DeepgramSpeechModelConfig;
102
+ }): DeepgramSpeechModel;
103
+ constructor(modelId: DeepgramSpeechModelId, config: DeepgramSpeechModelConfig);
104
+ private getArgs;
105
+ doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
106
+ }
107
+
97
108
  declare const deepgramSpeechModelOptionsSchema: z.ZodObject<{
98
109
  bitRate: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
99
110
  container: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -108,20 +119,28 @@ declare const deepgramSpeechModelOptionsSchema: z.ZodObject<{
108
119
  tag: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
109
120
  }, z.core.$strip>;
110
121
  type DeepgramSpeechModelOptions = z.infer<typeof deepgramSpeechModelOptionsSchema>;
111
- interface DeepgramSpeechModelConfig extends DeepgramConfig {
112
- _internal?: {
113
- currentDate?: () => Date;
114
- };
115
- }
116
- declare class DeepgramSpeechModel implements SpeechModelV3 {
117
- readonly modelId: DeepgramSpeechModelId;
118
- private readonly config;
119
- readonly specificationVersion = "v3";
120
- get provider(): string;
121
- constructor(modelId: DeepgramSpeechModelId, config: DeepgramSpeechModelConfig);
122
- private getArgs;
123
- doGenerate(options: Parameters<SpeechModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV3['doGenerate']>>>;
124
- }
122
+
123
+ declare const deepgramTranscriptionModelOptionsSchema: z.ZodObject<{
124
+ language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
125
+ detectLanguage: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
126
+ smartFormat: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
127
+ punctuate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
128
+ paragraphs: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
129
+ summarize: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"v2">, z.ZodLiteral<false>]>>>;
130
+ topics: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
131
+ intents: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
132
+ sentiment: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
133
+ detectEntities: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
134
+ redact: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
135
+ replace: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
+ search: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ keyterm: z.ZodOptional<z.ZodNullable<z.ZodString>>;
138
+ diarize: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
139
+ utterances: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
140
+ uttSplit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
141
+ fillerWords: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
142
+ }, z.core.$strip>;
143
+ type DeepgramTranscriptionModelOptions = z.infer<typeof deepgramTranscriptionModelOptionsSchema>;
125
144
 
126
145
  declare const VERSION: string;
127
146