pub struct WindowBufferMemory { /* private fields */ }Expand description
A memory structure that stores messages in a sliding window buffer.
Implementations§
Trait Implementations§
Source§impl Default for WindowBufferMemory
impl Default for WindowBufferMemory
Source§impl From<WindowBufferMemory> for Arc<Mutex<dyn Memory>>
Converts WindowBufferMemory into an Arc<Mutex<dyn Memory>>.
impl From<WindowBufferMemory> for Arc<Mutex<dyn Memory>>
Converts WindowBufferMemory into an Arc<Mutex<dyn Memory>>.
Source§fn from(val: WindowBufferMemory) -> Self
fn from(val: WindowBufferMemory) -> Self
Converts to this type from the input type.
Source§impl From<WindowBufferMemory> for Arc<dyn Memory>
Converts WindowBufferMemory into an Arc<dyn Memory>.
impl From<WindowBufferMemory> for Arc<dyn Memory>
Converts WindowBufferMemory into an Arc<dyn Memory>.
Source§fn from(val: WindowBufferMemory) -> Self
fn from(val: WindowBufferMemory) -> Self
Converts to this type from the input type.
Source§impl Memory for WindowBufferMemory
impl Memory for WindowBufferMemory
Source§fn add_message(&mut self, message: Message)
fn add_message(&mut self, message: Message)
Adds a message to the buffer, removing the oldest message if the buffer is full.
Source§fn add_user_message(&mut self, message: &dyn Display)
fn add_user_message(&mut self, message: &dyn Display)
Adds a user (human) message to the memory.
Source§fn add_ai_message(&mut self, message: &dyn Display)
fn add_ai_message(&mut self, message: &dyn Display)
Adds an AI (LLM) message to the memory.
Auto Trait Implementations§
impl Freeze for WindowBufferMemory
impl RefUnwindSafe for WindowBufferMemory
impl Send for WindowBufferMemory
impl Sync for WindowBufferMemory
impl Unpin for WindowBufferMemory
impl UnwindSafe for WindowBufferMemory
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more