From e5b81c08f3f0fbc51978578fe47aded9138eff7c Mon Sep 17 00:00:00 2001 From: ccnetcore Date: Sat, 27 Dec 2025 23:53:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Claude=E6=A8=A1=E5=9E=8B=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=89=8D=E7=BA=A0=E6=AD=A3=20yi-=20=E5=89=8D=E7=BC=80?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在调用 Anthropic ChatCompletion 之前统一去除 yi- 模型前缀,避免传递错误的 model 参数导致请求异常 --- .../Managers/AiGateWayManager.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs index 9a07479a..d85ec770 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs @@ -515,14 +515,16 @@ public class AiGateWayManager : DomainService // 设置响应头,声明是 json //response.ContentType = "application/json; charset=UTF-8"; var modelDescribe = await GetModelAsync(ModelApiTypeEnum.Claude, request.Model); - var chatService = - LazyServiceProvider.GetRequiredKeyedService(modelDescribe.HandlerName); - var data = await chatService.ChatCompletionsAsync(modelDescribe, request, cancellationToken); if (!string.IsNullOrEmpty(request.Model) && request.Model.StartsWith("yi-", StringComparison.OrdinalIgnoreCase)) { request.Model = request.Model[3..]; } + + var chatService = + LazyServiceProvider.GetRequiredKeyedService(modelDescribe.HandlerName); + var data = await chatService.ChatCompletionsAsync(modelDescribe, request, cancellationToken); + data.SupplementalMultiplier(modelDescribe.Multiplier); if (userId is not null)