Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Realtime Events

Session Events

An event emitted by the realtime session.

Event Types

Agent Events

A new agent has started.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeAgentStartEvent:"""A new agent has started."""agent:RealtimeAgent"""The new agent."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["agent_start"]="agent_start"

agentinstance-attribute

The new agent.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

An agent has ended.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeAgentEndEvent:"""An agent has ended."""agent:RealtimeAgent"""The agent that ended."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["agent_end"]="agent_end"

agentinstance-attribute

The agent that ended.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

Audio Events

Triggered when the agent generates new audio to be played.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeAudio:"""Triggered when the agent generates new audio to be played."""audio:RealtimeModelAudioEvent"""The audio event from the model layer."""item_id:str"""The ID of the item containing audio."""content_index:int"""The index of the audio content in `item.content`"""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["audio"]="audio"

audioinstance-attribute

The audio event from the model layer.

item_idinstance-attribute

item_id:str

The ID of the item containing audio.

content_indexinstance-attribute

content_index:int

The index of the audio content initem.content

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

Triggered when the agent stops generating audio.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeAudioEnd:"""Triggered when the agent stops generating audio."""info:RealtimeEventInfo"""Common info for all events, such as the context."""item_id:str"""The ID of the item containing audio."""content_index:int"""The index of the audio content in `item.content`"""type:Literal["audio_end"]="audio_end"

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

item_idinstance-attribute

item_id:str

The ID of the item containing audio.

content_indexinstance-attribute

content_index:int

The index of the audio content initem.content

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

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeAudioInterrupted:"""Triggered when the agent is interrupted. Can be listened to by the user to stop audio    playback or give visual indicators to the user.    """info:RealtimeEventInfo"""Common info for all events, such as the context."""item_id:str"""The ID of the item containing audio."""content_index:int"""The index of the audio content in `item.content`"""type:Literal["audio_interrupted"]="audio_interrupted"

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

item_idinstance-attribute

item_id:str

The ID of the item containing audio.

content_indexinstance-attribute

content_index:int

The index of the audio content initem.content

Tool Events

An agent is starting a tool call.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeToolStart:"""An agent is starting a tool call."""agent:RealtimeAgent"""The agent that updated."""tool:Tool"""The tool being called."""arguments:str"""The arguments passed to the tool as a JSON string."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["tool_start"]="tool_start"

agentinstance-attribute

The agent that updated.

toolinstance-attribute

tool:Tool

The tool being called.

argumentsinstance-attribute

arguments:str

The arguments passed to the tool as a JSON string.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

An agent has ended a tool call.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeToolEnd:"""An agent has ended a tool call."""agent:RealtimeAgent"""The agent that ended the tool call."""tool:Tool"""The tool that was called."""arguments:str"""The arguments passed to the tool as a JSON string."""output:Any"""The output of the tool call."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["tool_end"]="tool_end"

agentinstance-attribute

The agent that ended the tool call.

toolinstance-attribute

tool:Tool

The tool that was called.

argumentsinstance-attribute

arguments:str

The arguments passed to the tool as a JSON string.

outputinstance-attribute

output:Any

The output of the tool call.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

Handoff Events

An agent has handed off to another agent.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeHandoffEvent:"""An agent has handed off to another agent."""from_agent:RealtimeAgent"""The agent that handed off."""to_agent:RealtimeAgent"""The agent that was handed off to."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["handoff"]="handoff"

from_agentinstance-attribute

from_agent:RealtimeAgent

The agent that handed off.

to_agentinstance-attribute

to_agent:RealtimeAgent

The agent that was handed off to.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

Guardrail Events

A guardrail has been tripped and the agent has been interrupted.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeGuardrailTripped:"""A guardrail has been tripped and the agent has been interrupted."""guardrail_results:list[OutputGuardrailResult]"""The results from all triggered guardrails."""message:str"""The message that was being generated when the guardrail was triggered."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["guardrail_tripped"]="guardrail_tripped"

guardrail_resultsinstance-attribute

guardrail_results:list[OutputGuardrailResult]

The results from all triggered guardrails.

messageinstance-attribute

message:str

The message that was being generated when the guardrail was triggered.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

History Events

A new item has been added to the history.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeHistoryAdded:"""A new item has been added to the history."""item:RealtimeItem"""The new item that was added to the history."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["history_added"]="history_added"

iteminstance-attribute

The new item that was added to the history.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

The history has been updated. Contains the full history of the session.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeHistoryUpdated:"""The history has been updated. Contains the full history of the session."""history:list[RealtimeItem]"""The full history of the session."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["history_updated"]="history_updated"

historyinstance-attribute

history:list[RealtimeItem]

The full history of the session.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

Error Events

An error has occurred.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeError:"""An error has occurred."""error:Any"""The error that occurred."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["error"]="error"

errorinstance-attribute

error:Any

The error that occurred.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.

Raw Model Events

Forwards raw events from the model layer.

Source code insrc/agents/realtime/events.py
@dataclassclassRealtimeRawModelEvent:"""Forwards raw events from the model layer."""data:RealtimeModelEvent"""The raw data from the model layer."""info:RealtimeEventInfo"""Common info for all events, such as the context."""type:Literal["raw_model_event"]="raw_model_event"

datainstance-attribute

data:RealtimeModelEvent

The raw data from the model layer.

infoinstance-attribute

info:RealtimeEventInfo

Common info for all events, such as the context.


[8]ページ先頭

©2009-2025 Movatter.jp