Skip to main content

AgentEvent

Struct AgentEvent 

Source
pub struct AgentEvent {
Show 19 fields pub event_id: String, pub observed_at: DateTime<Utc>, pub device: DeviceContext, pub agent: AgentContext, pub session_id: String, pub response_id: Option<String>, pub previous_response_id: Option<String>, pub subagent_id: Option<String>, pub parent_subagent_id: Option<String>, pub turn_id: Option<String>, pub purpose: Option<EventPurpose>, pub llm: LlmContext, pub side: AgentEventSide, pub omitted: Vec<ContentCategory>, pub conversation: Option<Conversation>, pub path: String, pub headers: Vec<HttpHeader>, pub token_usage: TokenUsage, pub attachments: Vec<ImageAttachment>,
}
Expand description

One event decoded with the contract defined by the active plugin protocol.

Fields§

§event_id: String

Stable event identifier assigned by the event producer.

§observed_at: DateTime<Utc>

Time at which the broker observed the logical event.

§device: DeviceContext

Device context observed by the broker.

§agent: AgentContext

Agent product context inferred from traffic.

§session_id: String

Provider or collector session identifier.

§response_id: Option<String>

Provider identity of the response this exchange produced. Both events of the exchange carry it, and later requests continue after it by this value.

§previous_response_id: Option<String>

The response this exchange’s request continues after; the request then carries only the messages added since that response.

§subagent_id: Option<String>

Id of the subagent this exchange belongs to, as the client declared it; absent for the main agent and for side requests.

Each declared id is read only from the request headers (for a WebSocket connection, its upgrade request’s), taken verbatim, and absent when no header declares it; no value is substituted. Both events of an exchange carry it.

§parent_subagent_id: Option<String>

Id of the subagent that spawned this exchange’s subagent, declared like subagent_id; absent when the main agent spawned it.

§turn_id: Option<String>

Root turn the client declares, like subagent_id: the user input this exchange ultimately works for. A subagent’s exchanges carry the value of the turn that spawned it; an exchange the client makes for no turn carries none.

§purpose: Option<EventPurpose>

What the Agent made this provider call for, when its traffic says so.

§llm: LlmContext

Provider and model context.

§side: AgentEventSide

Request or response side represented by this event.

§omitted: Vec<ContentCategory>

Content categories the effective content policy omitted from this event; empty when everything was retained.

§conversation: Option<Conversation>

Role-aware request or response entries, one per protocol block or item; the only carrier of the side’s content.

§path: String

The exchange’s request target: its path and query as the request named them (for a WebSocket connection, its upgrade request’s), verbatim. Both events of an exchange carry it.

§headers: Vec<HttpHeader>

Captured headers of this event’s side: request headers on a request event, response headers on a response event. In capture order, duplicates kept, verbatim except that credential values are redacted.

§token_usage: TokenUsage

Token counters attributed to this event side.

§attachments: Vec<ImageAttachment>

Policy-retained image attachments.

Trait Implementations§

Source§

impl Debug for AgentEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AgentEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AgentEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.