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

.Net: Bug: .Net: Kernel functions cause a 400 error (Bad Request) when any kernel function includes a non-primitive input parameter while using Gemini as the AI model. #10038

Open
rahayzd opened this issue Dec 29, 2024 · 1 comment
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@rahayzd
Copy link

rahayzd commented Dec 29, 2024

Describe the bug
When using Gemini models for the ChatCompletion service with GeminiToolCallBehavior.AutoInvokeKernelFunctions, I encounter an error indicating that some input arguments of plugins are not acceptable. Only simple data types like int, string, etc., or the Kernel type are accepted. For instance, kernel functions that include parameters of types like DateTime (and many other class types) result in a BadRequest error.

To Reproduce
Steps to reproduce the behavior:

  1. implement a plugin with a DateTime input arg :
    ConvertGregorianToJalali(DateTime datetime) {}

  2. register the plugin into kernel

  3. set GeminiToolCallBehavior.AutoInvokeKernelFunctions for execution setting

  4. try to get the result of GetChatMessageContentAsync(prompt , execution setting , kernel) -> chat completion should be registered with an gemini model like "gemini-1.5-flash-latest"

  5. Expected behavior
    I did not encounter any issues with the same functions when using the OpenAI API

Screenshots
Image
Image

Platform

  • OS: Windows
  • IDE: Visual Studi
  • Language: C#
  • Source:

Additional context
Add any other context about the problem here.

@rahayzd rahayzd added the bug Something isn't working label Dec 29, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Dec 29, 2024
@github-actions github-actions bot changed the title Bug: .Net: Kernel functions cause a 400 error (Bad Request) when any kernel function includes a non-primitive input parameter while using Gemini as the AI model. .Net: Bug: .Net: Kernel functions cause a 400 error (Bad Request) when any kernel function includes a non-primitive input parameter while using Gemini as the AI model. Dec 29, 2024
@evchaki
Copy link
Contributor

evchaki commented Jan 2, 2025

@RogerBarreto can you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

No branches or pull requests

4 participants