#[non_exhaustive]pub enum AgentEvent {
Ready {
session_id: String,
model: Option<String>,
},
TextChunk {
msg_id: String,
text: String,
channel: TextChannel,
},
Thought {
msg_id: String,
text: String,
},
ToolCallStart {
call_id: String,
name: String,
input: Value,
},
ToolCallEnd {
call_id: String,
output: String,
is_error: bool,
},
Plan {
entries: Vec<PlanEntry>,
},
AskUser {
ask_id: String,
prompt: String,
kind: AskKind,
options: Vec<AskOption>,
},
PermissionRequest {
req_id: String,
tool: String,
intent: Value,
scope: PermissionScope,
},
Done {
stop_reason: StopReason,
usage: Usage,
},
Error {
code: String,
message: String,
},
}Expand description
A streaming event from the agent. Subset of spec §7.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ready
Session has been initialized and is ready to accept prompts.
TextChunk
Streaming text chunk from the assistant.
Thought
Agent’s internal reasoning (when exposed by the model).
ToolCallStart
Agent started a tool call.
ToolCallEnd
Agent’s tool call returned a result.
Plan
Agent published an updated plan (full state, replaces previous).
AskUser
Agent asks the user a structured question.
PermissionRequest
Agent requests permission for a security-sensitive action.
Done
Turn complete. Usage stats included.
Error
Non-fatal error during the turn.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AgentEvent
impl RefUnwindSafe for AgentEvent
impl Send for AgentEvent
impl Sync for AgentEvent
impl Unpin for AgentEvent
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.