pypi pydantic-ai 2.50.0
v2.50.0 (2026-09-24)

3 hours ago

What's Changed

⚠️ Compatibility Notes

  • Ask a DecisionModel which route to take by name, with one label per route by @DouweM in #8733
  • Make ModelSelectionContext.messages end with the request being routed, and add ModelSelectionContext.prompt by @DouweM in #8737
  • Replace the decision model's tool-call lean with an opt-in decision_route_threshold by @DouweM in #8739

🚀 Features

  • Expose OpenAI service_tier in provider details by @pydanty in #7945
  • Add DecisionModel, a base for Decisions-protocol models, and make TypeSafeModel one by @DouweM in #8696
  • Add RunContext.in_durable_context so hooks can tell they run in durable workflow code by @mpfaffenberger in #8723
  • Add gemini-3.8-live and gemini-3.8-live-extended-thinking realtime support by @DouweM in #8393
  • Ask a DecisionModel's route fields with the route question under a route premise, with nested-field context and a done state after tool calls by @DouweM in #8749
  • Emit a decide span for every request a DecisionModel sends by @DouweM in #8698

🐛 Bug Fixes

  • Keep the type variable of a generic OutputSpec[T] passed to Agent.run under mypy by @DouweM in #8730
  • Send ThinkingParts in the history decision models judge by @DouweM in #8738
  • Price Anthropic one-hour cache writes at the one-hour rate instead of the five-minute rate by @kazmer97 in #8666
  • Price realtime image input at the image rate by @DouweM in #8741
  • Add RequestUsage.audio_seconds so duration-billed voice models are priced by @DouweM in #8427
  • Offer a decision model's unfillable output_type as a route beside other routes, and rename ToolCallProposed to UnfillableRoute under a DecisionHandOff base by @DouweM in #8744
  • Keep realtime user turns whole when the microphone streams continuously on providers without input item IDs by @DouweM in #8746
  • Roll back a realtime send the provider refuses, so wait_for_reply() no longer hangs on it by @DouweM in #8747
  • Turn reasoning off for thinking=False on OpenAI Realtime by sending reasoning.effort: 'none' by @DouweM in #8753
  • Take Jev's context_window from genai-prices and document compacting a Jev conversation by @DouweM in #8740
  • Buffer five minutes of audio per stream_audio() view so speaker-paced playback gets whole replies by @DouweM in #8750
  • Stop Google Search from crashing Gemini 2.5 native-audio realtime sessions by @DouweM in #8751
  • Keep user speech out of Gemini 3.x realtime history when input transcription is off by @DouweM in #8754
  • Surface a failed OpenAI realtime response's error as a RealtimeSessionErrorEvent by @DouweM in #8752

Full Changelog: v2.49.0...v2.50.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.