@langchain/deepseek 0.0.2 → 1.0.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat_models.cjs","names":["ChatOpenAICompletions","fields?: Partial<ChatDeepSeekInput>","delta: Record<string, any>","rawResponse: OpenAIClient.ChatCompletionChunk","defaultRole?:\n | \"function\"\n | \"user\"\n | \"system\"\n | \"developer\"\n | \"assistant\"\n | \"tool\"","message: OpenAIClient.ChatCompletionMessage","rawResponse: OpenAIClient.ChatCompletion","outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>","config?: StructuredOutputMethodOptions<boolean>"],"sources":["../src/chat_models.ts"],"sourcesContent":["import {\n BaseLanguageModelInput,\n StructuredOutputMethodOptions,\n} from \"@langchain/core/language_models/base\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { InteropZodType } from \"@langchain/core/utils/types\";\nimport {\n ChatOpenAICallOptions,\n ChatOpenAICompletions,\n ChatOpenAIFields,\n OpenAIClient,\n} from \"@langchain/openai\";\n\nexport interface ChatDeepSeekCallOptions extends ChatOpenAICallOptions {\n headers?: Record<string, string>;\n}\n\nexport interface ChatDeepSeekInput extends ChatOpenAIFields {\n /**\n * The Deepseek API key to use for requests.\n * @default process.env.DEEPSEEK_API_KEY\n */\n apiKey?: string;\n /**\n * The name of the model to use.\n */\n model?: string;\n /**\n * Up to 4 sequences where the API will stop generating further tokens. The\n * returned text will not contain the stop sequence.\n * Alias for `stopSequences`\n */\n stop?: Array<string>;\n /**\n * Up to 4 sequences where the API will stop generating further tokens. The\n * returned text will not contain the stop sequence.\n */\n stopSequences?: Array<string>;\n /**\n * Whether or not to stream responses.\n */\n streaming?: boolean;\n /**\n * The temperature to use for sampling.\n */\n temperature?: number;\n /**\n * The maximum number of tokens that the model can process in a single response.\n * This limits ensures computational efficiency and resource management.\n */\n maxTokens?: number;\n}\n\n/**\n * Deepseek chat model integration.\n *\n * The Deepseek API is compatible to the OpenAI API with some limitations.\n *\n * Setup:\n * Install `@langchain/deepseek` and set an environment variable named `DEEPSEEK_API_KEY`.\n *\n * ```bash\n * npm install @langchain/deepseek\n * export DEEPSEEK_API_KEY=\"your-api-key\"\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/_langchain_deepseek.ChatDeepSeek.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/_langchain_deepseek.ChatDeepSeekCallOptions.html)\n *\n * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.\n * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:\n *\n * ```typescript\n * // When calling `.withConfig`, call options should be passed via the first argument\n * const llmWithArgsBound = llm.withConfig({\n * stop: [\"\\n\"],\n * tools: [...],\n * });\n *\n * // When calling `.bindTools`, call options should be passed via the second argument\n * const llmWithTools = llm.bindTools(\n * [...],\n * {\n * tool_choice: \"auto\",\n * }\n * );\n * ```\n *\n * ## Examples\n *\n * <details open>\n * <summary><strong>Instantiate</strong></summary>\n *\n * ```typescript\n * import { ChatDeepSeek } from '@langchain/deepseek';\n *\n * const llm = new ChatDeepSeek({\n * model: \"deepseek-reasoner\",\n * temperature: 0,\n * // other params...\n * });\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Invoking</strong></summary>\n *\n * ```typescript\n * const input = `Translate \"I love programming\" into French.`;\n *\n * // Models also accept a list of chat messages or a formatted prompt\n * const result = await llm.invoke(input);\n * console.log(result);\n * ```\n *\n * ```txt\n * AIMessage {\n * \"content\": \"The French translation of \\\"I love programming\\\" is \\\"J'aime programmer\\\". In this sentence, \\\"J'aime\\\" is the first person singular conjugation of the French verb \\\"aimer\\\" which means \\\"to love\\\", and \\\"programmer\\\" is the French infinitive for \\\"to program\\\". I hope this helps! Let me know if you have any other questions.\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"tokenUsage\": {\n * \"completionTokens\": 82,\n * \"promptTokens\": 20,\n * \"totalTokens\": 102\n * },\n * \"finish_reason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Streaming Chunks</strong></summary>\n *\n * ```typescript\n * for await (const chunk of await llm.stream(input)) {\n * console.log(chunk);\n * }\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"The\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" French\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" translation\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" of\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" \\\"\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"I\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" love\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ...\n * AIMessageChunk {\n * \"content\": \".\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Aggregate Streamed Chunks</strong></summary>\n *\n * ```typescript\n * import { AIMessageChunk } from '@langchain/core/messages';\n * import { concat } from '@langchain/core/utils/stream';\n *\n * const stream = await llm.stream(input);\n * let full: AIMessageChunk | undefined;\n * for await (const chunk of stream) {\n * full = !full ? chunk : concat(full, chunk);\n * }\n * console.log(full);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"The French translation of \\\"I love programming\\\" is \\\"J'aime programmer\\\". In this sentence, \\\"J'aime\\\" is the first person singular conjugation of the French verb \\\"aimer\\\" which means \\\"to love\\\", and \\\"programmer\\\" is the French infinitive for \\\"to program\\\". I hope this helps! Let me know if you have any other questions.\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Bind tools</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const llmForToolCalling = new ChatDeepSeek({\n * model: \"deepseek-chat\",\n * temperature: 0,\n * // other params...\n * });\n *\n * const GetWeather = {\n * name: \"GetWeather\",\n * description: \"Get the current weather in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const GetPopulation = {\n * name: \"GetPopulation\",\n * description: \"Get the current population in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const llmWithTools = llmForToolCalling.bindTools([GetWeather, GetPopulation]);\n * const aiMsg = await llmWithTools.invoke(\n * \"Which city is hotter today and which is bigger: LA or NY?\"\n * );\n * console.log(aiMsg.tool_calls);\n * ```\n *\n * ```txt\n * [\n * {\n * name: 'GetWeather',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_cd34'\n * },\n * {\n * name: 'GetWeather',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_68rf'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_f81z'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_8byt'\n * }\n * ]\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Structured Output</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const Joke = z.object({\n * setup: z.string().describe(\"The setup of the joke\"),\n * punchline: z.string().describe(\"The punchline to the joke\"),\n * rating: z.number().optional().describe(\"How funny the joke is, from 1 to 10\")\n * }).describe('Joke to tell user.');\n *\n * const structuredLlm = llmForToolCalling.withStructuredOutput(Joke, { name: \"Joke\" });\n * const jokeResult = await structuredLlm.invoke(\"Tell me a joke about cats\");\n * console.log(jokeResult);\n * ```\n *\n * ```txt\n * {\n * setup: \"Why don't cats play poker in the wild?\",\n * punchline: 'Because there are too many cheetahs.'\n * }\n * ```\n * </details>\n *\n * <br />\n */\nexport class ChatDeepSeek extends ChatOpenAICompletions<ChatDeepSeekCallOptions> {\n static lc_name() {\n return \"ChatDeepSeek\";\n }\n\n _llmType() {\n return \"deepseek\";\n }\n\n get lc_secrets(): { [key: string]: string } | undefined {\n return {\n apiKey: \"DEEPSEEK_API_KEY\",\n };\n }\n\n lc_serializable = true;\n\n lc_namespace = [\"langchain\", \"chat_models\", \"deepseek\"];\n\n constructor(fields?: Partial<ChatDeepSeekInput>) {\n const apiKey = fields?.apiKey || getEnvironmentVariable(\"DEEPSEEK_API_KEY\");\n if (!apiKey) {\n throw new Error(\n `Deepseek API key not found. Please set the DEEPSEEK_API_KEY environment variable or pass the key into \"apiKey\" field.`\n );\n }\n\n super({\n ...fields,\n apiKey,\n configuration: {\n baseURL: \"https://api.deepseek.com\",\n ...fields?.configuration,\n },\n });\n }\n\n protected override _convertCompletionsDeltaToBaseMessageChunk(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delta: Record<string, any>,\n rawResponse: OpenAIClient.ChatCompletionChunk,\n defaultRole?:\n | \"function\"\n | \"user\"\n | \"system\"\n | \"developer\"\n | \"assistant\"\n | \"tool\"\n ) {\n const messageChunk = super._convertCompletionsDeltaToBaseMessageChunk(\n delta,\n rawResponse,\n defaultRole\n );\n messageChunk.additional_kwargs.reasoning_content = delta.reasoning_content;\n return messageChunk;\n }\n\n protected override _convertCompletionsMessageToBaseMessage(\n message: OpenAIClient.ChatCompletionMessage,\n rawResponse: OpenAIClient.ChatCompletion\n ) {\n const langChainMessage = super._convertCompletionsMessageToBaseMessage(\n message,\n rawResponse\n );\n langChainMessage.additional_kwargs.reasoning_content =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (message as any).reasoning_content;\n return langChainMessage;\n }\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<false>\n ): Runnable<BaseLanguageModelInput, RunOutput>;\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<true>\n ): Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<boolean>\n ):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;\n\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<boolean>\n ):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n > {\n const ensuredConfig = { ...config };\n // Deepseek does not support json schema yet\n if (ensuredConfig?.method === undefined) {\n ensuredConfig.method = \"functionCalling\";\n }\n return super.withStructuredOutput<RunOutput>(outputSchema, ensuredConfig);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqZA,IAAa,eAAb,cAAkCA,yCAA+C;CAC/E,OAAO,UAAU;AACf,SAAO;CACR;CAED,WAAW;AACT,SAAO;CACR;CAED,IAAI,aAAoD;AACtD,SAAO,EACL,QAAQ,mBACT;CACF;CAED,kBAAkB;CAElB,eAAe;EAAC;EAAa;EAAe;CAAW;CAEvD,YAAYC,QAAqC;EAC/C,MAAM,SAAS,QAAQ,iEAAiC,mBAAmB;AAC3E,MAAI,CAAC,OACH,OAAM,IAAI,MACR,CAAC,qHAAqH,CAAC;EAI3H,MAAM;GACJ,GAAG;GACH;GACA,eAAe;IACb,SAAS;IACT,GAAG,QAAQ;GACZ;EACF,EAAC;CACH;CAED,AAAmB,2CAEjBC,OACAC,aACAC,aAOA;EACA,MAAM,eAAe,MAAM,2CACzB,OACA,aACA,YACD;EACD,aAAa,kBAAkB,oBAAoB,MAAM;AACzD,SAAO;CACR;CAED,AAAmB,wCACjBC,SACAC,aACA;EACA,MAAM,mBAAmB,MAAM,wCAC7B,SACA,YACD;EACD,iBAAiB,kBAAkB,oBAEhC,QAAgB;AACnB,SAAO;CACR;CAqCD,qBAIEC,cAIAC,QAMI;EACJ,MAAM,gBAAgB,EAAE,GAAG,OAAQ;AAEnC,MAAI,eAAe,WAAW,QAC5B,cAAc,SAAS;AAEzB,SAAO,MAAM,qBAAgC,cAAc,cAAc;CAC1E;AACF"}
@@ -0,0 +1,434 @@
1
+ import * as _langchain_core_messages0 from "@langchain/core/messages";
2
+ import { BaseMessage } from "@langchain/core/messages";
3
+ import { BaseLanguageModelInput, StructuredOutputMethodOptions } from "@langchain/core/language_models/base";
4
+ import { Runnable } from "@langchain/core/runnables";
5
+ import { InteropZodType } from "@langchain/core/utils/types";
6
+ import { ChatOpenAICallOptions, ChatOpenAICompletions, ChatOpenAIFields, OpenAIClient } from "@langchain/openai";
7
+
8
+ //#region src/chat_models.d.ts
9
+ interface ChatDeepSeekCallOptions extends ChatOpenAICallOptions {
10
+ headers?: Record<string, string>;
11
+ }
12
+ interface ChatDeepSeekInput extends ChatOpenAIFields {
13
+ /**
14
+ * The Deepseek API key to use for requests.
15
+ * @default process.env.DEEPSEEK_API_KEY
16
+ */
17
+ apiKey?: string;
18
+ /**
19
+ * The name of the model to use.
20
+ */
21
+ model?: string;
22
+ /**
23
+ * Up to 4 sequences where the API will stop generating further tokens. The
24
+ * returned text will not contain the stop sequence.
25
+ * Alias for `stopSequences`
26
+ */
27
+ stop?: Array<string>;
28
+ /**
29
+ * Up to 4 sequences where the API will stop generating further tokens. The
30
+ * returned text will not contain the stop sequence.
31
+ */
32
+ stopSequences?: Array<string>;
33
+ /**
34
+ * Whether or not to stream responses.
35
+ */
36
+ streaming?: boolean;
37
+ /**
38
+ * The temperature to use for sampling.
39
+ */
40
+ temperature?: number;
41
+ /**
42
+ * The maximum number of tokens that the model can process in a single response.
43
+ * This limits ensures computational efficiency and resource management.
44
+ */
45
+ maxTokens?: number;
46
+ }
47
+ /**
48
+ * Deepseek chat model integration.
49
+ *
50
+ * The Deepseek API is compatible to the OpenAI API with some limitations.
51
+ *
52
+ * Setup:
53
+ * Install `@langchain/deepseek` and set an environment variable named `DEEPSEEK_API_KEY`.
54
+ *
55
+ * ```bash
56
+ * npm install @langchain/deepseek
57
+ * export DEEPSEEK_API_KEY="your-api-key"
58
+ * ```
59
+ *
60
+ * ## [Constructor args](https://api.js.langchain.com/classes/_langchain_deepseek.ChatDeepSeek.html#constructor)
61
+ *
62
+ * ## [Runtime args](https://api.js.langchain.com/interfaces/_langchain_deepseek.ChatDeepSeekCallOptions.html)
63
+ *
64
+ * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.
65
+ * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:
66
+ *
67
+ * ```typescript
68
+ * // When calling `.withConfig`, call options should be passed via the first argument
69
+ * const llmWithArgsBound = llm.withConfig({
70
+ * stop: ["\n"],
71
+ * tools: [...],
72
+ * });
73
+ *
74
+ * // When calling `.bindTools`, call options should be passed via the second argument
75
+ * const llmWithTools = llm.bindTools(
76
+ * [...],
77
+ * {
78
+ * tool_choice: "auto",
79
+ * }
80
+ * );
81
+ * ```
82
+ *
83
+ * ## Examples
84
+ *
85
+ * <details open>
86
+ * <summary><strong>Instantiate</strong></summary>
87
+ *
88
+ * ```typescript
89
+ * import { ChatDeepSeek } from '@langchain/deepseek';
90
+ *
91
+ * const llm = new ChatDeepSeek({
92
+ * model: "deepseek-reasoner",
93
+ * temperature: 0,
94
+ * // other params...
95
+ * });
96
+ * ```
97
+ * </details>
98
+ *
99
+ * <br />
100
+ *
101
+ * <details>
102
+ * <summary><strong>Invoking</strong></summary>
103
+ *
104
+ * ```typescript
105
+ * const input = `Translate "I love programming" into French.`;
106
+ *
107
+ * // Models also accept a list of chat messages or a formatted prompt
108
+ * const result = await llm.invoke(input);
109
+ * console.log(result);
110
+ * ```
111
+ *
112
+ * ```txt
113
+ * AIMessage {
114
+ * "content": "The French translation of \"I love programming\" is \"J'aime programmer\". In this sentence, \"J'aime\" is the first person singular conjugation of the French verb \"aimer\" which means \"to love\", and \"programmer\" is the French infinitive for \"to program\". I hope this helps! Let me know if you have any other questions.",
115
+ * "additional_kwargs": {
116
+ * "reasoning_content": "...",
117
+ * },
118
+ * "response_metadata": {
119
+ * "tokenUsage": {
120
+ * "completionTokens": 82,
121
+ * "promptTokens": 20,
122
+ * "totalTokens": 102
123
+ * },
124
+ * "finish_reason": "stop"
125
+ * },
126
+ * "tool_calls": [],
127
+ * "invalid_tool_calls": []
128
+ * }
129
+ * ```
130
+ * </details>
131
+ *
132
+ * <br />
133
+ *
134
+ * <details>
135
+ * <summary><strong>Streaming Chunks</strong></summary>
136
+ *
137
+ * ```typescript
138
+ * for await (const chunk of await llm.stream(input)) {
139
+ * console.log(chunk);
140
+ * }
141
+ * ```
142
+ *
143
+ * ```txt
144
+ * AIMessageChunk {
145
+ * "content": "",
146
+ * "additional_kwargs": {
147
+ * "reasoning_content": "...",
148
+ * },
149
+ * "response_metadata": {
150
+ * "finishReason": null
151
+ * },
152
+ * "tool_calls": [],
153
+ * "tool_call_chunks": [],
154
+ * "invalid_tool_calls": []
155
+ * }
156
+ * AIMessageChunk {
157
+ * "content": "The",
158
+ * "additional_kwargs": {
159
+ * "reasoning_content": "...",
160
+ * },
161
+ * "response_metadata": {
162
+ * "finishReason": null
163
+ * },
164
+ * "tool_calls": [],
165
+ * "tool_call_chunks": [],
166
+ * "invalid_tool_calls": []
167
+ * }
168
+ * AIMessageChunk {
169
+ * "content": " French",
170
+ * "additional_kwargs": {
171
+ * "reasoning_content": "...",
172
+ * },
173
+ * "response_metadata": {
174
+ * "finishReason": null
175
+ * },
176
+ * "tool_calls": [],
177
+ * "tool_call_chunks": [],
178
+ * "invalid_tool_calls": []
179
+ * }
180
+ * AIMessageChunk {
181
+ * "content": " translation",
182
+ * "additional_kwargs": {
183
+ * "reasoning_content": "...",
184
+ * },
185
+ * "response_metadata": {
186
+ * "finishReason": null
187
+ * },
188
+ * "tool_calls": [],
189
+ * "tool_call_chunks": [],
190
+ * "invalid_tool_calls": []
191
+ * }
192
+ * AIMessageChunk {
193
+ * "content": " of",
194
+ * "additional_kwargs": {
195
+ * "reasoning_content": "...",
196
+ * },
197
+ * "response_metadata": {
198
+ * "finishReason": null
199
+ * },
200
+ * "tool_calls": [],
201
+ * "tool_call_chunks": [],
202
+ * "invalid_tool_calls": []
203
+ * }
204
+ * AIMessageChunk {
205
+ * "content": " \"",
206
+ * "additional_kwargs": {
207
+ * "reasoning_content": "...",
208
+ * },
209
+ * "response_metadata": {
210
+ * "finishReason": null
211
+ * },
212
+ * "tool_calls": [],
213
+ * "tool_call_chunks": [],
214
+ * "invalid_tool_calls": []
215
+ * }
216
+ * AIMessageChunk {
217
+ * "content": "I",
218
+ * "additional_kwargs": {
219
+ * "reasoning_content": "...",
220
+ * },
221
+ * "response_metadata": {
222
+ * "finishReason": null
223
+ * },
224
+ * "tool_calls": [],
225
+ * "tool_call_chunks": [],
226
+ * "invalid_tool_calls": []
227
+ * }
228
+ * AIMessageChunk {
229
+ * "content": " love",
230
+ * "additional_kwargs": {
231
+ * "reasoning_content": "...",
232
+ * },
233
+ * "response_metadata": {
234
+ * "finishReason": null
235
+ * },
236
+ * "tool_calls": [],
237
+ * "tool_call_chunks": [],
238
+ * "invalid_tool_calls": []
239
+ * }
240
+ * ...
241
+ * AIMessageChunk {
242
+ * "content": ".",
243
+ * "additional_kwargs": {
244
+ * "reasoning_content": "...",
245
+ * },
246
+ * "response_metadata": {
247
+ * "finishReason": null
248
+ * },
249
+ * "tool_calls": [],
250
+ * "tool_call_chunks": [],
251
+ * "invalid_tool_calls": []
252
+ * }
253
+ * AIMessageChunk {
254
+ * "content": "",
255
+ * "additional_kwargs": {
256
+ * "reasoning_content": "...",
257
+ * },
258
+ * "response_metadata": {
259
+ * "finishReason": "stop"
260
+ * },
261
+ * "tool_calls": [],
262
+ * "tool_call_chunks": [],
263
+ * "invalid_tool_calls": []
264
+ * }
265
+ * ```
266
+ * </details>
267
+ *
268
+ * <br />
269
+ *
270
+ * <details>
271
+ * <summary><strong>Aggregate Streamed Chunks</strong></summary>
272
+ *
273
+ * ```typescript
274
+ * import { AIMessageChunk } from '@langchain/core/messages';
275
+ * import { concat } from '@langchain/core/utils/stream';
276
+ *
277
+ * const stream = await llm.stream(input);
278
+ * let full: AIMessageChunk | undefined;
279
+ * for await (const chunk of stream) {
280
+ * full = !full ? chunk : concat(full, chunk);
281
+ * }
282
+ * console.log(full);
283
+ * ```
284
+ *
285
+ * ```txt
286
+ * AIMessageChunk {
287
+ * "content": "The French translation of \"I love programming\" is \"J'aime programmer\". In this sentence, \"J'aime\" is the first person singular conjugation of the French verb \"aimer\" which means \"to love\", and \"programmer\" is the French infinitive for \"to program\". I hope this helps! Let me know if you have any other questions.",
288
+ * "additional_kwargs": {
289
+ * "reasoning_content": "...",
290
+ * },
291
+ * "response_metadata": {
292
+ * "finishReason": "stop"
293
+ * },
294
+ * "tool_calls": [],
295
+ * "tool_call_chunks": [],
296
+ * "invalid_tool_calls": []
297
+ * }
298
+ * ```
299
+ * </details>
300
+ *
301
+ * <br />
302
+ *
303
+ * <details>
304
+ * <summary><strong>Bind tools</strong></summary>
305
+ *
306
+ * ```typescript
307
+ * import { z } from 'zod';
308
+ *
309
+ * const llmForToolCalling = new ChatDeepSeek({
310
+ * model: "deepseek-chat",
311
+ * temperature: 0,
312
+ * // other params...
313
+ * });
314
+ *
315
+ * const GetWeather = {
316
+ * name: "GetWeather",
317
+ * description: "Get the current weather in a given location",
318
+ * schema: z.object({
319
+ * location: z.string().describe("The city and state, e.g. San Francisco, CA")
320
+ * }),
321
+ * }
322
+ *
323
+ * const GetPopulation = {
324
+ * name: "GetPopulation",
325
+ * description: "Get the current population in a given location",
326
+ * schema: z.object({
327
+ * location: z.string().describe("The city and state, e.g. San Francisco, CA")
328
+ * }),
329
+ * }
330
+ *
331
+ * const llmWithTools = llmForToolCalling.bindTools([GetWeather, GetPopulation]);
332
+ * const aiMsg = await llmWithTools.invoke(
333
+ * "Which city is hotter today and which is bigger: LA or NY?"
334
+ * );
335
+ * console.log(aiMsg.tool_calls);
336
+ * ```
337
+ *
338
+ * ```txt
339
+ * [
340
+ * {
341
+ * name: 'GetWeather',
342
+ * args: { location: 'Los Angeles, CA' },
343
+ * type: 'tool_call',
344
+ * id: 'call_cd34'
345
+ * },
346
+ * {
347
+ * name: 'GetWeather',
348
+ * args: { location: 'New York, NY' },
349
+ * type: 'tool_call',
350
+ * id: 'call_68rf'
351
+ * },
352
+ * {
353
+ * name: 'GetPopulation',
354
+ * args: { location: 'Los Angeles, CA' },
355
+ * type: 'tool_call',
356
+ * id: 'call_f81z'
357
+ * },
358
+ * {
359
+ * name: 'GetPopulation',
360
+ * args: { location: 'New York, NY' },
361
+ * type: 'tool_call',
362
+ * id: 'call_8byt'
363
+ * }
364
+ * ]
365
+ * ```
366
+ * </details>
367
+ *
368
+ * <br />
369
+ *
370
+ * <details>
371
+ * <summary><strong>Structured Output</strong></summary>
372
+ *
373
+ * ```typescript
374
+ * import { z } from 'zod';
375
+ *
376
+ * const Joke = z.object({
377
+ * setup: z.string().describe("The setup of the joke"),
378
+ * punchline: z.string().describe("The punchline to the joke"),
379
+ * rating: z.number().optional().describe("How funny the joke is, from 1 to 10")
380
+ * }).describe('Joke to tell user.');
381
+ *
382
+ * const structuredLlm = llmForToolCalling.withStructuredOutput(Joke, { name: "Joke" });
383
+ * const jokeResult = await structuredLlm.invoke("Tell me a joke about cats");
384
+ * console.log(jokeResult);
385
+ * ```
386
+ *
387
+ * ```txt
388
+ * {
389
+ * setup: "Why don't cats play poker in the wild?",
390
+ * punchline: 'Because there are too many cheetahs.'
391
+ * }
392
+ * ```
393
+ * </details>
394
+ *
395
+ * <br />
396
+ */
397
+ declare class ChatDeepSeek extends ChatOpenAICompletions<ChatDeepSeekCallOptions> {
398
+ static lc_name(): string;
399
+ _llmType(): string;
400
+ get lc_secrets(): {
401
+ [key: string]: string;
402
+ } | undefined;
403
+ lc_serializable: boolean;
404
+ lc_namespace: string[];
405
+ constructor(fields?: Partial<ChatDeepSeekInput>);
406
+ protected _convertCompletionsDeltaToBaseMessageChunk(
407
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
408
+ delta: Record<string, any>, rawResponse: OpenAIClient.ChatCompletionChunk, defaultRole?: "function" | "user" | "system" | "developer" | "assistant" | "tool"): _langchain_core_messages0.AIMessageChunk<_langchain_core_messages0.MessageStructure> | _langchain_core_messages0.ChatMessageChunk<_langchain_core_messages0.MessageStructure> | _langchain_core_messages0.FunctionMessageChunk<_langchain_core_messages0.MessageStructure> | _langchain_core_messages0.HumanMessageChunk<_langchain_core_messages0.MessageStructure> | _langchain_core_messages0.SystemMessageChunk<_langchain_core_messages0.MessageStructure> | _langchain_core_messages0.ToolMessageChunk<_langchain_core_messages0.MessageStructure>;
409
+ protected _convertCompletionsMessageToBaseMessage(message: OpenAIClient.ChatCompletionMessage, rawResponse: OpenAIClient.ChatCompletion): BaseMessage<_langchain_core_messages0.MessageStructure, _langchain_core_messages0.MessageType>;
410
+ withStructuredOutput<
411
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
412
+ RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
413
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
414
+ | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;
415
+ withStructuredOutput<
416
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
417
+ RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
418
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
419
+ | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {
420
+ raw: BaseMessage;
421
+ parsed: RunOutput;
422
+ }>;
423
+ withStructuredOutput<
424
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
425
+ RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
426
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
427
+ | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {
428
+ raw: BaseMessage;
429
+ parsed: RunOutput;
430
+ }>;
431
+ }
432
+ //#endregion
433
+ export { ChatDeepSeek, ChatDeepSeekCallOptions, ChatDeepSeekInput };
434
+ //# sourceMappingURL=chat_models.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat_models.d.cts","names":["BaseLanguageModelInput","StructuredOutputMethodOptions","BaseMessage","Runnable","InteropZodType","ChatOpenAICallOptions","ChatOpenAICompletions","ChatOpenAIFields","OpenAIClient","ChatDeepSeekCallOptions","Record","ChatDeepSeekInput","Array","ChatDeepSeek","Partial","ChatCompletionChunk","_langchain_core_messages0","MessageStructure","AIMessageChunk","ChatMessageChunk","FunctionMessageChunk","HumanMessageChunk","SystemMessageChunk","ToolMessageChunk","ChatCompletionMessage","ChatCompletion","MessageType","RunOutput"],"sources":["../src/chat_models.d.ts"],"sourcesContent":["import { BaseLanguageModelInput, StructuredOutputMethodOptions } from \"@langchain/core/language_models/base\";\nimport { BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { InteropZodType } from \"@langchain/core/utils/types\";\nimport { ChatOpenAICallOptions, ChatOpenAICompletions, ChatOpenAIFields, OpenAIClient } from \"@langchain/openai\";\nexport interface ChatDeepSeekCallOptions extends ChatOpenAICallOptions {\n headers?: Record<string, string>;\n}\nexport interface ChatDeepSeekInput extends ChatOpenAIFields {\n /**\n * The Deepseek API key to use for requests.\n * @default process.env.DEEPSEEK_API_KEY\n */\n apiKey?: string;\n /**\n * The name of the model to use.\n */\n model?: string;\n /**\n * Up to 4 sequences where the API will stop generating further tokens. The\n * returned text will not contain the stop sequence.\n * Alias for `stopSequences`\n */\n stop?: Array<string>;\n /**\n * Up to 4 sequences where the API will stop generating further tokens. The\n * returned text will not contain the stop sequence.\n */\n stopSequences?: Array<string>;\n /**\n * Whether or not to stream responses.\n */\n streaming?: boolean;\n /**\n * The temperature to use for sampling.\n */\n temperature?: number;\n /**\n * The maximum number of tokens that the model can process in a single response.\n * This limits ensures computational efficiency and resource management.\n */\n maxTokens?: number;\n}\n/**\n * Deepseek chat model integration.\n *\n * The Deepseek API is compatible to the OpenAI API with some limitations.\n *\n * Setup:\n * Install `@langchain/deepseek` and set an environment variable named `DEEPSEEK_API_KEY`.\n *\n * ```bash\n * npm install @langchain/deepseek\n * export DEEPSEEK_API_KEY=\"your-api-key\"\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/_langchain_deepseek.ChatDeepSeek.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/_langchain_deepseek.ChatDeepSeekCallOptions.html)\n *\n * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.\n * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:\n *\n * ```typescript\n * // When calling `.withConfig`, call options should be passed via the first argument\n * const llmWithArgsBound = llm.withConfig({\n * stop: [\"\\n\"],\n * tools: [...],\n * });\n *\n * // When calling `.bindTools`, call options should be passed via the second argument\n * const llmWithTools = llm.bindTools(\n * [...],\n * {\n * tool_choice: \"auto\",\n * }\n * );\n * ```\n *\n * ## Examples\n *\n * <details open>\n * <summary><strong>Instantiate</strong></summary>\n *\n * ```typescript\n * import { ChatDeepSeek } from '@langchain/deepseek';\n *\n * const llm = new ChatDeepSeek({\n * model: \"deepseek-reasoner\",\n * temperature: 0,\n * // other params...\n * });\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Invoking</strong></summary>\n *\n * ```typescript\n * const input = `Translate \"I love programming\" into French.`;\n *\n * // Models also accept a list of chat messages or a formatted prompt\n * const result = await llm.invoke(input);\n * console.log(result);\n * ```\n *\n * ```txt\n * AIMessage {\n * \"content\": \"The French translation of \\\"I love programming\\\" is \\\"J'aime programmer\\\". In this sentence, \\\"J'aime\\\" is the first person singular conjugation of the French verb \\\"aimer\\\" which means \\\"to love\\\", and \\\"programmer\\\" is the French infinitive for \\\"to program\\\". I hope this helps! Let me know if you have any other questions.\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"tokenUsage\": {\n * \"completionTokens\": 82,\n * \"promptTokens\": 20,\n * \"totalTokens\": 102\n * },\n * \"finish_reason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Streaming Chunks</strong></summary>\n *\n * ```typescript\n * for await (const chunk of await llm.stream(input)) {\n * console.log(chunk);\n * }\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"The\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" French\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" translation\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" of\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" \\\"\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"I\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" love\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ...\n * AIMessageChunk {\n * \"content\": \".\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Aggregate Streamed Chunks</strong></summary>\n *\n * ```typescript\n * import { AIMessageChunk } from '@langchain/core/messages';\n * import { concat } from '@langchain/core/utils/stream';\n *\n * const stream = await llm.stream(input);\n * let full: AIMessageChunk | undefined;\n * for await (const chunk of stream) {\n * full = !full ? chunk : concat(full, chunk);\n * }\n * console.log(full);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"The French translation of \\\"I love programming\\\" is \\\"J'aime programmer\\\". In this sentence, \\\"J'aime\\\" is the first person singular conjugation of the French verb \\\"aimer\\\" which means \\\"to love\\\", and \\\"programmer\\\" is the French infinitive for \\\"to program\\\". I hope this helps! Let me know if you have any other questions.\",\n * \"additional_kwargs\": {\n * \"reasoning_content\": \"...\",\n * },\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Bind tools</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const llmForToolCalling = new ChatDeepSeek({\n * model: \"deepseek-chat\",\n * temperature: 0,\n * // other params...\n * });\n *\n * const GetWeather = {\n * name: \"GetWeather\",\n * description: \"Get the current weather in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const GetPopulation = {\n * name: \"GetPopulation\",\n * description: \"Get the current population in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const llmWithTools = llmForToolCalling.bindTools([GetWeather, GetPopulation]);\n * const aiMsg = await llmWithTools.invoke(\n * \"Which city is hotter today and which is bigger: LA or NY?\"\n * );\n * console.log(aiMsg.tool_calls);\n * ```\n *\n * ```txt\n * [\n * {\n * name: 'GetWeather',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_cd34'\n * },\n * {\n * name: 'GetWeather',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_68rf'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_f81z'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_8byt'\n * }\n * ]\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Structured Output</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const Joke = z.object({\n * setup: z.string().describe(\"The setup of the joke\"),\n * punchline: z.string().describe(\"The punchline to the joke\"),\n * rating: z.number().optional().describe(\"How funny the joke is, from 1 to 10\")\n * }).describe('Joke to tell user.');\n *\n * const structuredLlm = llmForToolCalling.withStructuredOutput(Joke, { name: \"Joke\" });\n * const jokeResult = await structuredLlm.invoke(\"Tell me a joke about cats\");\n * console.log(jokeResult);\n * ```\n *\n * ```txt\n * {\n * setup: \"Why don't cats play poker in the wild?\",\n * punchline: 'Because there are too many cheetahs.'\n * }\n * ```\n * </details>\n *\n * <br />\n */\nexport declare class ChatDeepSeek extends ChatOpenAICompletions<ChatDeepSeekCallOptions> {\n static lc_name(): string;\n _llmType(): string;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n lc_serializable: boolean;\n lc_namespace: string[];\n constructor(fields?: Partial<ChatDeepSeekInput>);\n protected _convertCompletionsDeltaToBaseMessageChunk(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delta: Record<string, any>, rawResponse: OpenAIClient.ChatCompletionChunk, defaultRole?: \"function\" | \"user\" | \"system\" | \"developer\" | \"assistant\" | \"tool\"): import(\"@langchain/core/messages\").AIMessageChunk<import(\"@langchain/core/messages\").MessageStructure> | import(\"@langchain/core/messages\").ChatMessageChunk<import(\"@langchain/core/messages\").MessageStructure> | import(\"@langchain/core/messages\").FunctionMessageChunk<import(\"@langchain/core/messages\").MessageStructure> | import(\"@langchain/core/messages\").HumanMessageChunk<import(\"@langchain/core/messages\").MessageStructure> | import(\"@langchain/core/messages\").SystemMessageChunk<import(\"@langchain/core/messages\").MessageStructure> | import(\"@langchain/core/messages\").ToolMessageChunk<import(\"@langchain/core/messages\").MessageStructure>;\n protected _convertCompletionsMessageToBaseMessage(message: OpenAIClient.ChatCompletionMessage, rawResponse: OpenAIClient.ChatCompletion): BaseMessage<import(\"@langchain/core/messages\").MessageStructure, import(\"@langchain/core/messages\").MessageType>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {\n raw: BaseMessage;\n parsed: RunOutput;\n }>;\n}\n"],"mappings":";;;;;;;;UAKiBS,uBAAAA,SAAgCJ;YACnCK;;AADGD,UAGAE,iBAAAA,SAA0BJ,gBAHH,CAAA;EAAA;;;AAA8B;EAGrDI,MAAAA,CAAAA,EAAAA,MAAAA;EAAiB;;;EAoBT,KApBkBJ,CAAAA,EAAAA,MAAAA;EAAgB;AAiY3D;;;;EAQkD,IAAzBO,CAAAA,EA1XdF,KA0XcE,CAAAA,MAAAA,CAAAA;EAAO;;;;EAGoL,aAAAE,CAAAA,EAxXhMJ,KAwXgMI,CAAAA,MAAAA,CAA+IC;EAAgB;;;EAA2D,SAAAD,CAAAA,EAAAA,OAAAA;EAAgK;;;EAAyD,WAAAA,CAAAA,EAAAA,MAAAA;EAA+J;;;;EACzlB,SAAAA,CAAAA,EAAAA,MAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAZ9I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA1CH,YAAAA,SAAqBP,sBAAsBG;;;;;;;;uBAQvCK,QAAQH;;;SAGtBD,kCAAkCF,YAAAA,CAAaO,yGAA8MC,yBAAAA,CAAlEE,eAAzHF,yBAAAA,CAA2KC,gBAAAA,IAA2HD,yBAAAA,CAApEG,iBAA3FH,yBAAAA,CAA+IC,gBAAAA,IAA+HD,yBAAAA,CAAxEI,qBAA3FJ,yBAAAA,CAAmJC,gBAAAA,IAA4HD,yBAAAA,CAArEK,kBAA3FL,yBAAAA,CAAgJC,gBAAAA,IAA6HD,yBAAAA,CAAtEM,mBAA3FN,yBAAAA,CAAiJC,gBAAAA,IAA2HD,yBAAAA,CAApEO,iBAA3FP,yBAAAA,CAA+IC,gBAAAA;6DACvtBT,YAAAA,CAAagB,oCAAoChB,YAAAA,CAAaiB,iBAAiBvB,YAAHc,yBAAAA,CAAkDC,gBAAAA,EAAgBD,yBAAAA,CAAqCU,WAAAA;;;oBAG5NhB,sBAAsBA,mCAAmCN,eAAeuB;;IAEvFjB,8BAA8BT,uCAAuCE,SAASH,wBAAwB2B;;;oBAGvFjB,sBAAsBA,mCAAmCN,eAAeuB;;IAEvFjB,8BAA8BT,sCAAsCE,SAASH;SACvEE;YACGyB;;;;oBAIMjB,sBAAsBA,mCAAmCN,eAAeuB;;IAEvFjB,8BAA8BT,yCAAyCE,SAASH,wBAAwB2B,aAAaxB,SAASH;SACxHE;YACGyB"}