fix: 将默认 max_tokens 从 100000 调整为 64000

将 Yi.Framework.AiHub.Domain/AiGateWay/Impl/ThorClaude/Chats/ClaudiaChatCompletionsService.cs 中对外请求的默认 max_tokens 值由 100000 降为 64000。

原因:避免超出模型/服务允许的 token 限制或引发资源/性能异常;仍然允许通过 input.MaxTokens 显式覆盖该默认值。已在本地构建并用简单请求验证变更生效。
This commit is contained in:
chenchun
2025-11-24 17:42:18 +08:00
parent 41435f1aa3
commit 4c65b2398d

View File

@@ -345,7 +345,7 @@ public sealed class ClaudiaChatCompletionsService(
var response = await client.HttpRequestRaw(options.Endpoint.TrimEnd('/') + "/v1/messages", new var response = await client.HttpRequestRaw(options.Endpoint.TrimEnd('/') + "/v1/messages", new
{ {
model = input.Model, model = input.Model,
max_tokens = input.MaxTokens ?? 100000, max_tokens = input.MaxTokens ?? 64000,
stream = true, stream = true,
tool_choice, tool_choice,
system = CreateMessage(input.Messages.Where(x => x.Role == "system").ToList(), options), system = CreateMessage(input.Messages.Where(x => x.Role == "system").ToList(), options),