.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.
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:
-
implement a plugin with a DateTime input arg : ConvertGregorianToJalali(DateTime datetime) {}
-
register the plugin into kernel
-
set GeminiToolCallBehavior.AutoInvokeKernelFunctions for execution setting
-
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"
-
Expected behavior I did not encounter any issues with the same functions when using the OpenAI API
Screenshots
Platform
- OS: Windows
- IDE: Visual Studi
- Language: C#
- Source:
Additional context Add any other context about the problem here.
@RogerBarreto can you take a look?
Hi, I would like to ask about this issue. Are there any updates or progress available at the moment?
This issue is stale because it has been open for 90 days with no activity.