pub struct InMemoryStore { /* private fields */ }Implementations§
Source§impl InMemoryStore
impl InMemoryStore
Trait Implementations§
Source§impl Clone for InMemoryStore
impl Clone for InMemoryStore
Source§impl Memory for InMemoryStore
impl Memory for InMemoryStore
Source§fn add_message<'life0, 'async_trait>(
&'life0 self,
message: ChatMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_message<'life0, 'async_trait>(
&'life0 self,
message: ChatMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append a message to conversation history.
Source§fn get_messages<'life0, 'async_trait>(
&'life0 self,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChatMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_messages<'life0, 'async_trait>(
&'life0 self,
limit: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChatMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get messages.
Some(n) returns the most recent N messages.Source§fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove all messages and reset state.
Source§fn restore<'life0, 'async_trait>(
&'life0 self,
snapshot: MemorySnapshot,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn restore<'life0, 'async_trait>(
&'life0 self,
snapshot: MemorySnapshot,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Restore from a previously saved snapshot, replacing current state.
Source§fn evict_oldest<'life0, 'async_trait>(
&'life0 self,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChatMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn evict_oldest<'life0, 'async_trait>(
&'life0 self,
count: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChatMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove the oldest N messages. Returns empty vec by default.
Source§fn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MemorySnapshot, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MemorySnapshot, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Serialize current state for persistence.
Source§impl Memory for InMemoryStore
impl Memory for InMemoryStore
fn get_context<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConversationContext>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn compress<'life0, 'life1, 'async_trait>(
&'life0 self,
_summarizer: Option<&'life1 dyn Summarizer>,
) -> Pin<Box<dyn Future<Output = Result<CompressResult>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn needs_compression(&self) -> bool
Auto Trait Implementations§
impl Freeze for InMemoryStore
impl !RefUnwindSafe for InMemoryStore
impl Send for InMemoryStore
impl Sync for InMemoryStore
impl Unpin for InMemoryStore
impl UnsafeUnpin for InMemoryStore
impl !UnwindSafe for InMemoryStore
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