Skip to main content

EventBody

Enum EventBody 

Source
pub enum EventBody {
    Put {
        key: String,
        value: Vec<u8>,
    },
    Delete {
        key: String,
    },
    SessionStarted {
        agent_id: String,
        config_hash: String,
    },
    ModelTurn {
        role: Role,
        content: String,
        model: String,
    },
    ToolCall {
        call_id: String,
        tool: String,
        args_json: String,
    },
    ToolResult {
        call_id: String,
        ok: bool,
        content: String,
    },
    Decision {
        summary: String,
        rationale: String,
    },
    SessionEnded {
        reason: String,
    },
}
Expand description

The built-in agent-memory payload: a key/value vocabulary plus the typed events of an agent session (turns, tool calls, decisions). This is one provided payload over the generic engine — you can define your own instead.

Variants§

§

Put

Set key to value in the key/value projection.

Fields

§key: String

The key to set.

§value: Vec<u8>

The value to store.

§

Delete

Remove key from the key/value projection.

Fields

§key: String

The key to remove.

§

SessionStarted

Marks the start of an agent session.

Fields

§agent_id: String

Identifier of the agent.

§config_hash: String

Hash of the agent’s configuration at session start.

§

ModelTurn

One conversational turn.

Fields

§role: Role

Who produced the turn.

§content: String

The turn’s text content.

§model: String

The model that produced it.

§

ToolCall

An invocation of a tool.

Fields

§call_id: String

Correlates this call with its EventBody::ToolResult.

§tool: String

Name of the tool invoked.

§args_json: String

JSON-encoded arguments.

§

ToolResult

The result of a EventBody::ToolCall.

Fields

§call_id: String

The call_id of the originating call.

§ok: bool

Whether the call succeeded.

§content: String

The result content.

§

Decision

A recorded decision — the natural fork point in a session.

Fields

§summary: String

One-line summary of the decision.

§rationale: String

Why it was made.

§

SessionEnded

Marks the end of a session.

Fields

§reason: String

Why the session ended.

Trait Implementations§

Source§

impl Clone for EventBody

Source§

fn clone(&self) -> EventBody

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventBody

Source§

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

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

impl<'de> Deserialize<'de> for EventBody

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 EventBody

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> Body for T
where T: Serialize + DeserializeOwned + Clone + 'static,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.