v2.1.0
pydantic/pydantic-aiv2.1.0Jun 29, 2026by adtyavrdhn
AI Summary
This release introduces support for Anthropic's new web tools with server-tool replay, improves instrumentation message serialization, and adds TypeAdapter for EvaluatorContext.
Key Highlights
- Anthropic _20260209 web tools with server-tool replay
- Instrumentation message attributes serialized with to_json
- TypeAdapter for EvaluatorContext
- Fix for ExceptionGroup-wrapped tool errors in MCPToolset
New Features
- Anthropic _20260209 web tools with server-tool replay
- TypeAdapter for EvaluatorContext
Full Release Notes
<!-- Release notes generated using configuration in .github/release.yml at main --> ## What's Changed ### 🚀 Features * feat: Add Anthropic `_20260209` web tools with server-tool replay by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4844 * Serialize instrumentation message attributes with to_json instead of json.dumps by @Kludex in https://github.com/pydantic/pydantic-ai/pull/6045 * Add TypeAdapter for EvaluatorContext by @hon-gyu in https://github.com/pydantic/pydantic-ai/pull/3373 ### 🐛 Bug Fixes * Convert `ExceptionGroup`-wrapped tool errors to `ModelRetry` in `MCPToolset` by @dmontagu in https://github.com/pydantic/pydantic-ai/pull/6004 * fix: prevent `cancel()` from flipping complete state on finished stream by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5795 * fix(temporal): add return type annotation to `PydanticAIPlugin.__init__` by @syf2211 in https://github.com/pydantic/pydantic-ai/pull/6065 * fix(anthropic): support Bedrock token counting by @dyscott in https://github.com/pydantic/pydantic-ai/pull/5480 ## New Contributors * @lucaszhu-hue made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5982 * @syf2211 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/6065 * @dyscott made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5480 * @hon-gyu made their first contribution in https://github.com/pydantic/pydantic-ai/pull/3373 **Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v2.0.0...v2.1.0