-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersneed confirmation
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
When gemini-2.5-flash-image-preview with https://ai.pydantic.dev/builtin-tools/#image-generation-tool (see example code there) is passed message history from another model with tool calls or thinking, the API returns an error:
Tool calls:
Function calling is not enabled for models/gemini-2.5-flash-image-preview
Thinking signatures:
Request contains an invalid argument.
Thinking signatures we can simply omit (while leaving the thinking summaries in), but tool calls are a bit more tricky, as the tool call results may be relevant to image generation, and may not be repeated in text messages.
Example Code
Python, Pydantic AI & LLM client version
Latest
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomersneed confirmation