mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-11-23 12:10:21 +00:00
Optimized value handling
This commit is contained in:
parent
025c2094a7
commit
23d8c0f81e
@ -571,12 +571,12 @@ public abstract class BaseProvider : IProvider, ISecretId
|
|||||||
element.TryGetInt64(out var l) ? l :
|
element.TryGetInt64(out var l) ? l :
|
||||||
element.TryGetDouble(out var d) ? d :
|
element.TryGetDouble(out var d) ? d :
|
||||||
element.GetDecimal(),
|
element.GetDecimal(),
|
||||||
JsonValueKind.True => element.GetBoolean(),
|
JsonValueKind.True or JsonValueKind.False => element.GetBoolean(),
|
||||||
JsonValueKind.False => element.GetBoolean(),
|
JsonValueKind.Null => string.Empty,
|
||||||
JsonValueKind.Null => null,
|
JsonValueKind.Object => ConvertToDictionary(element),
|
||||||
JsonValueKind.Object => this.ConvertToDictionary(element),
|
JsonValueKind.Array => element.EnumerateArray().Select(ConvertJsonValue).ToList(),
|
||||||
JsonValueKind.Array => element.EnumerateArray().Select(this.ConvertJsonValue).ToList(),
|
|
||||||
_ => throw new InvalidOperationException($"Unsupported JSON value kind: {element.ValueKind}")
|
_ => string.Empty,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user