python Pydantic AI Releases · · 2.17.0

Pydantic-AI v2.17.0: Cache OTel serialization, support arbitrary fields

sdkaiengineerpython-agentic
feature patch

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

Read the original announcement →

https://github.com/pydantic/pydantic-ai/releases/tag/v2.17.0

Related releases