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; }); }