@drx974/n8n-nodes-deepseek-fixed 0.1.0 → 0.1.2

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.
@@ -50,7 +50,7 @@ export declare class ChatDeepSeekFixed extends BaseChatModel {
50
50
  * only sets `strict` when explicitly told to, so simply not forwarding it
51
51
  * here is enough to keep it out of the wire payload.
52
52
  */
53
- bindTools(tools: BindToolsInput[], _kwargs?: Record<string, unknown>): ReturnType<NonNullable<BaseChatModel['bindTools']>>;
53
+ bindTools(tools: BindToolsInput[], _kwargs?: Record<string, unknown>): ReturnType<NonNullable<BaseChatModel["bindTools"]>>;
54
54
  private toOpenAIMessages;
55
55
  _generate(messages: BaseMessage[], _options: this['ParsedCallOptions'], _runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;
56
56
  }
@@ -119,11 +119,23 @@ class ChatDeepSeekFixed extends chat_models_1.BaseChatModel {
119
119
  if (this.boundTools.length > 0) {
120
120
  body.tools = this.boundTools;
121
121
  }
122
- if (this.thinkingMode !== 'disabled') {
123
- body.extra_body = {
124
- thinking: { type: 'enabled' },
125
- ...(this.thinkingMode === 'max' ? { reasoning_effort: 'max' } : {}),
126
- };
122
+ // DeepSeek's thinking mode defaults to ENABLED server-side even when this
123
+ // field is omitted entirely — it must be set explicitly in both
124
+ // directions, or "Disabled" here silently has no effect and DeepSeek
125
+ // keeps thinking (and returning reasoning_content) regardless.
126
+ //
127
+ // IMPORTANT: `thinking` belongs at the TOP LEVEL of the request body.
128
+ // DeepSeek's own docs show `extra_body={"thinking": ...}` in Python
129
+ // examples, but that's a Python-openai-SDK-only convention that merges
130
+ // those keys into the root of the outgoing JSON — it is not itself a
131
+ // field DeepSeek recognizes. Nesting it under a literal `extra_body`
132
+ // key here (as an earlier version of this file did) sends a field
133
+ // DeepSeek silently ignores, so thinking stays on regardless of this
134
+ // setting.
135
+ body.thinking =
136
+ this.thinkingMode === 'disabled' ? { type: 'disabled' } : { type: 'enabled' };
137
+ if (this.thinkingMode === 'max') {
138
+ body.reasoning_effort = 'max';
127
139
  }
128
140
  const completion = await this.client.chat.completions.create(body);
129
141
  const choice = completion.choices[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drx974/n8n-nodes-deepseek-fixed",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "DeepSeek Chat Model for n8n AI Agent — fixes strict tool-schema rejection and reasoning_content passback",
5
5
  "keywords": [
6
6
  "n8n-community-node-package"