pub struct SessionMemory {
pub config: SessionMemoryConfig,
pub state: SessionMemoryState,
/* private fields */
}Fields§
§config: SessionMemoryConfig§state: SessionMemoryStateImplementations§
Source§impl SessionMemory
impl SessionMemory
pub fn parse_extraction_result( &self, raw: &str, cycle: i32, ) -> Vec<SessionMemoryEntry>
Source§impl SessionMemory
impl SessionMemory
pub fn storage_path(&self) -> Option<PathBuf>
Source§impl SessionMemory
impl SessionMemory
pub fn new(config: SessionMemoryConfig) -> Self
pub fn with_workspace( config: SessionMemoryConfig, workspace: Option<PathBuf>, storage_scope: Option<String>, ) -> Self
pub fn should_extract(&self, current_tokens: u64, message_count: usize) -> bool
pub fn extract( &mut self, messages: &[Message], current_cycle: i32, current_tokens: u64, ) -> usize
pub fn render_as_system_context(&self) -> String
pub fn on_compaction(&mut self, current_tokens: Option<u64>)
pub fn load(&mut self)
pub fn save(&self)
pub fn merge_entries(&mut self, entries: Vec<SessionMemoryEntry>) -> usize
pub fn prune_to_budget(&mut self)
Trait Implementations§
Source§impl Clone for SessionMemory
impl Clone for SessionMemory
Source§fn clone(&self) -> SessionMemory
fn clone(&self) -> SessionMemory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionMemory
impl !RefUnwindSafe for SessionMemory
impl Send for SessionMemory
impl Sync for SessionMemory
impl Unpin for SessionMemory
impl UnsafeUnpin for SessionMemory
impl !UnwindSafe for SessionMemory
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.