RealtimeSessionEventTypes
type RealtimeSessionEventTypes<TContext> = object;
Type Parameters
Section titled “Type Parameters”Type Parameter | Default type |
---|---|
|
|
Properties
Section titled “Properties”agent_end
Section titled “agent_end”agent_end: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, string];
Triggered when an agent ends its work on a response.
agent_handoff
Section titled “agent_handoff”agent_handoff: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, AgentWithOrWithoutHistory<TContext>];
Triggered when an agent hands off to another agent.
agent_start
Section titled “agent_start”agent_start: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>];
Triggered when an agent starts its work on a response.
agent_tool_end
Section titled “agent_tool_end”agent_tool_end: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, FunctionTool<RealtimeContextData<TContext>>, string];
Triggered when an agent ends a tool call.
agent_tool_start
Section titled “agent_tool_start”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
Section titled “audio_interrupted”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
Section titled “audio_start”audio_start: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>];
Triggered when the agent starts generating audio.
audio_stopped
Section titled “audio_stopped”audio_stopped: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>];
Triggered when the agent stops generating audio.
error: [RealtimeSessionError];
Triggered when an error occurs.
guardrail_tripped
Section titled “guardrail_tripped”guardrail_tripped: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, OutputGuardrailTripwireTriggered<RealtimeGuardrailMetadata>];
Triggered when an output guardrail is tripped.
history_added
Section titled “history_added”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
Section titled “history_updated”history_updated: [RealtimeItem[]];
Triggered when the history got updated. Contains the full history of the conversation.
tool_approval_requested
Section titled “tool_approval_requested”tool_approval_requested: [RunContext<RealtimeContextData<TContext>>, AgentWithOrWithoutHistory<TContext>, RealtimeToolApprovalRequest];
Triggered when a tool approval is requested.
transport_event
Section titled “transport_event”transport_event: [TransportEvent];
Emits all the raw events from the transport layer.