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: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>, output: string];Triggered when an agent ends its work on a response.
agent_handoff
Section titled “agent_handoff”agent_handoff: [context: RunContext<RealtimeContextData<TContext>>, fromAgent: AgentWithOrWithoutHistory<TContext>, toAgent: AgentWithOrWithoutHistory<TContext>];Triggered when an agent hands off to another agent.
agent_start
Section titled “agent_start”agent_start: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>, turnInput?: AgentInputItem[]];Triggered when an agent starts its work on a response.
agent_tool_end
Section titled “agent_tool_end”agent_tool_end: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>, tool: FunctionTool<RealtimeContextData<TContext>>, result: string, details: object];Triggered when an agent ends a tool call.
agent_tool_start
Section titled “agent_tool_start”agent_tool_start: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>, tool: FunctionTool<RealtimeContextData<TContext>>, details: object];Triggered when an agent starts a tool call.
audio: [event: TransportLayerAudio];Triggered when there is new audio data available for playing to the user.
audio_interrupted
Section titled “audio_interrupted”audio_interrupted: [context: RunContext<RealtimeContextData<TContext>>, agent: 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: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>];Triggered when the agent starts generating audio.
audio_stopped
Section titled “audio_stopped”audio_stopped: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>];Triggered when the agent stops generating audio.
error: [error: RealtimeSessionError];Triggered when an error occurs.
guardrail_tripped
Section titled “guardrail_tripped”guardrail_tripped: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>, error: OutputGuardrailTripwireTriggered<RealtimeGuardrailMetadata>, details: object];Triggered when an output guardrail is tripped.
history_added
Section titled “history_added”history_added: [item: 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: [history: RealtimeItem[]];Triggered when the history got updated. Contains the full history of the conversation.
mcp_tool_call_completed
Section titled “mcp_tool_call_completed”mcp_tool_call_completed: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>, toolCall: RealtimeMcpCallItem];Triggered when an MCP tool call is completed.
mcp_tools_changed
Section titled “mcp_tools_changed”mcp_tools_changed: [tools: RealtimeMcpToolInfo[]];Triggered when the set of currently available MCP tools changes (e.g. after a list-tools result arrives, or when the active agent changes). Carries the list of available tools filtered by the active agent’s server_labels.
tool_approval_requested
Section titled “tool_approval_requested”tool_approval_requested: [context: RunContext<RealtimeContextData<TContext>>, agent: AgentWithOrWithoutHistory<TContext>, approvalRequest: RealtimeToolApprovalRequest | RealtimeMcpApprovalRequest];Triggered when a tool approval is requested.
transport_event
Section titled “transport_event”transport_event: [event: TransportEvent];Emits all the raw events from the transport layer.