python Pydantic AI Releases · · 2.50.0

Pydantic-AI v2.50.0 Introduces DecisionModel and Gemini Realtime Support

sdkaigaengineerpython-agentic
breaking feature patch

Pydantic-AI v2.50.0 introduces the new `DecisionModel` base, designed to streamline AI model routing by name with labeled routes and enhanced context for improved decision-making workflows. This release also adds real-time support for `gemini-3.8-live` and `gemini-3.8-live-extended-thinking` models, expanding integration options and capabilities. Several compatibility notes are included, particularly affecting `DecisionModel` usage and `ModelSelectionContext` messages, which may require developer adjustments. The update also delivers numerous bug fixes, including corrected pricing for Anthropic and real-time image inputs, along with improvements for streaming audio and error handling.

  • →Expose OpenAI service_tier in provider details by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7945
  • →Add gemini-3.8-live and gemini-3.8-live-extended-thinking realtime support by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8393
  • →Emit a decide span for every request a DecisionModel sends by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8698
  • →Send ThinkingParts in the history decision models judge by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8738
  • →Price realtime image input at the image rate by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8741
Features (6) ›
  • Expose OpenAI service_tier in provider details by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7945
  • Add DecisionModel, a base for Decisions-protocol models, and make TypeSafeModel one by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8696

  • Add RunContext.in_durable_context so hooks can tell they run in durable workflow code by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/8723

  • Add gemini-3.8-live and gemini-3.8-live-extended-thinking realtime support by @DouweM in https://github.com/pydantic/pydantic-ai/pull/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 https://github.com/pydantic/pydantic-ai/pull/8749

  • Emit a decide span for every request a DecisionModel sends by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8698
Fixes (14) ›
  • Keep the type variable of a generic OutputSpec[T] passed to Agent.run under mypy by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8730

  • Send ThinkingParts in the history decision models judge by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8738
  • Price Anthropic one-hour cache writes at the one-hour rate instead of the five-minute rate by @kazmer97 in https://github.com/pydantic/pydantic-ai/pull/8666

  • Price realtime image input at the image rate by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8741
  • Add RequestUsage.audio_seconds so duration-billed voice models are priced by @DouweM in https://github.com/pydantic/pydantic-ai/pull/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 https://github.com/pydantic/pydantic-ai/pull/8744

  • Keep realtime user turns whole when the microphone streams continuously on providers without input item IDs by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8746

  • Roll back a realtime send the provider refuses, so wait_for_reply() no longer hangs on it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8747

  • Turn reasoning off for thinking=False on OpenAI Realtime by sending reasoning.effort: 'none' by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8753

  • Take Jev's context_window from genai-prices and document compacting a Jev conversation by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8740

  • Buffer five minutes of audio per stream_audio() view so speaker-paced playback gets whole replies by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8750

  • Stop Google Search from crashing Gemini 2.5 native-audio realtime sessions by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8751
  • Keep user speech out of Gemini 3.x realtime history when input transcription is off by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8754

  • Surface a failed OpenAI realtime response's error as a RealtimeSessionErrorEvent by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8752

Read the original announcement →

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

Related releases