pydantic-ai v2.13.0: New Instrumentation, Usage Metrics, and Bug Fixes
Pydantic-ai version 2.13.0 introduces new features for instrumentation and usage tracking, including the ability to omit model request parameters from spans and a new `cache_hit_ratio` property. It also enhances error handling for content filters and fixes several bugs related to streaming and temporal workflows. These updates are primarily relevant to developers integrating AI models via pydantic-ai, offering improved debugging and monitoring capabilities.
- →feat(usage): add cache_hit_ratio property to RequestUsage and RunUsage by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6529
- →Add get_model, resolve_model_id, and for_agent capability hooks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6333
- →Fix MistralModel streaming settings by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6563
- →Close open message parts (text, thinking, tool calls) on UI stream error by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6550
- →fix(temporal): pass through pydantic_monty in workflow sandbox by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6564
Features (4) ›
Add include_model_request_parameters instrumentation setting to omit the model_request_parameters span attribute by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6488
Add RaiseContentFilterError capability to raise content filter error for non-empty content filter responses by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6167
- feat(usage): add cache_hit_ratio property to RequestUsage and RunUsage by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6529
- Add get_model, resolve_model_id, and for_agent capability hooks by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6333
Fixes (4) ›
- Fix MistralModel streaming settings by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6563
- Close open message parts (text, thinking, tool calls) on UI stream error by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6550
Fix spurious OTel Failed to detach context error when a streamed run is interrupted mid-segment by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6572
- fix(temporal): pass through pydantic_monty in workflow sandbox by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6564
Maintenance (1) ›
- deps bump mcp to 1.28.1 for Dependabot alerts by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6562
https://github.com/pydantic/pydantic-ai/releases/tag/v2.13.0
Related releases
- Pydantic-AI v2.43.0 Enhances CLI Experience and Fixes OpenAI Chat Model Behavior Pydantic AI Releases ·
- ADK-Python v2.9.0 enhances agent resilience, voice integration, and workflow management Google ADK (Python) Releases ·
- CrewAI 1.15.21 Release Introduces Telemetry and Resolves Multiple Bugs CrewAI Releases ·
- OpenAI Python Agents SDK v0.22.2 Released OpenAI Agents SDK (Python) Releases ·
- Pydantic-AI v2.42.0 Enhances GitHub Copilot Integration and Fixes Bugs Pydantic AI Releases ·
- OpenAI Agents Python SDK v0.22.1 enhances tools, guardrails, and voice features OpenAI Agents SDK (Python) Releases ·