pub enum AgentEvent {
Show 19 variants
RunStart {
thread_id: String,
run_id: String,
parent_run_id: Option<String>,
},
RunFinish {
thread_id: String,
run_id: String,
result: Option<Value>,
termination: TerminationReason,
},
TextDelta {
delta: String,
},
ReasoningDelta {
delta: String,
},
ReasoningEncryptedValue {
encrypted_value: String,
},
ToolCallStart {
id: String,
name: String,
},
ToolCallDelta {
id: String,
args_delta: String,
},
ToolCallReady {
id: String,
name: String,
arguments: Value,
},
StepStart {
message_id: String,
},
InferenceComplete {
model: String,
usage: Option<TokenUsage>,
duration_ms: u64,
},
StateSnapshot {
snapshot: Value,
},
StateDelta {
delta: Vec<Value>,
},
MessagesSnapshot {
messages: Vec<Value>,
},
ActivitySnapshot {
message_id: String,
activity_type: String,
content: Value,
replace: Option<bool>,
},
ActivityDelta {
message_id: String,
activity_type: String,
patch: Vec<Value>,
},
ToolCallResumed {
target_id: String,
result: Value,
},
Error {
message: String,
code: Option<String>,
},
ToolCallDone {
id: String,
result: ToolResult,
patch: Option<TrackedPatch>,
message_id: String,
},
StepEnd,
}Expand description
Agent loop events for streaming execution.
Variants§
RunStart
Run started.
RunFinish
Run finished.
TextDelta
LLM text delta.
ReasoningDelta
LLM reasoning delta.
ReasoningEncryptedValue
Opaque reasoning signature/token delta from provider.
ToolCallStart
Tool call started.
ToolCallDelta
Tool call arguments delta.
ToolCallReady
Tool call input is complete.
StepStart
Step started.
InferenceComplete
LLM inference completed with token usage data.
StateSnapshot
State snapshot.
StateDelta
State delta.
MessagesSnapshot
Messages snapshot.
ActivitySnapshot
Activity snapshot.
ActivityDelta
Activity delta.
ToolCallResumed
Suspension resolution received.
Error
Error occurred.
ToolCallDone
Tool call completed.
StepEnd
Step completed.
Implementations§
Source§impl AgentEvent
impl AgentEvent
Sourcepub fn extract_response(result: &Option<Value>) -> String
pub fn extract_response(result: &Option<Value>) -> String
Extract the response text from a RunFinish result value.
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§fn clone(&self) -> AgentEvent
fn clone(&self) -> AgentEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentEvent
impl Debug for AgentEvent
Source§impl<'de> Deserialize<'de> for AgentEvent
impl<'de> Deserialize<'de> for AgentEvent
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentEvent
impl RefUnwindSafe for AgentEvent
impl Send for AgentEvent
impl Sync for AgentEvent
impl Unpin for AgentEvent
impl UnwindSafe for AgentEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more