Fix Gemini multimodal tool results causing flaky responses

For Gemini 3, images are now nested inside functionResponse.parts per the docs.
For older models, images are sent in a separate user message.

See: https://ai.google.dev/gemini-api/docs/function-calling#multimodal
This commit is contained in:
Mario Zechner 2025-12-21 02:41:27 +01:00
parent ce950ae96e
commit bf51dd4126
2 changed files with 29 additions and 19 deletions

View file

@ -1,6 +1,6 @@
# Changelog
## [Unreleased]
## [0.25.1] - 2025-12-21
### Added
@ -8,6 +8,8 @@
### Fixed
- **Gemini multimodal tool results**: Fixed images in tool results causing flaky/broken responses with Gemini models. For Gemini 3, images are now nested inside `functionResponse.parts` per the [docs](https://ai.google.dev/gemini-api/docs/function-calling#multimodal). For older models (which don't support multimodal function responses), images are sent in a separate user message.
- **Queued message steering**: When `getQueuedMessages` is provided, the agent loop now checks for queued user messages after each tool call and skips remaining tool calls in the current assistant message when a queued message arrives (emitting error tool results).
- **Double API version path in Google provider URL**: Fixed Gemini API calls returning 404 after baseUrl support was added. The SDK was appending its default apiVersion to baseUrl which already included the version path. ([#251](https://github.com/badlogic/pi-mono/pull/251) by [@shellfyred](https://github.com/shellfyred))