class ActionEvent
Bases:LLMConvertibleEvent
Properties
action: Action | Nonekind: Literal[âActionEventâ]llm_response_id: strmodel_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].reasoning_content: str | Noneresponses_reasoning_item: ReasoningItemModel | Nonesecurity_risk: SecurityRisksource: Literal[âagentâ, âuserâ, âenvironmentâ]thinking_blocks: list[ThinkingBlock | RedactedThinkingBlock]thought: Sequence[TextContent]tool_call: MessageToolCalltool_call_id: strtool_name: strvisualize: Text Return Rich Text representation of this action event.
Methods
to_llm_message()
Individual message - may be incomplete for multi-action batchesclass AgentErrorEvent
Bases:ObservationBaseEvent
Error triggered by the agent.
Note: This event should not contain model âthoughtâ or âreasoning_contentâ. It
represents an error produced by the agent/scaffold, not model output.
Properties
error: strkind: Literal[âAgentErrorEventâ]model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]visualize: Text Return Rich Text representation of this agent error event.
Methods
to_llm_message()
class Condensation
Bases:Event
This action indicates a condensation of the conversation history is happening.
Properties
forgotten_event_ids: list[str]kind: Literal[âCondensationâ]llm_response_id: strmodel_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]summary: str | Nonesummary_offset: int | Nonevisualize: Text Return Rich Text representation of this event. This is a fallback implementation for unknown event types. Subclasses should override this method to provide specific visualization.
class CondensationRequest
Bases:Event
This action is used to request a condensation of the conversation history.
Properties
kind: Literal[âCondensationRequestâ]model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]
Methods
action
The action type, namely ActionType.CONDENSATION_REQUEST.- Type: str
class CondensationSummaryEvent
Bases:LLMConvertibleEvent
This event represents a summary generated by a condenser.
Properties
kind: Literal[âCondensationSummaryEventâ]model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]summary: str The summary text.
Methods
to_llm_message()
class ConversationStateUpdateEvent
Bases:Event
Event that contains conversation state updates.
This event is sent via websocket whenever the conversation state changes,
allowing remote clients to stay in sync without making REST API calls.
All fields are serialized versions of the corresponding ConversationState fields
to ensure compatibility with websocket transmission.
Properties
key: strkind: Literal[âConversationStateUpdateEventâ]model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]value: Any
Methods
classmethod from_conversation_state()
Create a state update event from a ConversationState object. This creates an event containing a snapshot of important state fields.- Parameters:
stateâ The ConversationState to serializeconversation_idâ The conversation ID for the event
- Returns: A ConversationStateUpdateEvent with serialized state data
classmethod validate_key()
classmethod validate_value()
class Event
Bases:DiscriminatedUnionMixin, ABC
Base class for all events.
Properties
id: strkind: strmodel_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]timestamp: strvisualize: Text Return Rich Text representation of this event. This is a fallback implementation for unknown event types. Subclasses should override this method to provide specific visualization.
class LLMConvertibleEvent
Bases:Event, ABC
Base class for events that can be converted to LLM messages.
Properties
id: EventIDkind: strmodel_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: SourceTypetimestamp: str
Methods
static events_to_messages()
Convert event stream to LLM message stream, handling multi-action batchesabstractmethod to_llm_message()
class MessageEvent
Bases:LLMConvertibleEvent
Message from either agent or user.
This is originally the âMessageActionâ, but it suppose not to be tool call.
Properties
activated_skills: list[str]extended_content: list[TextContent]id: EventIDkind: Literal[âMessageEventâ]llm_message: Messagellm_response_id: str | Nonemodel_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].reasoning_content: strsource: Literal[âagentâ, âuserâ, âenvironmentâ]thinking_blocks: Sequence[ThinkingBlock | RedactedThinkingBlock] Return the Anthropic thinking blocks from the LLM message.timestamp: strvisualize: Text Return Rich Text representation of this message event.
Methods
to_llm_message()
class ObservationBaseEvent
Bases:LLMConvertibleEvent
Base class for anything as a response to a tool call.
Examples include tool execution, error, user reject.
Properties
model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]tool_call_id: strtool_name: str
class ObservationEvent
Bases:ObservationBaseEvent
Properties
action_id: strkind: Literal[âObservationEventâ]model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].observation: Observationvisualize: Text Return Rich Text representation of this observation event.
Methods
to_llm_message()
class PauseEvent
Bases:Event
Event indicating that the agent execution was paused by user request.
Properties
kind: Literal[âPauseEventâ]model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]visualize: Text Return Rich Text representation of this pause event.
class SystemPromptEvent
Bases:LLMConvertibleEvent
System prompt added by the agent.
Properties
kind: Literal[âSystemPromptEventâ]model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].source: Literal[âagentâ, âuserâ, âenvironmentâ]system_prompt: TextContenttools: list[ChatCompletionToolParam]visualize: Text Return Rich Text representation of this system prompt event.
Methods
to_llm_message()
class UserRejectObservation
Bases:ObservationBaseEvent
Observation when user rejects an action in confirmation mode.
Properties
action_id: strkind: Literal[âUserRejectObservationâ]model_config: ClassVar[ConfigDict] = (configuration object) Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].rejection_reason: strvisualize: Text Return Rich Text representation of this user rejection event.

