Skip to content

RealtimeSessionEventTypes

type RealtimeSessionEventTypes<TContext> = object;
Type Parameter Default type

TContext

unknown

agent_end: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, string];

Triggered when an agent ends its work on a response.


agent_handoff: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, AgentWithOrWithoutHistory<TContext>];

Triggered when an agent hands off to another agent.


agent_start: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>];

Triggered when an agent starts its work on a response.


agent_tool_end: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, FunctionTool<RealtimeContextData<TContext>>, string];

Triggered when an agent ends a tool call.


agent_tool_start: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, FunctionTool<RealtimeContextData<TContext>>];

Triggered when an agent starts a tool call.


audio: [TransportLayerAudio];

Triggered when there is new audio data available for playing to the user.


audio_interrupted: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>];

Triggered when the agent is interrupted. Can be listened to by the user to stop audio playback or give visual indicators to the user.


audio_start: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>];

Triggered when the agent starts generating audio.


audio_stopped: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>];

Triggered when the agent stops generating audio.


error: [RealtimeSessionError];

Triggered when an error occurs.


guardrail_tripped: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, OutputGuardrailTripwireTriggered<RealtimeGuardrailMetadata>];

Triggered when an output guardrail is tripped.


history_added: [RealtimeItem];

Triggered when a new item is added to the history. At this point the transcript/response might still be in progress.


history_updated: [RealtimeItem[]];

Triggered when the history got updated. Contains the full history of the conversation.


tool_approval_requested: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, RealtimeToolApprovalRequest];

Triggered when a tool approval is requested.


transport_event: [TransportEvent];

Emits all the raw events from the transport layer.