semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.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.

Open rahayzd opened this issue 1 year ago • 3 comments

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 avatar Dec 29 '24 13:12 rahayzd

@RogerBarreto can you take a look?

evchaki avatar Jan 02 '25 16:01 evchaki

Hi, I would like to ask about this issue. Are there any updates or progress available at the moment?

bauann avatar Jan 17 '25 10:01 bauann

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Apr 18 '25 02:04 github-actions[bot]