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
https://github.com/pydantic/pydantic-ai/releases/tag/v2.13.0
Related releases
- crewAI 1.15.10 Patch Release CrewAI Releases ·
- LangGraph checkpoint-postgres 3.1.1 update LangGraph Releases ·
- LangGraph checkpoint-sqlite 3.1.1 released LangGraph Releases ·
- adk-python adds async non-blocking tool support Google ADK (Python) Releases ·
- Google ADK Python v2.6.0 adds features, fixes Google ADK (Python) Releases ·
- crewAI 1.15.9: Improved Tool Failure Reporting and Flow Events CrewAI Releases ·