From d9971541f280c3fbcaa5aca5e7a31fe50423fd15 Mon Sep 17 00:00:00 2001 From: chenchun Date: Mon, 11 Aug 2025 18:10:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E7=B1=BB=E5=9E=8B=E7=9A=84embedding=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在AiGateWayManager中新增对JsonElement字符串类型的处理,确保embedding请求能够正确处理单个字符串输入参数。 --- .../Yi.Framework.AiHub.Domain/Managers/AiGateWayManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 31eca5c8..82f6e188 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();