#[non_exhaustive]pub enum AgentEvent {
Show 15 variants
TextDelta {
content: String,
},
ToolCallStart {
id: String,
name: String,
},
ToolCallDelta {
id: String,
arguments_delta: String,
},
ToolCallEnd {
id: String,
},
ToolResult {
id: String,
output: ToolOutput,
},
ToolProgress {
id: String,
message: String,
progress_pct: Option<f32>,
},
StateUpdate {
patch: Value,
},
DirectiveEmitted {
directive: Value,
},
StatusUpdate {
status: String,
progress_pct: Option<f32>,
},
UsageUpdate {
usage: Usage,
},
RateLimitInfo {
utilization_pct: f32,
reset_at: i64,
allowed: bool,
},
TaskNotification {
task_id: String,
kind: TaskEventKind,
payload: Value,
},
PromptSuggestion {
suggestions: Vec<String>,
},
TurnComplete {
reason: TerminationReason,
},
Error {
message: String,
},
}Expand description
Agent streaming event.
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.
TextDelta
Text delta (streaming).
ToolCallStart
Tool call started.
ToolCallDelta
Tool call arguments delta (streaming).
ToolCallEnd
Tool call ended.
ToolResult
Tool execution result.
ToolProgress
Tool execution progress.
Fields
StateUpdate
State update patch.
DirectiveEmitted
Directive emitted by agent.
StatusUpdate
Status update.
UsageUpdate
Usage statistics update.
RateLimitInfo
Rate limit information.
Fields
TaskNotification
Task notification.
PromptSuggestion
Prompt suggestion.
TurnComplete
Turn completed.
Fields
§
reason: TerminationReasonTermination reason.
Error
Error occurred.
Implementations§
Source§impl AgentEvent
impl AgentEvent
Sourcepub const fn is_final_response(&self) -> bool
pub const fn is_final_response(&self) -> bool
Returns whether this event signals the final response.
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 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