Learning resourcesReviewed · Pydantic

Pydantic AI Realtime Events

Pydantic AI’s Events page is a guide for developers building real-time AI applications, but it covers event handling without complete application setup. It explains how to track conversation completion, handle changing transcripts and tool activity, and avoid replaying audio twice.

Researched 24 Nov 2026

In short.

Pydantic AI’s Events page is a guide for developers building real-time AI applications, but it covers session behavior without installation or connection setup. Its most useful details concern identifying completed exchanges, updating parts when transcripts arrive late, and understanding what an inactive event consumer loses. It also distinguishes convenient media streams from raw audio events and explains provider-dependent speech notifications. The page documents intended behavior; nothing was executed, and release compatibility, operating costs and production reliability remain unknown.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete Events page at [https://pydantic.dev/docs/ai/realtime/events/index.md], including its introductory documentation-index and agent-query notices. Those notices add no evidence about runtime behavior. Linked API references and pages about audio, providers, tools, history, capabilities and deployment are excluded. No code or sessions were executed; installation, integration, runtime behavior, performance, costs and release compatibility remain unverified.

The overview

identity

Events is a Pydantic AI documentation page about the event stream yielded by RealtimeSession. Its address is [https://pydantic.dev/docs/ai/realtime/events/index.md]. It provides an event reference and explanations of turn boundaries, delayed transcript updates, buffering and raw audio handling.

assessment

The page is useful when implementing conversation state: when an application should show a tool running, update a transcript or consider an exchange finished. Its strongest material addresses cases where a simple event handler could produce incorrect results, including transcripts arriving after a part ends and a model speaking again after a tool result.

It provides specific behavioral guidance, but no runnable application, measured performance results or evidence of deployment reliability.

users

Developers building voice interfaces, conversation displays, tool-status indicators or session logging can use this reference to decide which events to handle. These are practical applications of the documented event types.

Beginners will benefit from familiarity with asynchronous iteration and incremental content updates. Experienced developers will find details about session-wide part identifiers, bounded buffering, failure completion and provider-specific notifications.

capabilities

The reference covers content-part starts, incremental updates and endings; local tool execution and results; deferred tool requests and results; delivered queued messages; and custom or capability events. A tool result can represent a return value, failure or retry.

Session-specific events describe detected user speech, interrupted responses, failed input transcription, audible model speech, completed exchanges, restored connections and recoverable provider errors. The page explicitly says that input-transcription errors and recoverable provider errors leave the session usable.

Using it

requirements

Applying the guidance requires a RealtimeSession and application code that can consume its asynchronous event stream. The page names types from pydantic_ai.messages and pydantic_ai.realtime, but supplies no installation commands, Python version requirements, dependency constraints or credential setup.

Some events depend on the provider and connection. Input-speech notifications require a profile declaring emits_input_speech_events. Audible-output notifications are described for gpt-realtime or Azure OpenAI WebRTC sideband connections where the provider controls playback.

mechanism

Iterating RealtimeSession yields the underlying events used by stream_audio() and stream_transcripts(). Shared content and tool event types also appear in standard streamed agent runs, allowing those handlers to be reused as documented. Session-specific events add live-conversation state.

Each part has an index that identifies it throughout the session. A late transcript can cause an ended part to appear again under the same index; the new PartStartEvent replaces its previous finalized representation. Consumers should update stored parts by index instead of appending every PartEndEvent as a new item.

RealtimeTurnCompleteEvent marks an exchange boundary once no further reply is owed and no tool remains active. It also occurs for documented failures that prevent further replies, so completion alone does not establish success.

setup

The page begins with consuming an existing session. Its recommended arrangement is to iterate the session for control flow and use stream_audio() or stream_transcripts() for media. Application state should track parts by index and use RealtimeTurnCompleteEvent for exchange completion.

Session creation, provider authentication, model configuration and deployment are not explained here. The linked setup and API pages are outside the available evidence.

example

An illustrative assistant interaction could contain model speech, a local tool call, its result and another model reply before RealtimeTurnCompleteEvent arrives. A user interface that marks the exchange finished when the first speech segment or tool result ends would finish too early.

A tool exception also need not finish the exchange immediately: the page says the model receives the failure and can respond before completion. This is a conceptual example based on the documented semantics; no session was run.

Assessment & evidence

limitations

When nothing is iterating the session, it retains the most recent 512 part-delta events and 512 structural events for a late consumer. Older events are discarded. Discarding a part’s start also discards its remaining events, preventing unattached updates. A failure waiting for the consumer is retained. This buffer therefore cannot be treated as complete session history.

The page provides no latency measurements, throughput benchmarks, compatibility matrix or long-session reliability results. Those properties remain unverified.

reasoning

The practical value is in explaining why event arrival does not map neatly to finished conversation items. Tool activity can lead to further replies, transcripts can revise ended parts, and an exchange can complete after failure. These distinctions support more accurate interface and logging designs, although an implementation’s correctness would require separate verification.

alternatives

Within this API, stream_audio() is the recommended playback interface and provides a bounded view over speech deltas. Reading SpeechPartDelta.audio_chunk from raw PartDeltaEvent objects is an advanced alternative. When audio retention is enabled, the finalized SpeechPart contains the turn again as a WAV snapshot; playing both representations repeats the audio.

For transcript-focused handling, the page identifies stream_transcripts() as another derived view. It provides no comparison with competing libraries or services.

evidence

The evidence is the complete Events page at [https://pydantic.dev/docs/ai/realtime/events/index.md], captured on 2026-11-24 at 02:32:47.677 UTC. The supplied source revision is sha256:3b71d7160d1462d98905766c9654830e0684038ef7212b51b09d9e5d9dd84983.

This documentation supports claims about described API behavior. Nothing was executed, so it does not establish observed runtime behavior, successful integration or performance. Linked destinations were not assessed.

Access & freshness

costs

The page provides no pricing or measured usage, so provider charges and application operating costs are unknown. It discusses usage limits as a possible cause of exchange failure, but gives no billing rates, spending examples or cost calculations.

rights

The page contains no license text, attribution requirements or redistribution grant. Rights to reuse the documentation, software licensing obligations and provider service terms cannot be established from this page.

freshness

The capture timestamp identifies when the supplied document was acquired, not when its contents were last updated. The page specifies no publication date, update date or Pydantic AI release number.

Compatibility with a particular installed release and the continued accuracy of provider-specific behavior remain unknown. The named APIs and provider behavior should be checked against the versions used in an application.

actions

Before applying this guidance, confirm that the installed release exposes the documented event types and that the chosen provider supports the needed speech notifications. Decide whether the application needs media views, raw events or both.

Useful future checks include speech followed by tool use and another reply, late transcript replacement, interrupted responses, tool failures and delayed event consumption. For custom playback, verify that retained WAV history does not replay already streamed audio. These are suggested checks; none were performed.

Evidence for this report

selected-page.txtselected · checked 2026-11-24