pub struct MemoryManager {
pub config: MemoryManagerConfig,
/* private fields */
}Fields§
§config: MemoryManagerConfigImplementations§
Source§impl MemoryManager
impl MemoryManager
Source§impl MemoryManager
impl MemoryManager
pub fn autocompact_threshold(&self) -> u64
pub fn effective_context_window(&self) -> u64
pub fn estimate_memory_usage_percentage( &self, messages: &[Message], total_tokens: Option<u64>, recent_tool_call_ids: Option<&BTreeSet<String>>, ) -> u64
pub fn warning_threshold(&self) -> u64
Source§impl MemoryManager
impl MemoryManager
pub fn should_preemptive_microcompact(&self, message_length: u64) -> bool
pub fn microcompact_messages( &self, messages: &[Message], cycle_index: u32, ) -> (Vec<Message>, usize)
pub fn microcompact_trigger_threshold(&self) -> u64
Source§impl MemoryManager
impl MemoryManager
pub fn session_memory(&self) -> Option<&SessionMemory>
pub fn session_memory_mut(&mut self) -> Option<&mut SessionMemory>
pub fn apply_session_memory_context(&self, messages: &[Message]) -> Vec<Message>
pub fn strip_session_memory_context(&self, messages: &[Message]) -> Vec<Message>
Source§impl MemoryManager
impl MemoryManager
pub fn new(config: MemoryManagerConfig) -> Self
pub fn compact( &mut self, messages: &[Message], force: bool, ) -> (Vec<Message>, bool)
pub fn compact_for_cycle( &mut self, messages: &[Message], cycle_index: u32, force: bool, ) -> (Vec<Message>, bool)
pub fn compact_for_cycle_with_usage( &mut self, messages: &[Message], cycle_index: u32, force: bool, total_tokens: Option<u64>, recent_tool_call_ids: Option<&BTreeSet<String>>, ) -> (Vec<Message>, bool)
Trait Implementations§
Source§impl Clone for MemoryManager
impl Clone for MemoryManager
Source§fn clone(&self) -> MemoryManager
fn clone(&self) -> MemoryManager
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 !RefUnwindSafe for MemoryManager
impl !UnwindSafe for MemoryManager
impl Freeze for MemoryManager
impl Send for MemoryManager
impl Sync for MemoryManager
impl Unpin for MemoryManager
impl UnsafeUnpin for MemoryManager
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.