pub struct ContextStore { /* private fields */ }Implementations§
Source§impl ContextStore
impl ContextStore
pub fn add_entry( &self, session_id: &str, source_type: &str, source_id: &str, content_preview: Option<&str>, token_count: i64, relevance_score: f64, priority: i64, ) -> Result<String>
Sourcepub fn build_window(
&self,
session_id: &str,
max_tokens: i64,
) -> Result<Vec<ContextEntry>>
pub fn build_window( &self, session_id: &str, max_tokens: i64, ) -> Result<Vec<ContextEntry>>
Build a context window for a session, filling up to max_tokens.
Returns entries ordered by priority (desc), then relevance (desc),
stopping when the running token sum would exceed max_tokens.
pub fn get_entries(&self, session_id: &str) -> Result<Vec<ContextEntry>>
pub fn clear_session(&self, session_id: &str) -> Result<()>
pub fn remove_entry(&self, id: &str) -> Result<()>
Auto Trait Implementations§
impl Freeze for ContextStore
impl RefUnwindSafe for ContextStore
impl Send for ContextStore
impl Sync for ContextStore
impl Unpin for ContextStore
impl UnsafeUnpin for ContextStore
impl UnwindSafe for ContextStore
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