fix: 修复输出为空问题
This commit is contained in:
@@ -73,15 +73,15 @@ public class ThorChatMessage
|
|||||||
{
|
{
|
||||||
if (value is JsonElement str)
|
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());
|
Contents = JsonSerializer.Deserialize<IList<ThorChatMessageContent>>(value?.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (value is string strInput)
|
|
||||||
{
|
|
||||||
Content = strInput;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Content = value?.ToString();
|
Content = value?.ToString();
|
||||||
|
|||||||
@@ -360,7 +360,11 @@ public class AiGateWayManager : DomainService
|
|||||||
//dto进行转换,支持多种格式
|
//dto进行转换,支持多种格式
|
||||||
if (input.Input is JsonElement str)
|
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();
|
var inputString = str.EnumerateArray().Select(x => x.ToString()).ToArray();
|
||||||
embeddingCreateRequest.InputAsList = inputString.ToList();
|
embeddingCreateRequest.InputAsList = inputString.ToList();
|
||||||
@@ -370,10 +374,6 @@ public class AiGateWayManager : DomainService
|
|||||||
throw new Exception("Input,输入格式错误,非string或Array类型");
|
throw new Exception("Input,输入格式错误,非string或Array类型");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (input.Input is string strInput)
|
|
||||||
{
|
|
||||||
embeddingCreateRequest.Input = strInput;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new Exception("Input,输入格式错误,未找到类型");
|
throw new Exception("Input,输入格式错误,未找到类型");
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace Yi.Abp.Web
|
|||||||
{
|
{
|
||||||
Configure<AbpBackgroundWorkerOptions> (options =>
|
Configure<AbpBackgroundWorkerOptions> (options =>
|
||||||
{
|
{
|
||||||
options.IsEnabled = true;
|
options.IsEnabled = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user