@ai-sdk/deepseek 3.0.30 → 3.0.32
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 +31 -0
- package/README.md +1 -1
- package/dist/index.d.ts +57 -19
- package/dist/index.js +561 -123
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +54 -4
- package/dist/internal/index.js +455 -108
- package/dist/internal/index.js.map +1 -1
- package/docs/30-deepseek.mdx +306 -23
- package/package.json +6 -6
- package/src/chat/convert-to-deepseek-chat-messages.ts +166 -19
- package/src/chat/convert-to-deepseek-usage.ts +1 -1
- package/src/chat/deepseek-chat-api-types.ts +50 -5
- package/src/chat/deepseek-chat-language-model-options.ts +102 -11
- package/src/chat/deepseek-chat-language-model.ts +193 -19
- package/src/chat/deepseek-file-part-options.ts +24 -0
- package/src/chat/deepseek-prepare-tools.ts +29 -3
- package/src/deepseek-provider.ts +2 -0
- package/src/files/deepseek-files-api.ts +9 -5
- package/src/files/deepseek-files.ts +129 -4
- package/src/index.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @ai-sdk/deepseek
|
|
2
2
|
|
|
3
|
+
## 3.0.32
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0e36ab5: Warn and omit deprecated or ineffective DeepSeek sampling options while
|
|
8
|
+
preserving penalty sampling for Azure-hosted DeepSeek models.
|
|
9
|
+
- 068be49: feat(provider/deepseek): add the `userId` chat option and serialize it as `user_id`
|
|
10
|
+
- 56d47f5: feat(provider/deepseek): add DeepSeek V4 Flash and Pro model IDs
|
|
11
|
+
- 49ba214: Validate DeepSeek file upload formats, sizes, and filename lengths before sending requests.
|
|
12
|
+
- 1ca2519: Add provider-specific names for DeepSeek system, user, and assistant messages.
|
|
13
|
+
- f2a2598: Validate DeepSeek strict tool calls against beta endpoint requirements.
|
|
14
|
+
- f8e24b6: Preserve documented DeepSeek chat response metadata for generate and stream.
|
|
15
|
+
- 320b700: Add DeepSeek chat completion log probability request and response support.
|
|
16
|
+
- f70bd8a: Add support for DeepSeek beta assistant prefix completion through message provider options.
|
|
17
|
+
- 2214258: Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.
|
|
18
|
+
- f1cadd0: Preserve the file object discriminator in DeepSeek upload provider metadata.
|
|
19
|
+
- 01fa8de: Validate DeepSeek file response discriminators and numeric metadata while preserving compatibility with omitted optional metadata.
|
|
20
|
+
- 348dacb: Expose DeepSeek response system fingerprints in provider metadata for generated and streamed text.
|
|
21
|
+
- 560fc39: Align DeepSeek thinking and reasoning effort options with the documented API values while mapping legacy options with compatibility warnings.
|
|
22
|
+
- 2814b2d: Add DeepSeek image detail and inline file-data content part support.
|
|
23
|
+
- Updated dependencies [591d25b]
|
|
24
|
+
- @ai-sdk/provider@4.0.8
|
|
25
|
+
- @ai-sdk/provider-utils@5.0.30
|
|
26
|
+
|
|
27
|
+
## 3.0.31
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [b74971f]
|
|
32
|
+
- @ai-sdk/provider-utils@5.0.29
|
|
33
|
+
|
|
3
34
|
## 3.0.30
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ import { deepseek } from '@ai-sdk/deepseek';
|
|
|
35
35
|
import { generateText } from 'ai';
|
|
36
36
|
|
|
37
37
|
const { text } = await generateText({
|
|
38
|
-
model: deepseek('deepseek-
|
|
38
|
+
model: deepseek('deepseek-v4-flash'),
|
|
39
39
|
prompt: 'Write a JavaScript function that sorts a list:',
|
|
40
40
|
});
|
|
41
41
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -3,25 +3,52 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
|
3
3
|
import { FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
|
|
4
4
|
import { z } from 'zod/v4';
|
|
5
5
|
|
|
6
|
-
type DeepSeekChatModelId = 'deepseek-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
type DeepSeekChatModelId = 'deepseek-v4-flash' | 'deepseek-v4-pro' | 'deepseek-v4-flash-vision-exp' | (string & {});
|
|
7
|
+
type DeepSeekLanguageModelChatOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to return log probabilities for generated tokens.
|
|
10
|
+
*/
|
|
11
|
+
logprobs?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Number of most likely tokens to return at each token position.
|
|
14
|
+
*
|
|
15
|
+
* Setting this option automatically enables `logprobs`.
|
|
16
|
+
*/
|
|
17
|
+
topLogprobs?: number;
|
|
18
|
+
/**
|
|
19
|
+
* An opaque identifier for the end user. DeepSeek uses this identifier for
|
|
20
|
+
* content-safety tracing and request isolation.
|
|
21
|
+
*
|
|
22
|
+
* Must contain only ASCII letters, numbers, underscores, and hyphens, and
|
|
23
|
+
* must be at most 512 characters long.
|
|
24
|
+
*/
|
|
25
|
+
userId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Controls whether thinking mode is enabled. Defaults to `enabled`.
|
|
28
|
+
*/
|
|
29
|
+
thinking?: {
|
|
30
|
+
type?: 'enabled' | 'disabled';
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Controls the thinking strength for DeepSeek V4 reasoning models.
|
|
34
|
+
*/
|
|
35
|
+
reasoningEffort?: 'low' | 'high' | 'max';
|
|
36
|
+
/**
|
|
37
|
+
* Whether to use strict JSON schema validation for structured outputs.
|
|
38
|
+
* Only applies when the serving endpoint supports JSON schema response
|
|
39
|
+
* formats (e.g. Azure). Defaults to `true`.
|
|
40
|
+
*/
|
|
41
|
+
strictJsonSchema?: boolean;
|
|
42
|
+
};
|
|
43
|
+
declare const deepseekMessageProviderOptions: z.ZodObject<{
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
type DeepSeekMessageProviderOptions = z.infer<typeof deepseekMessageProviderOptions>;
|
|
47
|
+
declare const deepseekAssistantMessageProviderOptions: z.ZodObject<{
|
|
48
|
+
name: z.ZodOptional<z.ZodString>;
|
|
49
|
+
prefix: z.ZodOptional<z.ZodLiteral<true>>;
|
|
23
50
|
}, z.core.$strip>;
|
|
24
|
-
type
|
|
51
|
+
type DeepSeekAssistantMessageProviderOptions = z.infer<typeof deepseekAssistantMessageProviderOptions>;
|
|
25
52
|
|
|
26
53
|
interface DeepSeekProviderSettings {
|
|
27
54
|
/**
|
|
@@ -79,9 +106,20 @@ declare const deepSeekErrorSchema: z.ZodObject<{
|
|
|
79
106
|
}, z.core.$strip>;
|
|
80
107
|
type DeepSeekErrorData = z.infer<typeof deepSeekErrorSchema>;
|
|
81
108
|
|
|
109
|
+
declare const deepseekFilePartProviderOptions: z.ZodObject<{
|
|
110
|
+
imageDetail: z.ZodOptional<z.ZodEnum<{
|
|
111
|
+
low: "low";
|
|
112
|
+
high: "high";
|
|
113
|
+
original: "original";
|
|
114
|
+
auto: "auto";
|
|
115
|
+
}>>;
|
|
116
|
+
fileData: z.ZodOptional<z.ZodLiteral<true>>;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
type DeepSeekFilePartProviderOptions = z.infer<typeof deepseekFilePartProviderOptions>;
|
|
119
|
+
|
|
82
120
|
declare const deepSeekFilesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
83
121
|
expiresAfter?: number | undefined;
|
|
84
122
|
}>;
|
|
85
123
|
type DeepSeekFilesOptions = InferSchema<typeof deepSeekFilesOptionsSchema>;
|
|
86
124
|
|
|
87
|
-
export { type DeepSeekLanguageModelChatOptions as DeepSeekChatOptions, type DeepSeekErrorData, type DeepSeekFilesOptions, type DeepSeekLanguageModelChatOptions, type DeepSeekLanguageModelChatOptions as DeepSeekLanguageModelOptions, type DeepSeekProvider, type DeepSeekProviderSettings, VERSION, createDeepSeek, deepSeek, deepSeek as deepseek };
|
|
125
|
+
export { type DeepSeekAssistantMessageProviderOptions, type DeepSeekLanguageModelChatOptions as DeepSeekChatOptions, type DeepSeekErrorData, type DeepSeekFilePartProviderOptions, type DeepSeekFilesOptions, type DeepSeekLanguageModelChatOptions, type DeepSeekLanguageModelChatOptions as DeepSeekLanguageModelOptions, type DeepSeekMessageProviderOptions, type DeepSeekProvider, type DeepSeekProviderSettings, VERSION, createDeepSeek, deepSeek, deepSeek as deepseek };
|