v1.73.0

pydantic/pydantic-aiv1.73.0Mar 27, 2026by DouweM

AI Summary

Adds lifecycle hooks to dataset evaluation and allows hooks to control retry flow, along with improvements to capability schemas and dependency updates.

Key Highlights

  • Added `CaseLifecycle` hooks to `Dataset.evaluate`.
  • Hooks can now raise `ModelRetry` for retry control flow.
  • Hooks can swap models via `ModelRequestContext`.
  • Fixed `x-ai` provider_fallback regex matching.
  • Fixed capability schema generation to include full parameter types.

New Features

  • `CaseLifecycle` hooks
  • Retry control via hooks

Full Release Notes

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

## What's Changed
### 🚀 Features
* feat: add `CaseLifecycle` hooks to `Dataset.evaluate` by @dmontagu in https://github.com/pydantic/pydantic-ai/pull/4854
* Allow hooks to raise `ModelRetry` for retry control flow by @DouweM in https://github.com/pydantic/pydantic-ai/pull/4858
* Allow before/wrap model request hooks to swap the model via `ModelRequestContext` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/4855
### 🐛 Bug Fixes
* fix: xAI provider_fallback changed to `x-ai` matching `genai-prices` by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4789
* Fix capability schema generation to include full parameter types by @DouweM in https://github.com/pydantic/pydantic-ai/pull/4867
### 📦 Dependencies
* Bump temporal `>=1.24.0` by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4863


**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v1.72.0...v1.73.0