v2.16.0

pydantic/pydantic-aiv2.16.0Jul 23, 2026by dsfaccini

AI Summary

Adds Mistral prompt caching, `ToolFailed` status, optional `run_id`, Google Cloud Model Armor support, and new Gemini models. Fixes various durability and tool retry issues.

Key Highlights

  • Add `mistral_prompt_cache_key` setting and parallel tool calls
  • Add `ToolFailed` for model-visible failures
  • Add `gemini-3.6-flash` and `gemini-3.5-flash-lite` models
  • Add Model Armor support for Google Cloud

New Features

  • Mistral prompt caching
  • ToolFailed status
  • New Gemini models
  • Google Cloud Model Armor

Full Release Notes

<!-- Release notes generated using configuration in .github/release.yml at main -->

## What's Changed
### 🚀 Features
* Add `mistral_prompt_cache_key` setting and pass `parallel_tool_calls` to the Mistral SDK by @lionpeloux in https://github.com/pydantic/pydantic-ai/pull/6654
* Add `ToolFailed` for model-visible failures without retries by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5585
* Add optional `run_id=` to agent runs, durable wrappers, and UI adapters by @grahamcracker1234 in https://github.com/pydantic/pydantic-ai/pull/6615
* Hoist `openai_moderation` to `OpenAIChatModelSettings` and expose Chat Completions moderation results in `provider_details` by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6658
* feat(google): add Model Armor support for Google Cloud via `GoogleModelSettings` by @Alex-Resch in https://github.com/pydantic/pydantic-ai/pull/5691
* Add `gemini-3.6-flash` and `gemini-3.5-flash-lite` models by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6668
### 🐛 Bug Fixes
* Raise a consistent `ctx.enqueue()` error inside durable units across Temporal, DBOS, and Prefect by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6666
* Preserve `$ref` sibling keywords when inlining `$defs` by @lntutor in https://github.com/pydantic/pydantic-ai/pull/6592
* Guard `ctx.enqueue()` from an `event_stream_handler` inside DBOS steps / Prefect tasks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6671
* Preserve failed tool outcomes across AG-UI message round trips by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6659
* Fix tool retry counts across skipped steps by @zcxGGmu in https://github.com/pydantic/pydantic-ai/pull/6582
### 📦 Dependencies
* Bump pillow, pyasn1, and setuptools to resolve Dependabot alerts by @hramezani in https://github.com/pydantic/pydantic-ai/pull/6657

## New Contributors
* @AKSHITAK1040 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6633
* @grahamcracker1234 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6615
* @sergioperezcheco made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6585
* @lntutor made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6592
* @zcxGGmu made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6582

**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v2.15.0...v2.16.0