Gemini 2.0: Returns more than one function call arguments, wasn't able to follow the function calling schema

I have a chatbot which utilizes function calling for my “artifacts” feature and other plugins using function calling, now my bot expects the LLM to return a single function calling result as according to the schema I declared shown below

The problem is that if I use Gemini 2.0, instead of normally returning a single function call argument part to extract arguments and call function according to the schema, it returns more function call argument instead of just one which makes function calling unreliable, you can see here below is it actually returned two or more function calling arguments

My workaround is basically yeah get the first function call part and add it to the context manually instead…

In general, this makes Gemini 2.0 unsuitable for certain applications where only one function call argument is needed, we need a way to make it easier to control how many function calling arguments should return

This also this breaks when there’s an array used in function calling arguments but instead of returning with proper arrays arguments according to the OpenAPI schema, it yields as separate func call argument parts

My bot that uses function calling: JakeyBot/core/aimodels/gemini/infer.py at gemini-v2-sdk · zavocc/JakeyBot · GitHub

we don’t need agent-like gimmick in my chatbot for now.

AIStudio Prompt for better illustration: https://aistudio.google.com/app/prompts?state={"ids":["1p8aqjAJSrVzB7yEEL2Zl-sxyjgJ4pCWz"],"action":"open","userId":"102239655130366360305","resourceKeys":{}}&usp=sharing