pub enum Event<StateT: AgentState = JsonValue> {
Show 24 variants
TextMessageStart(TextMessageStartEvent),
TextMessageContent(TextMessageContentEvent),
TextMessageEnd(TextMessageEndEvent),
TextMessageChunk(TextMessageChunkEvent),
ThinkingTextMessageStart(ThinkingTextMessageStartEvent),
ThinkingTextMessageContent(ThinkingTextMessageContentEvent),
ThinkingTextMessageEnd(ThinkingTextMessageEndEvent),
ToolCallStart(ToolCallStartEvent),
ToolCallArgs(ToolCallArgsEvent),
ToolCallEnd(ToolCallEndEvent),
ToolCallChunk(ToolCallChunkEvent),
ToolCallResult(ToolCallResultEvent),
ThinkingStart(ThinkingStartEvent),
ThinkingEnd(ThinkingEndEvent),
StateSnapshot(StateSnapshotEvent<StateT>),
StateDelta(StateDeltaEvent),
MessagesSnapshot(MessagesSnapshotEvent),
Raw(RawEvent),
Custom(CustomEvent),
RunStarted(RunStartedEvent),
RunFinished(RunFinishedEvent),
RunError(RunErrorEvent),
StepStarted(StepStartedEvent),
StepFinished(StepFinishedEvent),
}Expand description
Union of all possible events in the Agent User Interaction Protocol. This enum represents the full set of events that can be exchanged between the agent and the client.
Variants§
TextMessageStart(TextMessageStartEvent)
Signals the start of a text message from an agent. Contains the message ID and role information.
TextMessageContent(TextMessageContentEvent)
Represents a chunk of content being added to an in-progress text message. Contains the message ID and the text delta to append.
TextMessageEnd(TextMessageEndEvent)
Signals the completion of a text message. Contains the message ID of the completed message.
TextMessageChunk(TextMessageChunkEvent)
Represents a complete or partial message chunk in a single event. May contain optional message ID, role, and delta information.
ThinkingTextMessageStart(ThinkingTextMessageStartEvent)
Signals the start of a thinking text message. Used for internal agent thought processes that should be displayed to the user.
ThinkingTextMessageContent(ThinkingTextMessageContentEvent)
Represents content being added to an in-progress thinking text message. Contains the delta text to append.
ThinkingTextMessageEnd(ThinkingTextMessageEndEvent)
Signals the completion of a thinking text message.
ToolCallStart(ToolCallStartEvent)
Signals the start of a tool call by the agent. Contains the tool call ID, name, and optional parent message ID.
ToolCallArgs(ToolCallArgsEvent)
Represents arguments being added to an in-progress tool call. Contains the tool call ID and argument data delta.
ToolCallEnd(ToolCallEndEvent)
Signals the completion of a tool call. Contains the tool call ID of the completed call.
ToolCallChunk(ToolCallChunkEvent)
Represents a complete or partial tool call in a single event. May contain optional tool call ID, name, parent message ID, and delta.
ToolCallResult(ToolCallResultEvent)
Represents the result of a completed tool call. Contains the message ID, tool call ID, content, and optional role.
ThinkingStart(ThinkingStartEvent)
Signals the start of a thinking process. Contains an optional title describing the thinking process.
ThinkingEnd(ThinkingEndEvent)
Signals the end of a thinking process.
StateSnapshot(StateSnapshotEvent<StateT>)
Provides a complete snapshot of the current state. Contains the full state as a JSON value.
StateDelta(StateDeltaEvent)
Provides incremental changes to the state. Contains a vector of delta operations to apply to the state.
MessagesSnapshot(MessagesSnapshotEvent)
Provides a complete snapshot of all messages. Contains a vector of all current messages.
Raw(RawEvent)
Wraps a raw event from an external source. Contains the original event as a JSON value and an optional source identifier.
Custom(CustomEvent)
Represents a custom event type not covered by the standard events. Contains a name identifying the custom event type and an associated value.
RunStarted(RunStartedEvent)
Signals the start of an agent run. Contains thread ID and run ID to identify the run.
RunFinished(RunFinishedEvent)
Signals the completion of an agent run. Contains thread ID, run ID, and optional result data.
RunError(RunErrorEvent)
Signals an error that occurred during an agent run. Contains error message and optional error code.
StepStarted(StepStartedEvent)
Signals the start of a step within an agent run. Contains the name of the step being started.
StepFinished(StepFinishedEvent)
Signals the completion of a step within an agent run. Contains the name of the completed step.