pub struct Memory {
pub version: u32,
pub handoff: Option<Handoff>,
}Expand description
Per-session memory, stored beside the transcript: the compiled handoff that stands in for the dropped middle of the conversation, and what range of the transcript it covers. It never replaces the transcript.
There is no model-written summary here, and no second shape to choose between: a file written
by an older build (v1 or v2) still loads, its summary is ignored, and the next handoff write
replaces the record. The only model input compaction has is the judgement pass’s bullets,
which live inside Handoff::judgement where they can be attributed and discarded together
with the document they belong to.
Fields§
§version: u32MEMORY_VERSION as written, or 0 for a file written before the field existed.
handoff: Option<Handoff>The compiled handoff, absent when none has been stored yet.
Implementations§
Source§impl Memory
impl Memory
Sourcepub fn schema(&self) -> u32
pub fn schema(&self) -> u32
The schema this file was written with; a file from before the field existed is v1.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Why this memory must not be used, if so: a schema this build cannot read, a handoff in a file that predates handoffs, an empty or untrimmed document, or counts that make no sense.
Sourcepub fn usable_handoff(&self) -> Option<&Handoff>
pub fn usable_handoff(&self) -> Option<&Handoff>
The compiled handoff, if this build can read it and it is structurally sound. Whether it
still covers what is being dropped is Handoff::covers’s question, not this one’s.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Memory
impl<'de> Deserialize<'de> for Memory
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 Memory
impl StructuralPartialEq for Memory
Auto Trait Implementations§
impl Forget for Memory
impl Freeze for Memory
impl Move for Memory
impl RefUnwindSafe for Memory
impl Send for Memorywhere
RawVecInner: Send,
impl Sync for Memorywhere
RawVecInner: Sync,
impl Unpin for Memory
impl UnsafeUnpin for Memory
impl UnwindSafe for Memorywhere
RawVecInner: UnwindSafe,
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<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.