pub struct TestChatMemory { /* private fields */ }Expand description
Like InMemoryChatMemory, but it exposes the whole item list.
The production one only offers find_last_items, which is all the
bot needs and not enough for a test that wants to assert on what a
turn recorded.
Implementations§
Source§impl TestChatMemory
impl TestChatMemory
pub fn new() -> Self
pub fn all(&self) -> Vec<ChatItem>
Sourcepub fn items_from(&self, index: usize) -> Vec<ChatItem>
pub fn items_from(&self, index: usize) -> Vec<ChatItem>
Items recorded from index onwards — how a harness isolates
one turn from the history before it.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&self)
Trait Implementations§
Source§impl ChatMemory for TestChatMemory
impl ChatMemory for TestChatMemory
Source§impl Debug for TestChatMemory
impl Debug for TestChatMemory
Source§impl Default for TestChatMemory
impl Default for TestChatMemory
Source§fn default() -> TestChatMemory
fn default() -> TestChatMemory
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for TestChatMemory
impl !RefUnwindSafe for TestChatMemory
impl Send for TestChatMemory
impl Sync for TestChatMemory
impl Unpin for TestChatMemory
impl UnsafeUnpin for TestChatMemory
impl UnwindSafe for TestChatMemory
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