Describe the bug
Function call fails when trying to call function that has guid parameter:
fail: Microsoft.SemanticKernel.KernelFunction[0]
Function TodoPlugin-SetCompleted failed. Error: No converter found to convert from System.Guid to System.Text.Json.JsonElement. (Parameter 'id')
Actual value was 9416a630-d9ca-45d0-bf02-3f8d0d3e17bb.
System.ArgumentOutOfRangeException: No converter found to convert from System.Guid to System.Text.Json.JsonElement. (Parameter 'id')
Actual value was 9416a630-d9ca-45d0-bf02-3f8d0d3e17bb.
at Microsoft.SemanticKernel.KernelFunctionFromMethod.<>c__DisplayClass22_0.<GetParameterMarshalerDelegate>g__Process|10(Object value, <>c__DisplayClass22_1&)
at Microsoft.SemanticKernel.KernelFunctionFromMethod.<>c__DisplayClass22_0.<GetParameterMarshalerDelegate>g__parameterFunc|9(KernelFunction _, Kernel kernel, KernelArguments arguments, CancellationToken __)
at Microsoft.SemanticKernel.KernelFunctionFromMethod.<>c__DisplayClass20_0.<GetMethodDetails>g__Function|0(Kernel kernel, KernelFunction function, KernelArguments arguments, CancellationToken cancellationToken)
at Microsoft.SemanticKernel.KernelFunctionFromMethod.InvokeCoreAsync(Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)
at Microsoft.SemanticKernel.KernelFunction.<>c__DisplayClass27_0.<<InvokeAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.SemanticKernel.Kernel.InvokeFilterOrFunctionAsync(NonNullCollection`1 functionFilters, Func`2 functionCallback, FunctionInvocationContext context, Int32 index)
at Microsoft.SemanticKernel.Kernel.OnFunctionInvocationAsync(KernelFunction function, KernelArguments arguments, FunctionResult functionResult, Boolean isStreaming, Func`2 functionCallback, CancellationToken cancellationToken)
at Microsoft.SemanticKernel.KernelFunction.InvokeAsync(Kernel kernel, KernelArguments arguments, CancellationToken cancellationToken)
To Reproduce
Steps to reproduce the behavior:
Add plugin with function with guid parameter, in my case:
[KernelFunction, Description("Set the completed state of a todo")]
public void SetCompleted(
[Description("Determines the id of the todo to toggle")] Guid id,
[Description("Determines whether to to complete or to resume the todo")] bool complete = true)
{
//...
}
Give instructions that will call the function
Expected behavior
Function calls work with functions with guid parameters
Platform
Language: C#
Source: Nuget dotnet-1.29.0
Additional context
Works well with the Azure connector.
Describe the bug Function call fails when trying to call function that has guid parameter:
To Reproduce Steps to reproduce the behavior:
Expected behavior Function calls work with functions with guid parameters
Platform
Additional context Works well with the Azure connector.