From 942e218a9e1a03219641903d70629443e1e002b9 Mon Sep 17 00:00:00 2001 From: ccnetcore Date: Sat, 23 Aug 2025 13:15:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20FileMaster=20?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/AiChatService.cs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/AiChatService.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/AiChatService.cs index 745e468d..335697f5 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/AiChatService.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/AiChatService.cs @@ -122,4 +122,41 @@ public class AiChatService : ApplicationService await _aiGateWayManager.CompleteChatStreamForStatisticsAsync(_httpContextAccessor.HttpContext, input, CurrentUser.Id, sessionId, cancellationToken); } + + + /// + /// 发送消息 + /// + /// + /// + [HttpPost("ai-chat/FileMaster/send")] + public async Task PostFileMasterSendAsync([FromBody] ThorChatCompletionsRequest input, + CancellationToken cancellationToken) + { + if (!string.IsNullOrWhiteSpace(input.Model)) + { + throw new BusinessException("当前接口不支持第三方使用"); + } + + if (CurrentUser.IsAuthenticated) + { + await _aiBlacklistManager.VerifiyAiBlacklist(CurrentUser.GetId()); + if (CurrentUser.IsAiVip()) + { + input.Model = "gpt-5-chat"; + } + else + { + input.Model = "gpt-4.1-mini"; + } + } + else + { + input.Model = "DeepSeek-R1-0528"; + } + + //ai网关代理httpcontext + await _aiGateWayManager.CompleteChatStreamForStatisticsAsync(_httpContextAccessor.HttpContext, input, + CurrentUser.Id, null, cancellationToken); + } } \ No newline at end of file