Pydantic-AI v2.17.0: Cache OTel serialization, support arbitrary fields
This release of Pydantic-AI introduces support for arbitrary fields in `RequestUsage` and `RunUsage` to accommodate upcoming genai-prices. It also caches OpenTelemetry serialization per message, significantly reducing instrumentation costs from quadratic to linear. These changes benefit developers working with generative AI models, offering enhanced flexibility and improved performance.
- →Cache per-message OTel serialization to avoid O(n²) instrumentation cost by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6635
Features (2) ›
Make RequestUsage and RunUsage support arbitrary fields for upcoming genai-prices by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6683
- Cache per-message OTel serialization to avoid O(n²) instrumentation cost by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6635
Fixes (1) ›
Fix ContentFilterError for real Model Armor response blocks (finishReason: MODEL_ARMOR) and record moderation wire-truth cassettes by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/6679
https://github.com/pydantic/pydantic-ai/releases/tag/v2.17.0
Related releases
- Pydantic-AI v2.19.0 adds headers and retry_after to ModelHTTPError Pydantic AI Releases ·
- OpenAI Agents Python: Programmatic Tool Calling and SDK Enhancements OpenAI Agents SDK (Python) Releases ·
- crewAI 1.15.7: Security patches and observability improvements CrewAI Releases ·
- pydantic-ai v2.18.0 adds Anthropic/OpenRouter tool support, web access Pydantic AI Releases ·
- crewAI 1.15.6: Bug fixes and documentation updates CrewAI Releases ·
- pydantic-ai v2.16.0 adds Model Armor and new Gemini models Pydantic AI Releases ·