@ai-sdk/deepgram 3.0.0-beta.2 → 3.0.0-beta.21

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,164 @@
1
1
  # @ai-sdk/deepgram
2
2
 
3
+ ## 3.0.0-beta.21
4
+
5
+ ### Patch Changes
6
+
7
+ - b3976a2: Add workflow serialization support to all provider models.
8
+
9
+ **`@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.
10
+
11
+ **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.
12
+
13
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
14
+
15
+ - Updated dependencies [b3976a2]
16
+ - Updated dependencies [ff5eba1]
17
+ - @ai-sdk/provider-utils@5.0.0-beta.20
18
+ - @ai-sdk/provider@4.0.0-beta.12
19
+
20
+ ## 3.0.0-beta.20
21
+
22
+ ### Major Changes
23
+
24
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [ef992f8]
29
+ - @ai-sdk/provider@4.0.0-beta.11
30
+ - @ai-sdk/provider-utils@5.0.0-beta.19
31
+
32
+ ## 3.0.0-beta.19
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [90e2d8a]
37
+ - @ai-sdk/provider-utils@5.0.0-beta.18
38
+
39
+ ## 3.0.0-beta.18
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies [3ae1786]
44
+ - @ai-sdk/provider-utils@5.0.0-beta.17
45
+
46
+ ## 3.0.0-beta.17
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [176466a]
51
+ - @ai-sdk/provider@4.0.0-beta.10
52
+ - @ai-sdk/provider-utils@5.0.0-beta.16
53
+
54
+ ## 3.0.0-beta.16
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [e311194]
59
+ - @ai-sdk/provider@4.0.0-beta.9
60
+ - @ai-sdk/provider-utils@5.0.0-beta.15
61
+
62
+ ## 3.0.0-beta.15
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [34bd95d]
67
+ - Updated dependencies [008271d]
68
+ - @ai-sdk/provider@4.0.0-beta.8
69
+ - @ai-sdk/provider-utils@5.0.0-beta.14
70
+
71
+ ## 3.0.0-beta.14
72
+
73
+ ### Patch Changes
74
+
75
+ - Updated dependencies [b0c2869]
76
+ - Updated dependencies [7e26e81]
77
+ - @ai-sdk/provider-utils@5.0.0-beta.13
78
+
79
+ ## 3.0.0-beta.13
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [46d1149]
84
+ - @ai-sdk/provider-utils@5.0.0-beta.12
85
+
86
+ ## 3.0.0-beta.12
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [6fd51c0]
91
+ - @ai-sdk/provider-utils@5.0.0-beta.11
92
+ - @ai-sdk/provider@4.0.0-beta.7
93
+
94
+ ## 3.0.0-beta.11
95
+
96
+ ### Patch Changes
97
+
98
+ - Updated dependencies [c29a26f]
99
+ - @ai-sdk/provider-utils@5.0.0-beta.10
100
+ - @ai-sdk/provider@4.0.0-beta.6
101
+
102
+ ## 3.0.0-beta.10
103
+
104
+ ### Patch Changes
105
+
106
+ - 38fc777: Add AI Gateway hint to provider READMEs
107
+
108
+ ## 3.0.0-beta.9
109
+
110
+ ### Patch Changes
111
+
112
+ - Updated dependencies [2e17091]
113
+ - @ai-sdk/provider-utils@5.0.0-beta.9
114
+
115
+ ## 3.0.0-beta.8
116
+
117
+ ### Patch Changes
118
+
119
+ - Updated dependencies [986c6fd]
120
+ - Updated dependencies [493295c]
121
+ - @ai-sdk/provider-utils@5.0.0-beta.8
122
+
123
+ ## 3.0.0-beta.7
124
+
125
+ ### Patch Changes
126
+
127
+ - Updated dependencies [1f509d4]
128
+ - @ai-sdk/provider-utils@5.0.0-beta.7
129
+ - @ai-sdk/provider@4.0.0-beta.5
130
+
131
+ ## 3.0.0-beta.6
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [3887c70]
136
+ - @ai-sdk/provider-utils@5.0.0-beta.6
137
+ - @ai-sdk/provider@4.0.0-beta.4
138
+
139
+ ## 3.0.0-beta.5
140
+
141
+ ### Patch Changes
142
+
143
+ - Updated dependencies [776b617]
144
+ - @ai-sdk/provider-utils@5.0.0-beta.5
145
+ - @ai-sdk/provider@4.0.0-beta.3
146
+
147
+ ## 3.0.0-beta.4
148
+
149
+ ### Patch Changes
150
+
151
+ - Updated dependencies [61753c3]
152
+ - @ai-sdk/provider-utils@5.0.0-beta.4
153
+
154
+ ## 3.0.0-beta.3
155
+
156
+ ### Patch Changes
157
+
158
+ - Updated dependencies [f7d4f01]
159
+ - @ai-sdk/provider-utils@5.0.0-beta.3
160
+ - @ai-sdk/provider@4.0.0-beta.2
161
+
3
162
  ## 3.0.0-beta.2
4
163
 
5
164
  ### Patch Changes
@@ -218,13 +377,13 @@
218
377
  Before
219
378
 
220
379
  ```ts
221
- model.textEmbeddingModel('my-model-id');
380
+ model.textEmbeddingModel("my-model-id");
222
381
  ```
223
382
 
224
383
  After
225
384
 
226
385
  ```ts
227
- model.embeddingModel('my-model-id');
386
+ model.embeddingModel("my-model-id");
228
387
  ```
229
388
 
230
389
  - 7f91f36: feat(deepgram): add language detection support
@@ -440,13 +599,13 @@
440
599
  Before
441
600
 
442
601
  ```ts
443
- model.textEmbeddingModel('my-model-id');
602
+ model.textEmbeddingModel("my-model-id");
444
603
  ```
445
604
 
446
605
  After
447
606
 
448
607
  ```ts
449
- model.embeddingModel('my-model-id');
608
+ model.embeddingModel("my-model-id");
450
609
  ```
451
610
 
452
611
  - 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,7 +9,7 @@ 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
  };
@@ -41,30 +42,38 @@ interface DeepgramTranscriptionModelConfig extends DeepgramConfig {
41
42
  currentDate?: () => Date;
42
43
  };
43
44
  }
44
- declare class DeepgramTranscriptionModel implements TranscriptionModelV3 {
45
+ declare class DeepgramTranscriptionModel implements TranscriptionModelV4 {
45
46
  readonly modelId: DeepgramTranscriptionModelId;
46
47
  private readonly config;
47
- readonly specificationVersion = "v3";
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<TranscriptionModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV3['doGenerate']>>>;
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 ProviderV3 {
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): TranscriptionModelV3;
72
+ transcription(modelId: DeepgramTranscriptionModelId): TranscriptionModelV4;
64
73
  /**
65
74
  * Creates a model for speech generation.
66
75
  */
67
- speech(modelId: DeepgramSpeechModelId): SpeechModelV3;
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 SpeechModelV3 {
125
+ declare class DeepgramSpeechModel implements SpeechModelV4 {
117
126
  readonly modelId: DeepgramSpeechModelId;
118
127
  private readonly config;
119
- readonly specificationVersion = "v3";
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<SpeechModelV3['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV3['doGenerate']>>>;
140
+ doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
124
141
  }
125
142
 
126
143
  declare const VERSION: string;