@ai-sdk/deepseek 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 +226 -4
- package/README.md +2 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +133 -218
- package/dist/index.js.map +1 -1
- package/package.json +9 -10
- package/src/chat/convert-to-deepseek-chat-messages.ts +16 -10
- package/src/chat/convert-to-deepseek-usage.ts +2 -2
- package/src/chat/deepseek-chat-language-model.ts +51 -156
- package/src/chat/deepseek-prepare-tools.ts +5 -5
- package/src/chat/map-deepseek-finish-reason.ts +2 -2
- package/src/deepseek-provider.ts +7 -7
- package/dist/index.d.mts +0 -68
- package/dist/index.mjs +0 -819
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,227 @@
|
|
|
1
1
|
# @ai-sdk/deepseek
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.30
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0498012: fix(provider/deepseek): preserve reasoning_content for deepseek-v4 in multi-turn requests
|
|
8
|
+
- 58a2ad7: fix: more precise default message for tool execution denial
|
|
9
|
+
- Updated dependencies [785fe16]
|
|
10
|
+
- Updated dependencies [67df0a0]
|
|
11
|
+
- Updated dependencies [befb78c]
|
|
12
|
+
- Updated dependencies [0458559]
|
|
13
|
+
- Updated dependencies [5852c0a]
|
|
14
|
+
- Updated dependencies [fc92055]
|
|
15
|
+
- @ai-sdk/provider-utils@5.0.0-beta.27
|
|
16
|
+
|
|
17
|
+
## 3.0.0-beta.29
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [2e98477]
|
|
22
|
+
- @ai-sdk/provider-utils@5.0.0-beta.26
|
|
23
|
+
|
|
24
|
+
## 3.0.0-beta.28
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [eea8d98]
|
|
29
|
+
- @ai-sdk/provider-utils@5.0.0-beta.25
|
|
30
|
+
|
|
31
|
+
## 3.0.0-beta.27
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- f807e45: Extract shared `StreamingToolCallTracker` class into `@ai-sdk/provider-utils` to deduplicate streaming tool call handling across OpenAI-compatible providers. Also adds missing `generateId()` fallback for `toolCallId` in Alibaba's `doGenerate` path and ensures all providers finalize unfinished tool calls during stream flush.
|
|
36
|
+
- Updated dependencies [f807e45]
|
|
37
|
+
- @ai-sdk/provider-utils@5.0.0-beta.24
|
|
38
|
+
|
|
39
|
+
## 3.0.0-beta.26
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- Updated dependencies [350ea38]
|
|
44
|
+
- @ai-sdk/provider-utils@5.0.0-beta.23
|
|
45
|
+
|
|
46
|
+
## 3.0.0-beta.25
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- Updated dependencies [083947b]
|
|
51
|
+
- @ai-sdk/provider-utils@5.0.0-beta.22
|
|
52
|
+
|
|
53
|
+
## 3.0.0-beta.24
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [add1126]
|
|
58
|
+
- @ai-sdk/provider-utils@5.0.0-beta.21
|
|
59
|
+
|
|
60
|
+
## 3.0.0-beta.23
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
65
|
+
|
|
66
|
+
**`@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.
|
|
67
|
+
|
|
68
|
+
**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.
|
|
69
|
+
|
|
70
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
71
|
+
|
|
72
|
+
- Updated dependencies [b3976a2]
|
|
73
|
+
- Updated dependencies [ff5eba1]
|
|
74
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
75
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
76
|
+
|
|
77
|
+
## 3.0.0-beta.22
|
|
78
|
+
|
|
79
|
+
### Major Changes
|
|
80
|
+
|
|
81
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- Updated dependencies [ef992f8]
|
|
86
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
87
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
88
|
+
|
|
89
|
+
## 3.0.0-beta.21
|
|
90
|
+
|
|
91
|
+
### Patch Changes
|
|
92
|
+
|
|
93
|
+
- Updated dependencies [90e2d8a]
|
|
94
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
95
|
+
|
|
96
|
+
## 3.0.0-beta.20
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- Updated dependencies [3ae1786]
|
|
101
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
102
|
+
|
|
103
|
+
## 3.0.0-beta.19
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- Updated dependencies [176466a]
|
|
108
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
109
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
110
|
+
|
|
111
|
+
## 3.0.0-beta.18
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Updated dependencies [e311194]
|
|
116
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
117
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
118
|
+
|
|
119
|
+
## 3.0.0-beta.17
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- Updated dependencies [34bd95d]
|
|
124
|
+
- Updated dependencies [008271d]
|
|
125
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
126
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
127
|
+
|
|
128
|
+
## 3.0.0-beta.16
|
|
129
|
+
|
|
130
|
+
### Patch Changes
|
|
131
|
+
|
|
132
|
+
- Updated dependencies [b0c2869]
|
|
133
|
+
- Updated dependencies [7e26e81]
|
|
134
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
135
|
+
|
|
136
|
+
## 3.0.0-beta.15
|
|
137
|
+
|
|
138
|
+
### Patch Changes
|
|
139
|
+
|
|
140
|
+
- Updated dependencies [46d1149]
|
|
141
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
142
|
+
|
|
143
|
+
## 3.0.0-beta.14
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies [6fd51c0]
|
|
148
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
149
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
150
|
+
|
|
151
|
+
## 3.0.0-beta.13
|
|
152
|
+
|
|
153
|
+
### Patch Changes
|
|
154
|
+
|
|
155
|
+
- Updated dependencies [c29a26f]
|
|
156
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
157
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
158
|
+
|
|
159
|
+
## 3.0.0-beta.12
|
|
160
|
+
|
|
161
|
+
### Patch Changes
|
|
162
|
+
|
|
163
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
164
|
+
|
|
165
|
+
## 3.0.0-beta.11
|
|
166
|
+
|
|
167
|
+
### Patch Changes
|
|
168
|
+
|
|
169
|
+
- Updated dependencies [2e17091]
|
|
170
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
171
|
+
|
|
172
|
+
## 3.0.0-beta.10
|
|
173
|
+
|
|
174
|
+
### Patch Changes
|
|
175
|
+
|
|
176
|
+
- Updated dependencies [986c6fd]
|
|
177
|
+
- Updated dependencies [493295c]
|
|
178
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
179
|
+
|
|
180
|
+
## 3.0.0-beta.9
|
|
181
|
+
|
|
182
|
+
### Patch Changes
|
|
183
|
+
|
|
184
|
+
- Updated dependencies [1f509d4]
|
|
185
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
186
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
187
|
+
|
|
188
|
+
## 3.0.0-beta.8
|
|
189
|
+
|
|
190
|
+
### Patch Changes
|
|
191
|
+
|
|
192
|
+
- 74d520f: feat: migrate providers to support new top-level `reasoning` parameter
|
|
193
|
+
|
|
194
|
+
## 3.0.0-beta.7
|
|
195
|
+
|
|
196
|
+
### Patch Changes
|
|
197
|
+
|
|
198
|
+
- Updated dependencies [3887c70]
|
|
199
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
200
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
201
|
+
|
|
202
|
+
## 3.0.0-beta.6
|
|
203
|
+
|
|
204
|
+
### Patch Changes
|
|
205
|
+
|
|
206
|
+
- Updated dependencies [776b617]
|
|
207
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
208
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
209
|
+
|
|
210
|
+
## 3.0.0-beta.5
|
|
211
|
+
|
|
212
|
+
### Patch Changes
|
|
213
|
+
|
|
214
|
+
- Updated dependencies [61753c3]
|
|
215
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
216
|
+
|
|
217
|
+
## 3.0.0-beta.4
|
|
218
|
+
|
|
219
|
+
### Patch Changes
|
|
220
|
+
|
|
221
|
+
- Updated dependencies [f7d4f01]
|
|
222
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
223
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
224
|
+
|
|
3
225
|
## 3.0.0-beta.3
|
|
4
226
|
|
|
5
227
|
### Patch Changes
|
|
@@ -228,13 +450,13 @@
|
|
|
228
450
|
Before
|
|
229
451
|
|
|
230
452
|
```ts
|
|
231
|
-
model.textEmbeddingModel(
|
|
453
|
+
model.textEmbeddingModel("my-model-id");
|
|
232
454
|
```
|
|
233
455
|
|
|
234
456
|
After
|
|
235
457
|
|
|
236
458
|
```ts
|
|
237
|
-
model.embeddingModel(
|
|
459
|
+
model.embeddingModel("my-model-id");
|
|
238
460
|
```
|
|
239
461
|
|
|
240
462
|
- 2625a04: feat(openai); update spec for mcp approval
|
|
@@ -451,13 +673,13 @@
|
|
|
451
673
|
Before
|
|
452
674
|
|
|
453
675
|
```ts
|
|
454
|
-
model.textEmbeddingModel(
|
|
676
|
+
model.textEmbeddingModel("my-model-id");
|
|
455
677
|
```
|
|
456
678
|
|
|
457
679
|
After
|
|
458
680
|
|
|
459
681
|
```ts
|
|
460
|
-
model.embeddingModel(
|
|
682
|
+
model.embeddingModel("my-model-id");
|
|
461
683
|
```
|
|
462
684
|
|
|
463
685
|
- Updated dependencies [8d9e8ad]
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The **[DeepSeek provider](https://ai-sdk.dev/providers/ai-sdk-providers/deepseek)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the [DeepSeek](https://www.deepseek.com) platform.
|
|
4
4
|
|
|
5
|
+
> **Deploying to Vercel?** With Vercel's AI Gateway you can access DeepSeek (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).
|
|
6
|
+
|
|
5
7
|
## Setup
|
|
6
8
|
|
|
7
9
|
The DeepSeek provider is available in the `@ai-sdk/deepseek` module. You can install it with
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
import { z } from 'zod/v4';
|
|
4
4
|
|
|
@@ -32,19 +32,19 @@ interface DeepSeekProviderSettings {
|
|
|
32
32
|
*/
|
|
33
33
|
fetch?: FetchFunction;
|
|
34
34
|
}
|
|
35
|
-
interface DeepSeekProvider extends
|
|
35
|
+
interface DeepSeekProvider extends ProviderV4 {
|
|
36
36
|
/**
|
|
37
37
|
* Creates a DeepSeek model for text generation.
|
|
38
38
|
*/
|
|
39
|
-
(modelId: DeepSeekChatModelId):
|
|
39
|
+
(modelId: DeepSeekChatModelId): LanguageModelV4;
|
|
40
40
|
/**
|
|
41
41
|
* Creates a DeepSeek model for text generation.
|
|
42
42
|
*/
|
|
43
|
-
languageModel(modelId: DeepSeekChatModelId):
|
|
43
|
+
languageModel(modelId: DeepSeekChatModelId): LanguageModelV4;
|
|
44
44
|
/**
|
|
45
45
|
* Creates a DeepSeek chat model for text generation.
|
|
46
46
|
*/
|
|
47
|
-
chat(modelId: DeepSeekChatModelId):
|
|
47
|
+
chat(modelId: DeepSeekChatModelId): LanguageModelV4;
|
|
48
48
|
/**
|
|
49
49
|
* @deprecated Use `embeddingModel` instead.
|
|
50
50
|
*/
|