v1.59.0

pydantic/pydantic-aiv1.59.0Feb 14, 2026by DouweM

AI Summary

This release adds a Model.model_id property returning provider:model format, an opt-in flag for aggregated usage attribute names, and enhances the Contains evaluator to support pydantic.BaseModel. Bug fixes address XAI AsyncClient event loop handling.

Key Highlights

  • Add Model.model_id property that returns provider:model
  • Add opt-in flag for aggregated usage attribute names
  • Enhance Contains evaluator to support pydantic.BaseModel
  • Vercel AI adapter: let BaseChunks be injected through ToolReturnPart.metadata
  • XAI: lazily create AsyncClient per event loop to avoid gRPC loop mismatch

New Features

  • Model.model_id property
  • Opt-in flag for aggregated usage attribute names
  • Contains evaluator pydantic.BaseModel support
  • BaseChunk injection through ToolReturnPart.metadata

Full Release Notes

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

## What's Changed
### 🚀 Features
* Add `Model.model_id` property that returns `provider:model` by @tdevelope in https://github.com/pydantic/pydantic-ai/pull/3917
* Add opt-in flag for aggregated usage attribute names by @thiagohora in https://github.com/pydantic/pydantic-ai/pull/4277
* Enhance `Contains` evaluator to support `pydantic.BaseModel` by @tomsquest in https://github.com/pydantic/pydantic-ai/pull/4003
* Vercel AI adapter: let `BaseChunk`s be injected through `ToolReturnPart.metadata` by @0xyjk in https://github.com/pydantic/pydantic-ai/pull/4230
### 🐛 Bug Fixes
* XAI: lazily create AsyncClient per event loop to avoid gRPC loop mismatch by @DouweM in https://github.com/pydantic/pydantic-ai/pull/4316

## New Contributors
* @tdevelope made their first contribution in https://github.com/pydantic/pydantic-ai/pull/3917
* @thiagohora made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4277
* @0xyjk made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4230

**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v1.58.0...v1.59.0