pub trait Memory: Send + Sync {
type Error: Error + 'static + Send + Sync;
// Required methods
async fn add(
&mut self,
user_input: &str,
ai_response: &str,
) -> Result<(), Self::Error>;
async fn search(&self, query: &str) -> Result<Vec<ChatMessage>, Self::Error>;
async fn clear(&mut self) -> Result<(), Self::Error>;
}Required Associated Types§
Required Methods§
async fn add( &mut self, user_input: &str, ai_response: &str, ) -> Result<(), Self::Error>
async fn search(&self, query: &str) -> Result<Vec<ChatMessage>, Self::Error>
async fn clear(&mut self) -> Result<(), Self::Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".