pub struct PreparedMemorySnapshot {
pub snapshot_id: SnapshotId,
pub user_memory_revision: u64,
pub session_overlay_revision: u64,
pub retrieval_plan_id: Option<PlanId>,
pub source_turn_id: TurnId,
pub eligible_from_turn: TurnId,
pub facts: Arc<[RetrievedMemory]>,
pub token_count: u16,
pub cache_key: String,
pub created_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
}Expand description
An immutable, budgeted set of memories prepared for a turn.
Fields§
§snapshot_id: SnapshotIdSnapshot identity.
user_memory_revision: u64Canonical repository revision the snapshot was built from.
session_overlay_revision: u64Session overlay revision the snapshot was built from.
retrieval_plan_id: Option<PlanId>The plan that produced it.
source_turn_id: TurnIdThe turn whose transcript produced it.
eligible_from_turn: TurnIdThe first turn it may be served to.
facts: Arc<[RetrievedMemory]>The memories, in presentation order.
token_count: u16Total estimated tokens.
cache_key: StringCache key of the plan that produced it.
created_at: DateTime<Utc>When it was prepared.
expires_at: DateTime<Utc>When it stops being usable.
Implementations§
Source§impl PreparedMemorySnapshot
impl PreparedMemorySnapshot
Sourcepub fn satisfies(&self, query: &str, now: DateTime<Utc>) -> bool
pub fn satisfies(&self, query: &str, now: DateTime<Utc>) -> bool
Whether this snapshot answers the query the model actually asked with.
A prepared snapshot is speculative: it was built from the transcript, not from the tool arguments. When the model asks something the speculation did not anticipate, the caller falls back to a live search rather than answering the wrong question quickly.
Sourcepub fn to_tool_payload(&self) -> Value
pub fn to_tool_payload(&self) -> Value
The tool payload handed back to the model (§39.2).
Trait Implementations§
Source§impl Clone for PreparedMemorySnapshot
impl Clone for PreparedMemorySnapshot
Source§fn clone(&self) -> PreparedMemorySnapshot
fn clone(&self) -> PreparedMemorySnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PreparedMemorySnapshot
impl Debug for PreparedMemorySnapshot
Source§impl Default for PreparedMemorySnapshot
impl Default for PreparedMemorySnapshot
Source§impl<'de> Deserialize<'de> for PreparedMemorySnapshot
impl<'de> Deserialize<'de> for PreparedMemorySnapshot
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>,
Source§impl PartialEq for PreparedMemorySnapshot
impl PartialEq for PreparedMemorySnapshot
Source§impl Serialize for PreparedMemorySnapshot
impl Serialize for PreparedMemorySnapshot
impl StructuralPartialEq for PreparedMemorySnapshot
Auto Trait Implementations§
impl Freeze for PreparedMemorySnapshot
impl RefUnwindSafe for PreparedMemorySnapshot
impl Send for PreparedMemorySnapshot
impl Sync for PreparedMemorySnapshot
impl Unpin for PreparedMemorySnapshot
impl UnwindSafe for PreparedMemorySnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].