feat: 支持字符串类型的embedding输入参数
在AiGateWayManager中新增对JsonElement字符串类型的处理,确保embedding请求能够正确处理单个字符串输入参数。
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user