pub struct RecallService {
pub(crate) config: CellstateConfig,
pub(crate) commits: Vec<MemoryCommit>,
}Expand description
Service for recalling past interactions and decisions. Provides query methods for memory commits.
Fields§
§config: CellstateConfig§commits: Vec<MemoryCommit>Implementations§
Source§impl RecallService
impl RecallService
Sourcepub fn new(config: CellstateConfig) -> Result<RecallService, CellstateError>
pub fn new(config: CellstateConfig) -> Result<RecallService, CellstateError>
Create a new recall service with the given configuration.
Sourcepub fn config(&self) -> &CellstateConfig
pub fn config(&self) -> &CellstateConfig
Get the configuration.
Sourcepub fn add_commit(&mut self, commit: MemoryCommit)
pub fn add_commit(&mut self, commit: MemoryCommit)
Add a commit to the service.
Sourcepub fn recall_previous(
&self,
trajectory_id: Option<TrajectoryId>,
scope_id: Option<ScopeId>,
limit: i32,
) -> Result<Vec<MemoryCommit>, CellstateError>
pub fn recall_previous( &self, trajectory_id: Option<TrajectoryId>, scope_id: Option<ScopeId>, limit: i32, ) -> Result<Vec<MemoryCommit>, CellstateError>
Sourcepub fn search_interactions(
&self,
search_text: &str,
limit: i32,
) -> Result<Vec<MemoryCommit>, CellstateError>
pub fn search_interactions( &self, search_text: &str, limit: i32, ) -> Result<Vec<MemoryCommit>, CellstateError>
Sourcepub fn recall_decisions(
&self,
topic: Option<&str>,
limit: i32,
) -> Result<Vec<DecisionRecall>, CellstateError>
pub fn recall_decisions( &self, topic: Option<&str>, limit: i32, ) -> Result<Vec<DecisionRecall>, CellstateError>
Sourcepub fn get_scope_history(
&self,
scope_id: ScopeId,
) -> Result<ScopeHistory, CellstateError>
pub fn get_scope_history( &self, scope_id: ScopeId, ) -> Result<ScopeHistory, CellstateError>
Sourcepub fn get_memory_stats(
&self,
trajectory_id: Option<TrajectoryId>,
) -> Result<MemoryStats, CellstateError>
pub fn get_memory_stats( &self, trajectory_id: Option<TrajectoryId>, ) -> Result<MemoryStats, CellstateError>
Trait Implementations§
Source§impl Clone for RecallService
impl Clone for RecallService
Source§fn clone(&self) -> RecallService
fn clone(&self) -> RecallService
Returns a duplicate of the value. Read more
1.0.0 · 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 RecallService
impl RefUnwindSafe for RecallService
impl Send for RecallService
impl Sync for RecallService
impl Unpin for RecallService
impl UnwindSafe for RecallService
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