pub enum ReActEvent {
RunStarted {
run_id: String,
input: UserInput,
},
Delta {
text: String,
},
Reasoning {
text: String,
},
ToolStarted {
id: String,
name: String,
arguments: String,
},
ToolCompleted {
id: String,
name: String,
result: Result<ToolResult, RegistryError>,
},
RunEnded {
summary: RunSummary,
error: Option<AgentError>,
},
}Expand description
A single event from ReActAgent (application level; the event name is
provided per variant via AgentEvent::name).
Variants§
RunStarted
The run has started (the user input is already recorded). Marks the start of a run segment in a long-lived channel.
Fields
Delta
An increment of the model’s reply text (same content as
MessageChunk::Delta — pushed to
pipeline-only subscribers so they need not pull the stream).
Reasoning
An increment of the model’s reasoning. Note that
MessageChunk has no Reasoning variant
(see its docs); pipeline events are each Agent’s own choice, and ReAct
chooses to push reasoning.
ToolStarted
A tool has started executing (the loop received the model’s tool call request and is about to execute it).
Fields
id: StringThe original id of this call, paired with
ToolCompleted.
ToolCompleted
A tool has finished dispatching; result is the return value of
ToolRegistry::call — Ok(Output)
is immediate output, Ok(Effect) is a side-effect request, Err is a
registry/tool failure (Display is the error text fed back to the
model).
Fields
id: StringThe original id of this call, paired with
ToolStarted.
result: Result<ToolResult, RegistryError>The dispatch result (Ok/Err status is classified by the registry,
see RegistryError).
RunEnded
The run has ended (published on success, cancellation, and error) — the end of a run segment in a long-lived channel, carrying the execution summary for this run (also accumulated on the non-streaming path).
Fields
summary: RunSummaryExecution summary for this run (same semantics as the streaming
Done chunk).
error: Option<AgentError>None = normal end; Some = cancelled / errored (cancellation is
AgentError::Cancelled).