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) -> ToolContextSeed
pub fn first_turn(thread_id: ThreadId) -> ToolContextSeed
Create a seed for a fresh first turn with no prior state.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: Value,
) -> ToolContextSeed
pub fn with_metadata( self, key: impl Into<String>, value: Value, ) -> ToolContextSeed
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<ToolContextSeed, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolContextSeed, <__D as Deserializer<'de>>::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 ==.Source§impl Serialize for ToolContextSeed
impl Serialize for ToolContextSeed
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ToolContextSeed
Auto Trait Implementations§
impl Freeze for ToolContextSeed
impl RefUnwindSafe for ToolContextSeed
impl Send for ToolContextSeed
impl Sync for ToolContextSeed
impl Unpin for ToolContextSeed
impl UnsafeUnpin for ToolContextSeed
impl UnwindSafe for ToolContextSeed
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.