pypi pydantic-ai 2.51.0
v2.51.0 (2026-09-25)

3 hours ago

What's Changed

⚠️ Compatibility Notes

  • Match dated gemini-3.8-live ids, reject google_affective_dialog on Gemini 3.1 Flash Live and 3.8 Live at connect, and raise RealtimeError for Gemini Live close codes by @DouweM in #8761
  • Raise a UserError for a realtime tool_choice that forces a tool call on OpenAI, Azure OpenAI, and xAI by @DouweM in #8755

🚀 Features

  • Add OpenAI GPT-Live support with OpenAILiveModel by @DouweM in #8390
  • Expose context_window_used on realtime sessions, from GPT-Live's reported ratio or response usage by @DouweM in #8803

🐛 Bug Fixes

  • Reduce RunContext copying overhead in capability hooks by @Kludex in #8775
  • Keep provider_details on OpenAI Realtime tool-call responses and the response id on replies cut off by a drop or close() by @DouweM in #8762
  • Buffer text deltas in CompletedStreamedResponse replay by @Kludex in #8799
  • Resend a recent image with a typed Gemini Live turn, which doesn't see video frames by @DouweM in #8756
  • Cache the agent graph instead of rebuilding it on every Agent.run() by @Kludex in #8658
  • Stop spawning a task group when a toolset or capability fan-out has a single child by @Kludex in #8774

Full Changelog: v2.50.0...v2.51.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.