pub struct ContextManager { /* private fields */ }Implementations§
Source§impl ContextManager
impl ContextManager
pub fn new() -> Self
pub fn add_message(&self, role: &str, content: &str, player: Option<&str>)
pub fn add_user_message(&self, content: &str, player: &str)
pub fn add_assistant_message(&self, content: &str)
pub fn add_system_message(&self, content: &str)
pub fn get_messages(&self) -> Vec<Message>
pub fn get_messages_for_player(&self, player: &str) -> Vec<Message>
pub fn clear(&self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get_recent_players(&self, count: usize) -> Vec<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextManager
impl !RefUnwindSafe for ContextManager
impl Send for ContextManager
impl Sync for ContextManager
impl Unpin for ContextManager
impl UnsafeUnpin for ContextManager
impl !UnwindSafe for ContextManager
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