From cfde73d13aed3bda855ec512e528c4a6a83141b4 Mon Sep 17 00:00:00 2001 From: chenchun Date: Mon, 11 Aug 2025 16:53:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/OpenAi/ThorChatMessage.cs | 10 +++++----- .../Managers/AiGateWayManager.cs | 10 +++++----- Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/ThorChatMessage.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/ThorChatMessage.cs index ca675343..b4afa44e 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/ThorChatMessage.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Domain.Shared/Dtos/OpenAi/ThorChatMessage.cs @@ -73,15 +73,15 @@ public class ThorChatMessage { if (value is JsonElement str) { - if (str.ValueKind == JsonValueKind.Array) + if (str.ValueKind == JsonValueKind.String) + { + Content = value?.ToString(); + } + else if (str.ValueKind == JsonValueKind.Array) { Contents = JsonSerializer.Deserialize>(value?.ToString()); } } - else if (value is string strInput) - { - Content = strInput; - } else { Content = value?.ToString(); 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 fe49de86..c451c43d 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 @@ -360,7 +360,11 @@ public class AiGateWayManager : DomainService //dto进行转换,支持多种格式 if (input.Input is JsonElement str) { - if (str.ValueKind == JsonValueKind.Array) + if (str.ValueKind == JsonValueKind.String) + { + embeddingCreateRequest.Input = str.ToString(); + } + else if (str.ValueKind == JsonValueKind.Array) { var inputString = str.EnumerateArray().Select(x => x.ToString()).ToArray(); embeddingCreateRequest.InputAsList = inputString.ToList(); @@ -370,10 +374,6 @@ public class AiGateWayManager : DomainService throw new Exception("Input,输入格式错误,非string或Array类型"); } } - else if (input.Input is string strInput) - { - embeddingCreateRequest.Input = strInput; - } else { throw new Exception("Input,输入格式错误,未找到类型"); diff --git a/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs b/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs index 26c53a67..be0fe985 100644 --- a/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs +++ b/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs @@ -110,7 +110,7 @@ namespace Yi.Abp.Web { Configure (options => { - options.IsEnabled = true; + options.IsEnabled = false; }); }