pub struct ToolContextSeed {
pub thread_id: ThreadId,
pub turn: usize,
pub sequence_offset: u64,
pub metadata: HashMap<String, Value>,
}Expand description
Durable inputs needed to reconstruct a crate::tools::ToolContext.
Every field is recoverable from the task / thread record in durable storage. The server serialises this when a task is created and deserialises it when a worker starts (or restarts).
This is the stable reconstruction contract — later phases depend on its shape, so changing it requires a version bump.
Fields§
§thread_id: ThreadIdThread identity for the current conversation.
turn: usizeTurn number within the thread (1-based).
sequence_offset: u64Sequence offset for event ordering continuity across turns.
The event authority uses this to resume numbering where the previous turn left off, so events within a thread form a single monotonic sequence even across worker restarts.
metadata: HashMap<String, Value>Arbitrary key-value metadata forwarded to the tool context.
Implementations§
Source§impl ToolContextSeed
impl ToolContextSeed
Sourcepub fn first_turn(thread_id: ThreadId) -> Self
pub fn first_turn(thread_id: ThreadId) -> Self
Create a seed for a fresh first turn with no prior state.
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Builder-style setter for metadata.
Trait Implementations§
Source§impl Clone for ToolContextSeed
impl Clone for ToolContextSeed
Source§fn clone(&self) -> ToolContextSeed
fn clone(&self) -> ToolContextSeed
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolContextSeed
impl Debug for ToolContextSeed
Source§impl<'de> Deserialize<'de> for ToolContextSeed
impl<'de> Deserialize<'de> for ToolContextSeed
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>,
impl Eq for ToolContextSeed
Source§impl PartialEq for ToolContextSeed
impl PartialEq for ToolContextSeed
Source§fn eq(&self, other: &ToolContextSeed) -> bool
fn eq(&self, other: &ToolContextSeed) -> bool
self and other values to be equal, and is used by ==.