v2.5.1

pydantic/pydantic-aiv2.5.1Jul 7, 2026by dsfaccini

AI Summary

This release focuses on a variety of bug fixes across Bedrock, Groq, and evaluation tools, including improvements to tool handling, thinking settings, and model payload handling for Mistral and Cohere. It also welcomes several new contributors to the project.

Key Highlights

  • Fixed Bedrock tool result attachment co-location and excluded the deprecated `anthropic.claude-3-5-sonnet-20240620-v1:0` model.
  • Mapped unified `thinking` settings to Groq's `reasoning_effort` parameter.
  • Improved error handling by sending retry prompts for empty model responses instead of silent resubmit.
  • Added validation to reject non-positive `OnlineEvaluator.max_concurrency` values.
  • Accepted thinking-only responses when `output_type` allows None.

Full Release Notes

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

## What's Changed
### 🐛 Bug Fixes
* fix(bedrock): handle `toolResult` attachment co-location per-model via `bedrock_tool_result_colocatable_content` by @Hasnaathussain in https://github.com/pydantic/pydantic-ai/pull/6098
* fix(groq): map unified `thinking` setting to Groq `reasoning_effort` by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6231
* fix(evals): reject non-positive `OnlineEvaluator.max_concurrency` by @VectorPeak in https://github.com/pydantic/pydantic-ai/pull/6267
* fix: write relative schema refs for AgentSpec files by @VectorPeak in https://github.com/pydantic/pydantic-ai/pull/6251
* fix(agent): honor `end_strategy="early"` for `NativeOutput` by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/6279
* send retry prompt for empty model responses instead of silent resubmit by @dcosson in https://github.com/pydantic/pydantic-ai/pull/5643
* Preserve `FileUrl.force_download` in UI round-trips by @HarperZ9 in https://github.com/pydantic/pydantic-ai/pull/6205
* Exclude deprecated Bedrock gateway model `anthropic.claude-3-5-sonnet-20240620-v1:0` by @ddanielcruzz in https://github.com/pydantic/pydantic-ai/pull/6297
* fix: preserve union `NativeOutput` description instead of last member's docstring by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6265
* fix(bedrock): deliver unsupported tool-return media to models that isolate `toolResult` turns by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6259
* Revert "fix(agent): honor `end_strategy="early"` for `NativeOutput`" by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6301
* Accept thinking-only responses when output_type allows None by @kmike in https://github.com/pydantic/pydantic-ai/pull/5146
* Omit empty `ModelResponse` from Mistral and Cohere request payloads by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6302

## New Contributors
* @Hasnaathussain made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6098
* @saime428 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6268
* @NotFoundOvO made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6285
* @dcosson made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5643
* @HarperZ9 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6205
* @kmike made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5146

**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v2.5.0...v2.5.1