@ai-sdk/deepseek 3.0.56 → 3.0.57

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,15 @@
1
1
  # @ai-sdk/deepseek
2
2
 
3
+ ## 3.0.57
4
+
5
+ ### Patch Changes
6
+
7
+ - ea54a10: fix cached input token reporting for OpenAI-compatible DeepSeek responses
8
+ - ede5b89: chore: migrate package builds from tsup to tsdown
9
+ - Updated dependencies [ede5b89]
10
+ - @ai-sdk/provider@4.0.20
11
+ - @ai-sdk/provider-utils@5.0.52
12
+
3
13
  ## 3.0.56
4
14
 
5
15
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,125 +1,130 @@
1
- import { ProviderV4, LanguageModelV4, FilesV4 } from '@ai-sdk/provider';
2
- import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
- import { FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
4
- import { z } from 'zod/v4';
5
-
1
+ import { FilesV4, LanguageModelV4, ProviderV4 } from "@ai-sdk/provider";
2
+ import { FetchFunction, InferSchema } from "@ai-sdk/provider-utils";
3
+ import { z } from "zod/v4";
4
+ //#region src/chat/deepseek-chat-language-model-options.d.ts
6
5
  type DeepSeekChatModelId = 'deepseek-flash' | 'deepseek-v4-flash' | 'deepseek-v4-pro' | 'deepseek-v4-flash-vision-exp' | (string & {});
7
6
  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;
7
+ /**
8
+ * Whether to return log probabilities for generated tokens.
9
+ */
10
+ logprobs?: boolean;
11
+ /**
12
+ * Number of most likely tokens to return at each token position.
13
+ *
14
+ * Setting this option automatically enables `logprobs`.
15
+ */
16
+ topLogprobs?: number;
17
+ /**
18
+ * An opaque identifier for the end user. DeepSeek uses this identifier for
19
+ * content-safety tracing and request isolation.
20
+ *
21
+ * Must contain only ASCII letters, numbers, underscores, and hyphens, and
22
+ * must be at most 512 characters long.
23
+ */
24
+ userId?: string;
25
+ /**
26
+ * Controls whether thinking mode is enabled. Defaults to `enabled`.
27
+ */
28
+ thinking?: {
29
+ type?: 'enabled' | 'disabled';
30
+ };
31
+ /**
32
+ * Controls the thinking strength for DeepSeek V4 reasoning models.
33
+ */
34
+ reasoningEffort?: 'low' | 'high' | 'max';
35
+ /**
36
+ * Whether to use strict JSON schema validation for structured outputs.
37
+ * Only applies when the serving endpoint supports JSON schema response
38
+ * formats (e.g. Azure). Defaults to `true`.
39
+ */
40
+ strictJsonSchema?: boolean;
42
41
  };
43
42
  declare const deepseekMessageProviderOptions: z.ZodObject<{
44
- name: z.ZodOptional<z.ZodString>;
43
+ name: z.ZodOptional<z.ZodString>;
45
44
  }, z.core.$strip>;
46
45
  type DeepSeekMessageProviderOptions = z.infer<typeof deepseekMessageProviderOptions>;
47
46
  declare const deepseekAssistantMessageProviderOptions: z.ZodObject<{
48
- name: z.ZodOptional<z.ZodString>;
49
- prefix: z.ZodOptional<z.ZodLiteral<true>>;
47
+ name: z.ZodOptional<z.ZodString>;
48
+ prefix: z.ZodOptional<z.ZodLiteral<true>>;
50
49
  }, z.core.$strip>;
51
50
  type DeepSeekAssistantMessageProviderOptions = z.infer<typeof deepseekAssistantMessageProviderOptions>;
52
-
51
+ //#endregion
52
+ //#region src/deepseek-provider.d.ts
53
53
  interface DeepSeekProviderSettings {
54
- /**
55
- * DeepSeek API key.
56
- */
57
- apiKey?: string;
58
- /**
59
- * Base URL for the API calls.
60
- */
61
- baseURL?: string;
62
- /**
63
- * Custom headers to include in the requests.
64
- */
65
- headers?: Record<string, string>;
66
- /**
67
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
68
- * or to provide a custom fetch implementation for e.g. testing.
69
- */
70
- fetch?: FetchFunction;
54
+ /**
55
+ * DeepSeek API key.
56
+ */
57
+ apiKey?: string;
58
+ /**
59
+ * Base URL for the API calls.
60
+ */
61
+ baseURL?: string;
62
+ /**
63
+ * Custom headers to include in the requests.
64
+ */
65
+ headers?: Record<string, string>;
66
+ /**
67
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
68
+ * or to provide a custom fetch implementation for e.g. testing.
69
+ */
70
+ fetch?: FetchFunction;
71
71
  }
