Gemini 1.5-flash Function Calling Not Working (Works on Gemini 1.5-pro)

I’m encountering an issue with function calling using the Gemini 1.5-flash model. Function calls are working correctly with the Gemini 1.5-pro model, but consistently fail with the flash model despite identical configurations.

Both models are used with the same client setup:

client = genai.GenerativeModel(
  model_name= gemini.model_name,
  generation_config= gemini.generation_config,
  system_instruction=gemini.system_instructions,
  tools=gemini.tools,
  tool_config={'function_calling_config':'AUTO'},
)

Where gemini.generation_config, gemini.system_instructions, and gemini.tools are identical for both the flash and pro model invocations. The chat proceeds normally, and the model generates responses appropriately, but when a function call is expected, the flash model fails to invoke any functions while the pro model works as intended.

We’re trying to utilize the flash model for cost optimization in our project, but this function calling failure is blocking our progress.

Could you please advise on potential causes for this discrepancy? Are there known limitations or configuration differences specific to function calling with the Gemini 1.5-flash model that aren’t present in the pro model? Any troubleshooting steps or suggestions would be greatly appreciated.