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 7377423a..9a07479a 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 @@ -96,7 +96,7 @@ public class AiGateWayManager : DomainService if (!string.IsNullOrEmpty(aiModelDescribe.ModelId) && aiModelDescribe.ModelId.StartsWith("yi-", StringComparison.OrdinalIgnoreCase)) { - aiModelDescribe.ModelId = aiModelDescribe.ModelId[^3..]; + aiModelDescribe.ModelId = aiModelDescribe.ModelId[3..]; } return aiModelDescribe; } @@ -518,7 +518,11 @@ public class AiGateWayManager : DomainService 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..]; + } data.SupplementalMultiplier(modelDescribe.Multiplier); if (userId is not null) @@ -585,7 +589,7 @@ public class AiGateWayManager : DomainService if (!string.IsNullOrEmpty(request.Model) && request.Model.StartsWith("yi-", StringComparison.OrdinalIgnoreCase)) { - request.Model = request.Model[^3..]; + request.Model = request.Model[3..]; } var completeChatResponse = chatService.StreamChatCompletionsAsync(modelDescribe, request, cancellationToken);