pub struct ConversationSummaryMemory { /* private fields */ }Expand description
A memory strategy that summarizes older messages using a ChatModel.
Keeps the most recent buffer_size messages verbatim. When the total
number of stored messages exceeds buffer_size * 2, the older messages
are summarized into a single system message that is prepended on load.
Implementations§
Trait Implementations§
Source§impl MemoryStore for ConversationSummaryMemory
impl MemoryStore for ConversationSummaryMemory
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn clear<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for ConversationSummaryMemory
impl !RefUnwindSafe for ConversationSummaryMemory
impl Send for ConversationSummaryMemory
impl Sync for ConversationSummaryMemory
impl Unpin for ConversationSummaryMemory
impl UnsafeUnpin for ConversationSummaryMemory
impl !UnwindSafe for ConversationSummaryMemory
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