From 5a292d60ecb2768fa5f070dca73de9d9a0766461 Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Mon, 17 Aug 2026 17:52:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(providers):=20Anthropic=20=E5=9E=8B=20provi?= =?UTF-8?q?der=20max=5Ftokens=20=E7=95=99=E7=A9=BA=E5=85=9C=E5=BA=95?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E8=87=B3=208192?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - max_tokens 未配置时兜底值由 1024 调整为 8192,避免长回复被过早截断 - 同步设置页提示:留空则不传该字段(Anthropic 型 provider 回退为 8192),并移除 Temperature 的误导性占位符 0.7 --- src/providers/anthropic.rs | 2 +- web/src/components/Settings/tabs/ModelsTab.tsx | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/providers/anthropic.rs b/src/providers/anthropic.rs index 726503e..e595820 100644 --- a/src/providers/anthropic.rs +++ b/src/providers/anthropic.rs @@ -261,7 +261,7 @@ impl LLMProvider for AnthropicProvider { request: ChatCompletionRequest, ) -> Result> { let url = format!("{}/v1/messages", self.base_url); - let max_tokens = request.max_tokens.or(self.max_tokens).unwrap_or(1024); + let max_tokens = request.max_tokens.or(self.max_tokens).unwrap_or(8192); tracing::info!( provider = %self.name, diff --git a/web/src/components/Settings/tabs/ModelsTab.tsx b/web/src/components/Settings/tabs/ModelsTab.tsx index 30342a0..49a0513 100644 --- a/web/src/components/Settings/tabs/ModelsTab.tsx +++ b/web/src/components/Settings/tabs/ModelsTab.tsx @@ -47,12 +47,11 @@ export function ModelsTab({ config, update }: TabProps) { editors.patch(name, { temperature: e.target.value ? +e.target.value : undefined }) } className={inputCls} - placeholder="0.7" />