@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 +10 -0
- package/dist/index.d.ts +109 -104
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1173 -1469
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +104 -104
- package/dist/internal/index.d.ts.map +1 -0
- package/dist/internal/index.js +995 -1216
- package/dist/internal/index.js.map +1 -1
- package/package.json +8 -8
- package/src/chat/convert-to-deepseek-usage.ts +10 -1
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
disabled: "disabled";
|
|
16
|
-
}>>;
|
|
17
|
-
}, z.core.$strip>>;
|
|
18
|
-
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
19
|
-
low: "low";
|
|
20
|
-
high: "high";
|
|
21
|
-
medium: "medium";
|
|
22
|
-
xhigh: "xhigh";
|
|
23
|
-
max: "max";
|
|
1
|
+
import { LanguageModelV4, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult } from "@ai-sdk/provider";
|
|
2
|
+
import { FetchFunction, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@ai-sdk/provider-utils";
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
|
+
//#region src/chat/deepseek-chat-language-model-options.d.ts
|
|
5
|
+
export type DeepSeekChatModelId = 'deepseek-flash' | 'deepseek-v4-flash' | 'deepseek-v4-pro' | 'deepseek-v4-flash-vision-exp' | (string & {});
|
|
6
|
+
export declare const deepseekLanguageModelChatOptions: z.ZodObject<{
|
|
7
|
+
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
thinking: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
adaptive: "adaptive";
|
|
13
|
+
enabled: "enabled";
|
|
14
|
+
disabled: "disabled";
|
|
24
15
|
}>>;
|
|
25
|
-
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
low: "low";
|
|
19
|
+
medium: "medium";
|
|
20
|
+
high: "high";
|
|
21
|
+
xhigh: "xhigh";
|
|
22
|
+
max: "max";
|
|
23
|
+
}>>;
|
|
24
|
+
strictJsonSchema: z.ZodOptional<z.ZodBoolean>;
|
|
26
25
|
}, z.core.$strip>;
|
|
27
|
-
type DeepSeekLanguageModelChatOptions = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
26
|
+
export type DeepSeekLanguageModelChatOptions = {
|
|
27
|
+
/**
|
|
28
|
+
* Whether to return log probabilities for generated tokens.
|
|
29
|
+
*/
|
|
30
|
+
logprobs?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Number of most likely tokens to return at each token position.
|
|
33
|
+
*
|
|
34
|
+
* Setting this option automatically enables `logprobs`.
|
|
35
|
+
*/
|
|
36
|
+
topLogprobs?: number;
|
|
37
|
+
/**
|
|
38
|
+
* An opaque identifier for the end user. DeepSeek uses this identifier for
|
|
39
|
+
* content-safety tracing and request isolation.
|
|
40
|
+
*
|
|
41
|
+
* Must contain only ASCII letters, numbers, underscores, and hyphens, and
|
|
42
|
+
* must be at most 512 characters long.
|
|
43
|
+
*/
|
|
44
|
+
userId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Controls whether thinking mode is enabled. Defaults to `enabled`.
|
|
47
|
+
*/
|
|
48
|
+
thinking?: {
|
|
49
|
+
type?: 'enabled' | 'disabled';
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Controls the thinking strength for DeepSeek V4 reasoning models.
|
|
53
|
+
*/
|
|
54
|
+
reasoningEffort?: 'low' | 'high' | 'max';
|
|
55
|
+
/**
|
|
56
|
+
* Whether to use strict JSON schema validation for structured outputs.
|
|
57
|
+
* Only applies when the serving endpoint supports JSON schema response
|
|
58
|
+
* formats (e.g. Azure). Defaults to `true`.
|
|
59
|
+
*/
|
|
60
|
+
strictJsonSchema?: boolean;
|
|
62
61
|
};
|
|
63
|
-
declare const deepseekMessageProviderOptions: z.ZodObject<{
|
|
64
|
-
|
|
62
|
+
export declare const deepseekMessageProviderOptions: z.ZodObject<{
|
|
63
|
+
name: z.ZodOptional<z.ZodString>;
|
|
65
64
|
}, z.core.$strip>;
|
|
66
|
-
type DeepSeekMessageProviderOptions = z.infer<typeof deepseekMessageProviderOptions>;
|
|
67
|
-
declare const deepseekAssistantMessageProviderOptions: z.ZodObject<{
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
export type DeepSeekMessageProviderOptions = z.infer<typeof deepseekMessageProviderOptions>;
|
|
66
|
+
export declare const deepseekAssistantMessageProviderOptions: z.ZodObject<{
|
|
67
|
+
name: z.ZodOptional<z.ZodString>;
|
|
68
|
+
prefix: z.ZodOptional<z.ZodLiteral<true>>;
|
|
70
69
|
}, z.core.$strip>;
|
|
71
|
-
type DeepSeekAssistantMessageProviderOptions = z.infer<typeof deepseekAssistantMessageProviderOptions>;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
export type DeepSeekAssistantMessageProviderOptions = z.infer<typeof deepseekAssistantMessageProviderOptions>;
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/chat/deepseek-chat-language-model.d.ts
|
|
73
|
+
export type DeepSeekChatConfig = {
|
|
74
|
+
provider: string;
|
|
75
|
+
headers?: () => Record<string, string | undefined>;
|
|
76
|
+
url: (options: {
|
|
77
|
+
modelId: string;
|
|
78
|
+
path: string;
|
|
79
|
+
}) => string;
|
|
80
|
+
fetch?: FetchFunction;
|
|
81
|
+
supportsAssistantPrefixCompletion?: boolean;
|
|
82
|
+
supportsStrictToolCalls?: boolean;
|
|
83
|
+
supportsPenaltySampling?: boolean;
|
|
84
|
+
supportsThinking?: boolean;
|
|
85
|
+
supportsStructuredOutputs?: boolean;
|
|
86
86
|
};
|
|
87
|
-
declare class DeepSeekChatLanguageModel implements LanguageModelV4 {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
87
|
+
export declare class DeepSeekChatLanguageModel implements LanguageModelV4 {
|
|
88
|
+
readonly specificationVersion = "v4";
|
|
89
|
+
readonly modelId: DeepSeekChatModelId;
|
|
90
|
+
readonly supportedUrls: {
|
|
91
|
+
'image/*': RegExp[];
|
|
92
|
+
};
|
|
93
|
+
private readonly config;
|
|
94
|
+
private readonly failedResponseHandler;
|
|
95
|
+
static [WORKFLOW_SERIALIZE](model: DeepSeekChatLanguageModel): {
|
|
96
|
+
modelId: string;
|
|
97
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
98
|
+
};
|
|
99
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
100
|
+
modelId: DeepSeekChatModelId;
|
|
101
|
+
config: DeepSeekChatConfig;
|
|
102
|
+
}): DeepSeekChatLanguageModel;
|
|
103
|
+
constructor(modelId: DeepSeekChatModelId, config: DeepSeekChatConfig);
|
|
104
|
+
get provider(): string;
|
|
105
|
+
private get providerOptionsName();
|
|
106
|
+
private getArgs;
|
|
107
|
+
doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
|
|
108
|
+
doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
//#endregion
|
|
111
|
+
//# 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/chat/deepseek-chat-language-model.ts"],"mappings":";;;;YAGY;qBASC,kCAAgC,EAAA;;;;;;;;;;;;;;;;;;;GAoD3C,EAAA,KAAA;YAEU;;;;EAIV;;;;;;EAOA;;;;;;;;EASA;;;;EAKA;IACE;;;;;EAMF;;;;;;EAOA;;qBAGW,gCAA8B,EAAA;;GAOzC,EAAA,KAAA;YAEU,iCAAiC,EAAE,aACtC;qBAGI,yCAAuC,EAAA;;;GAQhD,EAAA,KAAA;YAEQ,0CAA0C,EAAE,aAC/C;;;YClFG;EACV;EACA,gBAAgB;EAChB,MAAM;IAAW;IAAiB;;EAClC,QAAQ;EACR;EACA;EACA;EACA;EACA;;qBA2HW,qCAAqC;WACvC;WAEA,SAAS;WAET;;;mBAIQ;mBACA;UAET,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;EAIW,YAAA,SAAS,qBAAqB,QAAQ;MAW9C;cAIQ;UAIE;EAyLR,WACJ,SAAS,6BACR,QAAQ;EAkGL,SACJ,SAAS,6BACR,QAAQ"}
|