mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-11-23 10:50: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.TryGetDouble(out var d) ? d :
|
||||
element.GetDecimal(),
|
||||
JsonValueKind.True => element.GetBoolean(),
|
||||
JsonValueKind.False => element.GetBoolean(),
|
||||
JsonValueKind.Null => null,
|
||||
JsonValueKind.Object => this.ConvertToDictionary(element),
|
||||
JsonValueKind.Array => element.EnumerateArray().Select(this.ConvertJsonValue).ToList(),
|
||||
_ => throw new InvalidOperationException($"Unsupported JSON value kind: {element.ValueKind}")
|
||||
JsonValueKind.True or JsonValueKind.False => element.GetBoolean(),
|
||||
JsonValueKind.Null => string.Empty,
|
||||
JsonValueKind.Object => ConvertToDictionary(element),
|
||||
JsonValueKind.Array => element.EnumerateArray().Select(ConvertJsonValue).ToList(),
|
||||
|
||||
_ => string.Empty,
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user