pub enum AgentEvent {
Start {
timestamp: DateTime<Utc>,
prompt: String,
model: Option<String>,
},
UserMessage {
timestamp: DateTime<Utc>,
text: String,
},
AssistantText {
timestamp: DateTime<Utc>,
text: String,
},
ToolUse {
timestamp: DateTime<Utc>,
tool: String,
input: String,
},
ToolResult {
timestamp: DateTime<Utc>,
tool: String,
output: String,
is_error: bool,
},
SessionResult {
timestamp: DateTime<Utc>,
turns: u64,
cost_usd: Option<f64>,
session_id: Option<String>,
},
Error {
timestamp: DateTime<Utc>,
message: String,
},
}Expand description
A structured event written to the agent’s event log.
This is the canonical type for agent event serialization. Both swarm (writing) and apiari (reading) use this type.
Variants§
Start
Session started.
UserMessage
User sent a follow-up message.
AssistantText
Assistant emitted text.
ToolUse
Assistant requested a tool call.
ToolResult
Tool execution completed.
SessionResult
SDK returned a result — session is now idle and resumable.
Error
Session errored.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more