@ai-sdk/deepseek 3.0.92 → 3.0.93
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 +9 -0
- package/dist/index.d.ts +22 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -20
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +22 -2
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +73 -19
- package/dist/internal/index.js.map +1 -1
- package/package.json +8 -4
- package/src/deepseek-model-catalog.ts +131 -28
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/deepseek
|
|
2
2
|
|
|
3
|
+
## 3.0.93
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c7c8c49: refactor(deepseek): declare model capabilities per model ID
|
|
8
|
+
- Updated dependencies [f958ef0]
|
|
9
|
+
- @ai-sdk/provider@4.0.40
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.87
|
|
11
|
+
|
|
3
12
|
## 3.0.92
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -2,25 +2,45 @@ import { FilesV4, LanguageModelV4, ProviderV4 } from "@ai-sdk/provider";
|
|
|
2
2
|
import { FetchFunction, InferSchema, Resolvable } from "@ai-sdk/provider-utils";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
4
|
//#region src/deepseek-model-catalog.d.ts
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Language model matrix: model IDs by capability. To add a model, add a row
|
|
7
|
+
* and fill in every column.
|
|
8
|
+
*/
|
|
9
|
+
declare const languageModelDefinitions: {
|
|
6
10
|
readonly 'deepseek-flash': {
|
|
7
11
|
readonly endpoints: readonly ["chat", "responses"];
|
|
12
|
+
readonly documented: true;
|
|
8
13
|
readonly image: false;
|
|
14
|
+
readonly reasoningEfforts: readonly ["low", "high", "max"];
|
|
15
|
+
readonly thinkingByDefault: true;
|
|
16
|
+
readonly assistantHistory: true;
|
|
9
17
|
};
|
|
10
18
|
readonly 'deepseek-v4-flash': {
|
|
11
19
|
readonly endpoints: readonly ["chat"];
|
|
20
|
+
readonly documented: true;
|
|
12
21
|
readonly image: false;
|
|
22
|
+
readonly reasoningEfforts: readonly ["low", "high", "max"];
|
|
23
|
+
readonly thinkingByDefault: true;
|
|
24
|
+
readonly assistantHistory: true;
|
|
13
25
|
};
|
|
14
26
|
readonly 'deepseek-v4-pro': {
|
|
15
27
|
readonly endpoints: readonly ["chat", "responses"];
|
|
28
|
+
readonly documented: true;
|
|
16
29
|
readonly image: false;
|
|
30
|
+
readonly reasoningEfforts: readonly ["low", "high", "max"];
|
|
31
|
+
readonly thinkingByDefault: true;
|
|
32
|
+
readonly assistantHistory: true;
|
|
17
33
|
};
|
|
18
34
|
readonly 'deepseek-v4-flash-vision-exp': {
|
|
19
35
|
readonly endpoints: readonly ["chat"];
|
|
36
|
+
readonly documented: true;
|
|
20
37
|
readonly image: true;
|
|
38
|
+
readonly reasoningEfforts: readonly ["low", "high", "max"];
|
|
39
|
+
readonly thinkingByDefault: true;
|
|
40
|
+
readonly assistantHistory: true;
|
|
21
41
|
};
|
|
22
42
|
};
|
|
23
|
-
type DeepSeekEndpointModelId<Endpoint extends 'chat' | 'responses'> = { [ModelId in keyof typeof
|
|
43
|
+
type DeepSeekEndpointModelId<Endpoint extends 'chat' | 'responses'> = { [ModelId in keyof typeof languageModelDefinitions]: Endpoint extends (typeof languageModelDefinitions)[ModelId]['endpoints'][number] ? ModelId : never; }[keyof typeof languageModelDefinitions];
|
|
24
44
|
/** Known model IDs, derived from the declarations used to build the catalog. */
|
|
25
45
|
type DeepSeekModelIds = {
|
|
26
46
|
chat: DeepSeekEndpointModelId<'chat'>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/deepseek-model-catalog.ts","../src/chat/deepseek-chat-language-model-options.ts","../src/responses/deepseek-responses-language-model-options.ts","../src/tool/index.ts","../src/deepseek-provider.ts","../src/version.ts","../src/chat/deepseek-chat-api-types.ts","../src/chat/deepseek-file-part-options.ts","../src/files/deepseek-files-options.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/deepseek-model-catalog.ts","../src/chat/deepseek-chat-language-model-options.ts","../src/responses/deepseek-responses-language-model-options.ts","../src/tool/index.ts","../src/deepseek-provider.ts","../src/version.ts","../src/chat/deepseek-chat-api-types.ts","../src/chat/deepseek-file-part-options.ts","../src/files/deepseek-files-options.ts"],"mappings":";;;;;;;;cA8GM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmKD,wBAAwB,4CAC1B,wBAAwB,2BAA2B,yBAAyB,0BAA0B,gCACnG,gCAES;;KAGH;EACV,MAAM;EACN,WAAW;;;;KCjRD,sBAAsB;KAwEtB;;;;EAIV;;;;;;EAOA;;;;;;;;EASA;;;;EAKA;IACE;;;;;EAMF;;;;;;EAOA;;cAsBW,iEAA8B;EAAA;;KAI/B,iCAAiC,mBACpC;cAuBI,0EAAuC;;;;KAIxC,0CAA0C,mBAC7C;;;KC1KG,2BACR;KAoBQ;;;;EAIV;IACE;;;;;EAMF;;;;;EAMA;;;;;;;;EASA;;;;cChDW;;;;;;;;;;;UCkBI;;;;;EAKf,SAAS;;;;EAKT;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;UAGO,yBAAyB;;;;GAIvC,SAAS,sBAAsB;;;;EAKhC,cAAc,SAAS,sBAAsB;;;;EAK7C,KAAK,SAAS,sBAAsB;;;;;EAMpC,UAAU,SAAS,2BAA2B;;;;EAK9C,cAAc;;;;EAKd,SAAS;;;;EAKT,mBAAmB;;wBAGL,eACd,UAAS,2BACR;qBAoEU,UAAQ;;;qBCxJR;;;cCiJA,sDAAmB;;;;;;;;KAIpB,oBAAoB,mBAAmB;;;cChJtC,kEAA+B;;;;KAuBhC,kCAAkC,mBACrC;;;cCxBI,6DAA0B;EAAA;;KAY3B,uBAAuB,mBAC1B"}
|
package/dist/index.js
CHANGED
|
@@ -107,31 +107,68 @@ function getDeepseekAssistantMessageOptionsSchema() {
|
|
|
107
107
|
const deepseekAssistantMessageProviderOptions = lazySchema(() => zodSchema(getDeepseekAssistantMessageOptionsSchema()));
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/deepseek-model-catalog.ts
|
|
110
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Language model matrix: model IDs by capability. To add a model, add a row
|
|
112
|
+
* and fill in every column.
|
|
113
|
+
*/
|
|
114
|
+
const languageModelDefinitions = {
|
|
111
115
|
"deepseek-flash": {
|
|
112
116
|
endpoints: ["chat", "responses"],
|
|
113
|
-
|
|
117
|
+
documented: true,
|
|
118
|
+
image: false,
|
|
119
|
+
reasoningEfforts: [
|
|
120
|
+
"low",
|
|
121
|
+
"high",
|
|
122
|
+
"max"
|
|
123
|
+
],
|
|
124
|
+
thinkingByDefault: true,
|
|
125
|
+
assistantHistory: true
|
|
114
126
|
},
|
|
115
127
|
"deepseek-v4-flash": {
|
|
116
128
|
endpoints: ["chat"],
|
|
117
|
-
|
|
129
|
+
documented: true,
|
|
130
|
+
image: false,
|
|
131
|
+
reasoningEfforts: [
|
|
132
|
+
"low",
|
|
133
|
+
"high",
|
|
134
|
+
"max"
|
|
135
|
+
],
|
|
136
|
+
thinkingByDefault: true,
|
|
137
|
+
assistantHistory: true
|
|
118
138
|
},
|
|
119
139
|
"deepseek-v4-pro": {
|
|
120
140
|
endpoints: ["chat", "responses"],
|
|
121
|
-
|
|
141
|
+
documented: true,
|
|
142
|
+
image: false,
|
|
143
|
+
reasoningEfforts: [
|
|
144
|
+
"low",
|
|
145
|
+
"high",
|
|
146
|
+
"max"
|
|
147
|
+
],
|
|
148
|
+
thinkingByDefault: true,
|
|
149
|
+
assistantHistory: true
|
|
122
150
|
},
|
|
123
151
|
"deepseek-v4-flash-vision-exp": {
|
|
124
152
|
endpoints: ["chat"],
|
|
125
|
-
|
|
153
|
+
documented: true,
|
|
154
|
+
image: true,
|
|
155
|
+
reasoningEfforts: [
|
|
156
|
+
"low",
|
|
157
|
+
"high",
|
|
158
|
+
"max"
|
|
159
|
+
],
|
|
160
|
+
thinkingByDefault: true,
|
|
161
|
+
assistantHistory: true
|
|
126
162
|
}
|
|
127
163
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const support =
|
|
164
|
+
/** Maps a matrix row to its entry. Nothing here inspects the model ID. */
|
|
165
|
+
function createLanguageModelEntry(row) {
|
|
166
|
+
const support = row.documented ? true : "unknown";
|
|
167
|
+
const reasoningSupport = row.reasoningEfforts === "unknown" ? "unknown" : true;
|
|
131
168
|
const language = {
|
|
132
169
|
textGeneration: support,
|
|
133
170
|
inputs: {
|
|
134
|
-
image: image
|
|
171
|
+
image: row.image,
|
|
135
172
|
audio: false
|
|
136
173
|
},
|
|
137
174
|
objectGeneration: support,
|
|
@@ -141,15 +178,11 @@ function createLanguageModelEntry(modelId, image) {
|
|
|
141
178
|
strict: "unknown"
|
|
142
179
|
},
|
|
143
180
|
reasoning: {
|
|
144
|
-
support,
|
|
145
|
-
...
|
|
146
|
-
"low",
|
|
147
|
-
"high",
|
|
148
|
-
"max"
|
|
149
|
-
] } : {},
|
|
181
|
+
support: reasoningSupport,
|
|
182
|
+
...row.reasoningEfforts !== "unknown" ? { efforts: row.reasoningEfforts } : {},
|
|
150
183
|
configurable: true,
|
|
151
|
-
enabledByDefault:
|
|
152
|
-
assistantHistory
|
|
184
|
+
enabledByDefault: row.thinkingByDefault,
|
|
185
|
+
assistantHistory: row.assistantHistory
|
|
153
186
|
},
|
|
154
187
|
sampling: {
|
|
155
188
|
temperature: { condition: "Only effective when thinking is disabled." },
|
|
@@ -174,9 +207,30 @@ function createLanguageModelEntry(modelId, image) {
|
|
|
174
207
|
} }
|
|
175
208
|
};
|
|
176
209
|
}
|
|
177
|
-
const deepseekModelCatalog = Object.fromEntries(Object.entries(
|
|
210
|
+
const deepseekModelCatalog = Object.fromEntries(Object.entries(languageModelDefinitions).map(([modelId, row]) => [modelId, createLanguageModelEntry(row)]));
|
|
211
|
+
const unlistedModelsWithoutAssistantHistory = /(^|[/.])deepseek-(?:chat|reasoner|v[1-3](?:\.\d+)?)(?=[-/:.]|$)/;
|
|
212
|
+
/**
|
|
213
|
+
* Resolves a model ID that is not listed in the matrix to a row. This is the
|
|
214
|
+
* only place that looks at the model ID.
|
|
215
|
+
*/
|
|
216
|
+
function getUnlistedLanguageModelRow(modelId) {
|
|
217
|
+
const assistantHistory = !unlistedModelsWithoutAssistantHistory.test(modelId);
|
|
218
|
+
return {
|
|
219
|
+
endpoints: [],
|
|
220
|
+
documented: false,
|
|
221
|
+
image: "unknown",
|
|
222
|
+
reasoningEfforts: "unknown",
|
|
223
|
+
thinkingByDefault: modelId === "deepseek-reasoner" || assistantHistory,
|
|
224
|
+
assistantHistory
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Returns the entry of a model ID: from its row when it is listed, otherwise
|
|
229
|
+
* from the fallback for unlisted IDs. The serving endpoint's options are then
|
|
230
|
+
* applied on top.
|
|
231
|
+
*/
|
|
178
232
|
function getDeepSeekLanguageModelEntry(modelId, endpoint = {}) {
|
|
179
|
-
const entry = Object.prototype.hasOwnProperty.call(deepseekModelCatalog, modelId) ? deepseekModelCatalog[modelId] : createLanguageModelEntry(modelId);
|
|
233
|
+
const entry = Object.prototype.hasOwnProperty.call(deepseekModelCatalog, modelId) ? deepseekModelCatalog[modelId] : createLanguageModelEntry(getUnlistedLanguageModelRow(modelId));
|
|
180
234
|
const { language } = entry.capabilities;
|
|
181
235
|
return {
|
|
182
236
|
...entry,
|
|
@@ -2268,7 +2322,7 @@ const webSearch = (args = {}) => webSearchToolFactory(args);
|
|
|
2268
2322
|
const deepseekTools = { webSearch };
|
|
2269
2323
|
//#endregion
|
|
2270
2324
|
//#region src/version.ts
|
|
2271
|
-
const VERSION = "3.0.
|
|
2325
|
+
const VERSION = "3.0.93";
|
|
2272
2326
|
//#endregion
|
|
2273
2327
|
//#region src/deepseek-provider.ts
|
|
2274
2328
|
function createDeepSeek(options = {}) {
|