python Pydantic AI Releases · · 2.16.0

pydantic-ai v2.16.0 adds Model Armor and new Gemini models

sdkaiengineerpython-agentic
feature patch

This release of pydantic-ai introduces several new features, including support for Google Cloud Model Armor and new Gemini models, alongside improvements to tool handling and error management. These updates benefit developers building AI applications with pydantic-ai, offering enhanced capabilities and robustness. Notably, it also includes dependency upgrades to address security alerts.

  • Add ToolFailed for model-visible failures without retries by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5585
  • Add gemini-3.6-flash and gemini-3.5-flash-lite models by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6668
  • Preserve $ref sibling keywords when inlining $defs by @lntutor in https://github.com/pydantic/pydantic-ai/pull/6592
  • 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
Features (6)
  • 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
Fixes (5)
  • 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
Read the original announcement →

https://github.com/pydantic/pydantic-ai/releases/tag/v2.16.0

Related releases