Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Ollama connector fails when calling plugin functions that have parameters with Guid type #9711

Open
nitrovent opened this issue Nov 14, 2024 · 1 comment · May be fixed by #9784
Open
Assignees
Labels
ai connector Anything related to AI connectors bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@nitrovent
Copy link

nitrovent commented Nov 14, 2024

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:

  1. 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) 
{ 
//...
}
  1. 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.

@nitrovent nitrovent added the bug Something isn't working label Nov 14, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Nov 14, 2024
@github-actions github-actions bot changed the title Bug: Ollama connector fails when calling plugin functions that have boolean parameters .Net: Bug: Ollama connector fails when calling plugin functions that have boolean parameters Nov 14, 2024
@nitrovent nitrovent changed the title .Net: Bug: Ollama connector fails when calling plugin functions that have boolean parameters Bug: Ollama connector fails when calling plugin functions that have parameters with Guid type Nov 14, 2024
@nitrovent
Copy link
Author

Edit because I thought I it was with a boolean parameter. I am sure I saw that error for boolean, too when testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai connector Anything related to AI connectors bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
Status: Sprint: In Progress
3 participants