semantic-kernel
semantic-kernel copied to clipboard
.Net: Marshaling arguments of JsonElement type
Consider marshaling arguments of JsonElement type to target function parameter types.
Example:
[Fact]
public async void MarshalArgumentsOfJsonElementTypeAsync()
{
// Arrange
var element = JsonDocument.Parse("28").RootElement;
object? actualValue = null;
var function1 = KernelFunctionFactory.CreateFromMethod((int number) => { actualValue = number; });
await function1.InvokeAsync(this._kernel, new() { ["number"] = element });
Assert.NotNull(actualValue);
Assert.Equal(28, actualValue);
}
This issue is stale because it has been open for 90 days with no activity.
Closing as stale