Skip to main content

Module realtime

Module realtime 

Source
Expand description

Realtime (WebSocket) sessions.

A RealtimeSession connects to a provider’s realtime endpoint through the provider’s RealtimeModel: the model issues the client secret, describes the WebSocket handshake and translates between wire messages and the standardized RealtimeClientEvent / RealtimeServerEvent sets. The session owns the connection, forwards server events as a stream, and executes local function tools when the model calls them.

Design: docs/01-architecture/11-other-modalities.md §9.

Structs§

ClientSecret
A client secret for opening a session.
RealtimeHandle
Sends events into a realtime session and closes it.
RealtimeSession
An open realtime session.
RealtimeSessionBuilder
Configuration of a realtime session before it connects.
RealtimeSessionConfig
Session configuration.
RealtimeToolDefinition
A function tool exposed in a realtime session.
ResponseCreateOptions
Options of a response-create event.
TranscriptionConfig
Transcription settings for input or output audio.
TurnDetection
Turn detection settings.

Enums§

ConversationItem
A conversation item created by the client, tagged by type.
ConversationRole
Role of a conversation item created by the client.
Modality
Output modality.
RealtimeClientEvent
Events sent by the client, tagged by type.
RealtimeServerEvent
Events received from the server, tagged by type.
TurnDetectionKind
Turn detection mode.

Functions§

realtime_session
Starts building a realtime session with model.
realtime_tool_definitions
Converts a tool set into realtime tool definitions.

Type Aliases§

RealtimeEvent
Items of the event stream: standardized server events, or local failures (transport errors, unparsable messages, tool execution errors).