python Pydantic AI Releases · · 2.23.0

Pydantic-AI v2.23.0: Bedrock, Gemini, Cost Tracking, and Bug Fixes

sdkaiawsengineermediapython-agentic
feature patch

Pydantic-AI version 2.23.0 introduces several new features, including Bedrock support for extra headers, stable Gateway aliases for Gemini models, and cost tracking capabilities. It also addresses multiple bug fixes related to Bedrock concurrency, Google Cloud credentials, and streaming response handling. This release is relevant for developers using Pydantic-AI for building AI applications across various providers.

  • Add Bedrock support for ModelSettings.extra_headers by @kkauy in https://github.com/pydantic/pydantic-ai/pull/4825
  • Add cost to RunUsage and cost_limit to UsageLimits by @Kludex in https://github.com/pydantic/pydantic-ai/pull/2684
  • Validate bedrock_max_concurrency instead of deadlocking on 0 by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6878
  • Fix GoogleCloudProvider credential scoping and ADC auth env-var leak by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6500
  • Preserve capability container subclasses during binding by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6677
Features (4)
  • Add Bedrock support for ModelSettings.extra_headers by @kkauy in https://github.com/pydantic/pydantic-ai/pull/4825
  • Restore stable gemini-3-pro-image and gemini-3.1-flash-image Gateway aliases by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/7069

  • Add cost to RunUsage and cost_limit to UsageLimits by @Kludex in https://github.com/pydantic/pydantic-ai/pull/2684
  • Add ToolAvailabilityDeltaPart with native tool_addition and additional_tools rendering by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6793

Fixes (8)
  • Validate bedrock_max_concurrency instead of deadlocking on 0 by @LHMQ878 in https://github.com/pydantic/pydantic-ai/pull/6878
  • Fix GoogleCloudProvider credential scoping and ADC auth env-var leak by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6500
  • Read provider created timestamp from any chunk in OpenAI streaming responses by @LKRCharon in https://github.com/pydantic/pydantic-ai/pull/5496

  • Preserve capability container subclasses during binding by @pydanty[bot] in https://github.com/pydantic/pydantic-ai/pull/6677
  • Drop the bound on the Temporal payload TypeAdapter cache by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7085
  • Preserve the host's Pydantic AI instrumentation in the Temporal LogfirePlugin by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7086

  • Fire capability event-stream and node hooks under agent.iter() by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6871
  • Close async streams on teardown instead of waiting for the garbage collector by @DouweM in https://github.com/pydantic/pydantic-ai/pull/7095
Read the original announcement →

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

Related releases