fix: 修复输出为空问题
This commit is contained in:
@@ -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<IList<ThorChatMessageContent>>(value?.ToString());
|
||||
}
|
||||
}
|
||||
else if (value is string strInput)
|
||||
{
|
||||
Content = strInput;
|
||||
}
|
||||
else
|
||||
{
|
||||
Content = value?.ToString();
|
||||
|
||||
@@ -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,输入格式错误,未找到类型");
|
||||
|
||||
Reference in New Issue
Block a user