pub enum AgentEvent {
ToolCall {
call_id: String,
name: String,
arguments: String,
},
ToolResult {
call_id: String,
name: String,
output: String,
is_error: bool,
},
Delta(String),
ReasoningDelta(String),
ToolCallDelta {
index: u64,
json: String,
},
Message(String),
ContextTrimmed {
turns: usize,
messages: usize,
memory: MemoryStatus,
judgement: JudgementStatus,
},
SchemaRejected {
error: String,
retrying: bool,
},
TurnStats {
usage: TurnUsage,
context_tokens: usize,
budget_tokens: usize,
},
}Expand description
Progress notifications emitted while a prompt is being processed.
Variants§
ToolCall
Fields
ToolResult
Delta(String)
A piece of assistant text, as generated. Only sent by streaming providers; may be
followed by tool calls instead of a final Message.
ReasoningDelta(String)
A piece of reasoning/thinking text, as generated.
ToolCallDelta
A fragment of a tool call’s JSON arguments, as generated.
Message(String)
Complete assistant text for this turn (always sent, streamed or not).
ContextTrimmed
Older turns were left out of the request to respect
provider.context_budget_tokens. Sent when the amount changes, not on every call.
memory reports what happened to the session’s stored memory and judgement what the
bounded judgement pass did when the config asked for one — the two things that decide
whether the system prompt carries something model-written or only the plain trim note.
Fields
memory: MemoryStatusWhat happened with the session’s stored memory (<id>.memory.json).
judgement: JudgementStatusWhat the bounded judgement pass did, when the config asked for it.
SchemaRejected
What one provider request cost, sent once per request (so a turn with tool calls
reports each request, which is what the numbers are actually about).
A reply that was not the shape the caller asked for. Sent before the single retry
(retrying: true) and again if the retry missed too (false), so the readout shows a
schema being argued with rather than a run that mysteriously took two turns.
TurnStats
Fields
context_tokens: usizeEstimated size of the prompt that was assembled: the conversation, the system
prompt and any trim note. Compare with Self::TurnStats::budget_tokens.
budget_tokens: usizeThe rail this request was planned against: an explicit
provider.context_budget_tokens, else [context] compact_at of the model’s window,
else 0 when no window is known and no rail is in force. It is the number
Agent::context_budget returns, so a front end that shows it shows what was used.
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§impl Debug for AgentEvent
impl Debug for AgentEvent
impl Eq for AgentEvent
Source§impl PartialEq for AgentEvent
impl PartialEq for AgentEvent
impl StructuralPartialEq for AgentEvent
Auto Trait Implementations§
impl Forget for AgentEvent
impl Freeze for AgentEvent
impl Move for AgentEvent
impl RefUnwindSafe for AgentEvent
impl Send for AgentEventwhere
RawVecInner: Send,
impl Sync for AgentEventwhere
RawVecInner: Sync,
impl Unpin for AgentEvent
impl UnsafeUnpin for AgentEvent
impl UnwindSafe for AgentEventwhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.