pub struct InMemoryShortTerm { /* private fields */ }Trait Implementations§
Source§impl Default for InMemoryShortTerm
impl Default for InMemoryShortTerm
Source§fn default() -> InMemoryShortTerm
fn default() -> InMemoryShortTerm
Returns the “default value” for a type. Read more
Source§impl ShortTermMemory for InMemoryShortTerm
impl ShortTermMemory for InMemoryShortTerm
Source§fn append<'life0, 'async_trait>(
&'life0 self,
thread: ThreadId,
msg: Message,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append<'life0, 'async_trait>(
&'life0 self,
thread: ThreadId,
msg: Message,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append a message to the thread’s history.
Source§fn load<'life0, 'async_trait>(
&'life0 self,
thread: ThreadId,
_max_tokens: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
thread: ThreadId,
_max_tokens: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load up to
max_tokens of the most-recent messages, oldest first.
Implementations approximate token counts (provider-specific).Source§fn clear<'life0, 'async_trait>(
&'life0 self,
thread: ThreadId,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
thread: ThreadId,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drop all messages for
thread.Source§fn append_batch<'life0, 'async_trait>(
&'life0 self,
thread: ThreadId,
messages: Vec<Message>,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_batch<'life0, 'async_trait>(
&'life0 self,
thread: ThreadId,
messages: Vec<Message>,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Append a batch of messages, oldest first. The default appends each in
turn; backends with bulk-insert support should override to collapse the
N writes into one round-trip (the resume path replays a full history).
Auto Trait Implementations§
impl !Freeze for InMemoryShortTerm
impl !RefUnwindSafe for InMemoryShortTerm
impl !UnwindSafe for InMemoryShortTerm
impl Send for InMemoryShortTerm
impl Sync for InMemoryShortTerm
impl Unpin for InMemoryShortTerm
impl UnsafeUnpin for InMemoryShortTerm
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