pub struct Event {
pub id: String,
pub invocation_id: String,
pub author: String,
pub content: Option<String>,
pub actions: EventActions,
pub timestamp: u64,
}Expand description
A structured event within an agent invocation.
Events form the audit trail of an agent session. They capture user messages, model responses, tool calls, state changes, and control flow actions.
Fields§
§id: StringUnique event ID.
invocation_id: StringInvocation ID grouping related events.
Who authored this event (e.g., “user”, agent name, tool name).
content: Option<String>Optional text content of the event.
actions: EventActionsActions triggered by this event.
timestamp: u64Unix timestamp (seconds).
Implementations§
Source§impl Event
impl Event
Sourcepub fn new(author: impl Into<String>, content: Option<String>) -> Self
pub fn new(author: impl Into<String>, content: Option<String>) -> Self
Create a new event with the given author and optional content.
Sourcepub fn with_invocation(self, invocation_id: impl Into<String>) -> Self
pub fn with_invocation(self, invocation_id: impl Into<String>) -> Self
Set the invocation ID.
Sourcepub fn with_actions(self, actions: EventActions) -> Self
pub fn with_actions(self, actions: EventActions) -> Self
Set actions on this event.
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
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin 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