Daily News · 1 min read

Pydantic AI Updates: September 5, 2026

1. Pydantic AI v2.40.0 Adds Barge-In Handling and Agent Event Listeners

Pydantic AI. The release is largely a realtime and voice pass. Sessions can now handle barge-in through handle_barge_in=True, interrupt(played_bytes=...), and played_audio_bytes, so a user talking over the model cuts the response cleanly. RealtimeSession.send() gains respond=, with documentation clarifying that a text turn solicits a reply, and RealtimeSession.enqueue() lets code driving a session inject out-of-band prompts. A realtime tool can now hang up with ctx.realtime_session.close() instead of wedging itself, and infer_realtime_model accepts a provider_factory. Outside realtime, @agent.on_event registers event listeners on an Agent, and pydantic_ai.prices.update_in_background() refreshes model pricing without blocking. Fixes cover finish_reason mapping on OpenAI Responses stream terminal events and a defer_loading bug that split a parallel batch’s tool_result from its tool_use. Source