@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 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-chat'),
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-chat' | 'deepseek-reasoner' | 'deepseek-v4-flash-vision-exp' | (string & {});
7
- declare const deepseekLanguageModelChatOptions: z.ZodObject<{
8
- thinking: z.ZodOptional<z.ZodObject<{
9
- type: z.ZodOptional<z.ZodEnum<{
10
- adaptive: "adaptive";
11
- enabled: "enabled";
12
- disabled: "disabled";
13
- }>>;
14
- }, z.core.$strip>>;
15
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
16
- low: "low";
17
- medium: "medium";
18
- high: "high";
19
- xhigh: "xhigh";
20
- max: "max";
21
- }>>;
22
- strictJsonSchema: z.ZodOptional<z.ZodBoolean>;
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 DeepSeekLanguageModelChatOptions = z.infer<typeof deepseekLanguageModelChatOptions>;
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 };