Skip to content

v0.2.1 - Gemini Parallel Tool Calls Fix

Choose a tag to compare

@acedergren acedergren released this 05 Feb 13:44
· 12 commits to main since this release

What's Changed

Bug Fixes

  • Gemini parallel tool calls: Fixed issue where Gemini models failed when multiple tool calls occurred in a single turn. OCI's Generic format doesn't properly support parallel function calls for Gemini, so we now use a text fallback approach (same as Llama/xAI) when 2+ tool calls are detected.

  • Finish reason detection: Fixed finishReason to correctly return tool-calls when tool calls are present in the response.

  • Zod v4 schema support: Added ensureJsonSchema() helper that converts Zod v4 schemas to JSON Schema when needed (AI SDK v5 compatibility).

Other Changes

  • Updated .gitignore to exclude local test files and tool directories
  • Bumped ai SDK to 5.0.126
  • Added zod-to-json-schema dev dependency

Technical Details

The parallel tool call fix works by:

  • Single tool call: Uses standard toolCalls array + TOOL message (works correctly)
  • Parallel tool calls (2+): Converts both tool calls and results to text format in ASSISTANT/USER messages

This is a workaround for OCI's Generic format limitation that doesn't properly batch multiple TOOL responses for Gemini.

Full Changelog: v0.2.0...v0.2.1