From eb5009f437a067a60b9e3d163541195c1da845bc Mon Sep 17 00:00:00 2001 From: zpc Date: Wed, 17 Jul 2024 16:00:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs b/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs index eb10dff..30422d4 100644 --- a/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs +++ b/src/0-core/HuanMeng.MiaoYu.Code/Chat/ChatBLL.cs @@ -251,6 +251,10 @@ namespace HuanMeng.MiaoYu.Code.Chat var claude = charact.ModelConfig.GetClaudeChatConfig(); IChat chat = new ClaudeChat(claude, HttpClientFactory); var response = await chat.MessagesAsync(baseChatParams); + if (response == null) + { + throw new Exception("ai出现错误"); + } var claudeChatResponse = response as ClaudeChatResponse; #endregion T_Chat t_Chat = new T_Chat