Root Cause
- The Gemini API does not currently support structured tool calling / function calling with JSON outputs (unlike OpenAI models).
- The API only supports returning text or multimodal responses, not strongly typed JSON function responses when using tool calling.
- Confirmed via these discussions:
Why This Matters
Structured output (JSON, function calling, or tool calling) is critical for:
- Using the tools to solve the problems that llms are not great at.
- Building reliable integrations without brittle text parsing.
6 Likes
Hi @Anirban_Majumder,
You are absolutely right about why this is a critical feature. I will have this feature request sent to the appropriate team.
Thanks for sharing.
1 Like
Yes, this is very much needed! We use OpenAI’s Agents SDK and want to migrate to Gemini but neither tools nor Responses API work. It is unbelievable that a company like Google cannot see that thousands of developers building on OpenAI’s Agents SDK. Migration is impossible.
1 Like
any luck on this fix or workarounds other libraries like the ai sdk are using your toolkit under the hood so the error is propagating, its imperative that you fix it