Skip to main content

MemoryProvider

Trait MemoryProvider 

Source
pub trait MemoryProvider: Send + Sync {
    // Required methods
    fn read<'life0, 'async_trait>(
        &'life0 self,
        options: MemoryReadOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ModelMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn write<'life0, 'async_trait>(
        &'life0 self,
        messages: Vec<ModelMessage>,
        options: MemoryWriteOptions,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn clear<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _session_id: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn read<'life0, 'async_trait>( &'life0 self, options: MemoryReadOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<ModelMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn write<'life0, 'async_trait>( &'life0 self, messages: Vec<ModelMessage>, options: MemoryWriteOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn clear<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§