#[non_exhaustive]pub enum Event {
Started {
session: String,
model: Option<String>,
},
Thinking(String),
Text(String),
ToolCall {
id: Option<String>,
name: String,
input: Value,
},
ToolResult {
id: Option<String>,
ok: Option<bool>,
output: String,
},
RateLimit(RateLimit),
}Expand description
One normalized thing an agent did, agent-agnostic so a single renderer works across all three.
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.
Started
The session is live. Emitted once, as early as the agent reveals it.
Fields
Thinking(String)
Reasoning text, where the agent exposes it.
Text(String)
Assistant text as it arrives.
ToolCall
The agent invoked a tool.
Fields
§
id: Option<String>Correlates with the matching Event::ToolResult, when the agent
provides an id.
ToolResult
A tool returned.
Fields
§
id: Option<String>Correlates with the originating Event::ToolCall.
RateLimit(RateLimit)
A quota signal. Reported, never acted on.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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