From 15f3af406cf6c263a32e5a4c50f86264a5f92b04 Mon Sep 17 00:00:00 2001 From: Simon <10131203+gaomeng1900@users.noreply.github.com> Date: Mon, 27 Apr 2026 20:32:53 +0800 Subject: [PATCH] fix(llms): remove tool_choice for deepseek models --- packages/llms/src/utils.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/llms/src/utils.ts b/packages/llms/src/utils.ts index 7a6c838..042a64d 100644 --- a/packages/llms/src/utils.ts +++ b/packages/llms/src/utils.ts @@ -93,6 +93,11 @@ export function modelPatch(body: Record) { body.reasoning_effort = 'minimal' } + if (modelName.startsWith('deepseek')) { + debug('Applying DeepSeek patch: remove tool_choice') + delete body.tool_choice + } + if (modelName.startsWith('minimax')) { debug('Applying MiniMax patch: clamp temperature to (0, 1]') // MiniMax API rejects temperature = 0; clamp to a small positive value