@raolin2025/claude-code-node 2.2.1 → 2.2.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.
- package/package.json +1 -1
- package/src/core/query-engine.js +9 -0
package/package.json
CHANGED
package/src/core/query-engine.js
CHANGED
|
@@ -293,6 +293,8 @@ export class QueryEngine {
|
|
|
293
293
|
}))
|
|
294
294
|
|
|
295
295
|
const useStream = !this.config.noStream
|
|
296
|
+
const modelLower = this.config.model.toLowerCase()
|
|
297
|
+
|
|
296
298
|
const body = {
|
|
297
299
|
model: this.config.model,
|
|
298
300
|
messages,
|
|
@@ -301,6 +303,13 @@ export class QueryEngine {
|
|
|
301
303
|
...(useStream && { stream: true }),
|
|
302
304
|
}
|
|
303
305
|
|
|
306
|
+
// DeepSeek V4: 默认启用 thinking mode → 要求回传 reasoning_content
|
|
307
|
+
// 这里显式关闭,避免 tool call 场景下的 400 错误
|
|
308
|
+
// thinking 参数是 DeepSeek 私有扩展,直接放在 body 顶层
|
|
309
|
+
if (modelLower.startsWith('deepseek-v')) {
|
|
310
|
+
body.thinking = { type: 'disabled' }
|
|
311
|
+
}
|
|
312
|
+
|
|
304
313
|
const url = apiBase.replace(/\/+$/, '') + '/chat/completions'
|
|
305
314
|
|
|
306
315
|
// H3 修复:SSRF 防护 — 在 fetch 之前检查 API 主机名
|