72
72
  interface DeepSeekProvider extends ProviderV4 {
73
- /**
74
- * Creates a DeepSeek model for text generation.
75
- */
76
- (modelId: DeepSeekChatModelId): LanguageModelV4;
77
- /**
78
- * Creates a DeepSeek model for text generation.
79
- */
80
- languageModel(modelId: DeepSeekChatModelId): LanguageModelV4;
81
- /**
82
- * Creates a DeepSeek chat model for text generation.
83
- */
84
- chat(modelId: DeepSeekChatModelId): LanguageModelV4;
85
- /**
86
- * Creates a DeepSeek files interface for uploading images.
87
- */
88
- files(): FilesV4;
89
- /**
90
- * @deprecated Use `embeddingModel` instead.
91
- */
92
- textEmbeddingModel(modelId: string): never;
73
+ /**
74
+ * Creates a DeepSeek model for text generation.
75
+ */
76
+ (modelId: DeepSeekChatModelId): LanguageModelV4;
77
+ /**
78
+ * Creates a DeepSeek model for text generation.
79
+ */
80
+ languageModel(modelId: DeepSeekChatModelId): LanguageModelV4;
81
+ /**
82
+ * Creates a DeepSeek chat model for text generation.
83
+ */
84
+ chat(modelId: DeepSeekChatModelId): LanguageModelV4;
85
+ /**
86
+ * Creates a DeepSeek files interface for uploading images.
87
+ */
88
+ files(): FilesV4;
89
+ /**
90
+ * @deprecated Use `embeddingModel` instead.
91
+ */
92
+ textEmbeddingModel(modelId: string): never;
93
93
  }
94
- declare function createDeepSeek(options?: DeepSeekProviderSettings): DeepSeekProvider;
95
- declare const deepSeek: DeepSeekProvider;
96
-
97
- declare const VERSION: string;
98
-
94
+ export declare function createDeepSeek(options?: DeepSeekProviderSettings): DeepSeekProvider;
95
+ export declare const deepSeek: DeepSeekProvider;
96
+ //#endregion
97
+ //#region src/version.d.ts
98
+ export declare const VERSION: string;
99
+ //#endregion
100
+ //#region src/chat/deepseek-chat-api-types.d.ts
99
101
  declare const deepSeekErrorSchema: z.ZodObject<{
100
- error: z.ZodObject<{
101
- message: z.ZodString;
102
- type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
- param: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
104
- code: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
105
- }, z.core.$strip>;
102
+ error: z.ZodObject<{
103
+ message: z.ZodString;
104
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
105
+ param: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
106
+ code: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
107
+ }, z.core.$strip>;
106
108
  }, z.core.$strip>;
107
109
  type DeepSeekErrorData = z.infer<typeof deepSeekErrorSchema>;
108
-
110
+ //#endregion
111
+ //#region src/chat/deepseek-file-part-options.d.ts
109
112
  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>>;
113
+ imageDetail: z.ZodOptional<z.ZodEnum<{
114
+ low: "low";
115
+ high: "high";
116
+ original: "original";
117
+ auto: "auto";
118
+ }>>;
119
+ fileData: z.ZodOptional<z.ZodLiteral<true>>;
117
120
  }, z.core.$strip>;
118
121
  type DeepSeekFilePartProviderOptions = z.infer<typeof deepseekFilePartProviderOptions>;
119
-
120
- declare const deepSeekFilesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
121
- expiresAfter?: number | undefined;
122
+ //#endregion
123
+ //#region src/files/deepseek-files-options.d.ts
124
+ declare const deepSeekFilesOptionsSchema: import("@ai-sdk/provider-utils").LazySchema<{
125
+ expiresAfter?: number | undefined;
122
126
  }>;
123
127
  type DeepSeekFilesOptions = InferSchema<typeof deepSeekFilesOptionsSchema>;
124
-
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 };
128
+ //#endregion
129
+ export { type DeepSeekAssistantMessageProviderOptions, type DeepSeekLanguageModelChatOptions as DeepSeekChatOptions, type DeepSeekLanguageModelChatOptions, type DeepSeekLanguageModelChatOptions as DeepSeekLanguageModelOptions, type DeepSeekErrorData, type DeepSeekFilePartProviderOptions, type DeepSeekFilesOptions, type DeepSeekMessageProviderOptions, type DeepSeekProvider, type DeepSeekProviderSettings, deepSeek as deepseek };
130
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/chat/deepseek-chat-language-model-options.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":";;;;KAGY;KA+DA;;;;EAIV;;;;;;EAOA;;;;;;;;EASA;;;;EAKA;IACE;;;;;EAMF;;;;;;EAOA;;cAGW,gCAA8B,EAAA;;GAOzC,EAAA,KAAA;KAEU,iCAAiC,EAAE,aACtC;cAGI,yCAAuC,EAAA;;;GAQhD,EAAA,KAAA;KAEQ,0CAA0C,EAAE,aAC/C;;;UCnHQ;;;;EAIf;;;;EAKA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;UAGO,yBAAyB;;;;GAIvC,SAAS,sBAAsB;;;;EAKhC,cAAc,SAAS,sBAAsB;;;;EAK7C,KAAK,SAAS,sBAAsB;;;;EAKpC,SAAS;;;;EAKT,mBAAmB;;wBAGL,eACd,UAAS,2BACR;qBAwDU,UAAQ;;;qBC3HR;;;cCkHA,qBAAmB,EAAA;;;;;;;GAO9B,EAAA,KAAA;KAEU,oBAAoB,EAAE,aAAa;;;cC3HlC,iCAA+B,EAAA;;;;;;;;GAiB1C,EAAA,KAAA;KAEU,kCAAkC,EAAE,aACvC;;;cCfI,6DAA0B;EAAA;;KAY3B,uBAAuB,mBAC1B"}