pub struct ConversationSummaryMemory { /* private fields */ }Expand description
Summary memory that automatically summarizes old conversations
Implementations§
Source§impl ConversationSummaryMemory
impl ConversationSummaryMemory
Sourcepub fn with_config(config: SummaryMemoryConfig) -> Self
pub fn with_config(config: SummaryMemoryConfig) -> Self
Create a new summary memory with custom configuration
Trait Implementations§
Source§impl Default for ConversationSummaryMemory
impl Default for ConversationSummaryMemory
Source§impl Memory for ConversationSummaryMemory
impl Memory for ConversationSummaryMemory
Source§fn add_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
role: &'life2 str,
content: &'life3 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
role: &'life2 str,
content: &'life3 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Add a message to the conversation
Source§fn add_structured_message<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
message: ConversationMessage,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_structured_message<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
message: ConversationMessage,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a structured message
Source§fn get_conversation_history<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_conversation_history<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get conversation history
Source§fn get_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get structured conversation history
Source§fn get_recent_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_recent_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get recent messages with limit
Source§fn clear_conversation<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn clear_conversation<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Clear conversation history
Source§fn get_memory_variables<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<HashMap<String, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_memory_variables<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<HashMap<String, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get memory variables for prompt injection
Source§fn save_context<'life0, 'life1, 'async_trait>(
&'life0 self,
_conversation_id: &'life1 str,
_context: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_context<'life0, 'life1, 'async_trait>(
&'life0 self,
_conversation_id: &'life1 str,
_context: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save arbitrary context
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check
Auto Trait Implementations§
impl Freeze for ConversationSummaryMemory
impl !RefUnwindSafe for ConversationSummaryMemory
impl Send for ConversationSummaryMemory
impl Sync for ConversationSummaryMemory
impl Unpin 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