pub struct ConversationTracker { /* private fields */ }Expand description
Conversation context for multi-turn capture
Implementations§
Source§impl ConversationTracker
impl ConversationTracker
pub fn new(max_messages: usize) -> Self
Sourcepub fn add_message(&mut self, content: &str, role: &str)
pub fn add_message(&mut self, content: &str, role: &str)
Add a message to the tracker
Sourcepub fn recent_context(&self, num_messages: usize) -> String
pub fn recent_context(&self, num_messages: usize) -> String
Get recent context as a string
Sourcepub fn add_pending(&mut self, candidate: CaptureCandidate)
pub fn add_pending(&mut self, candidate: CaptureCandidate)
Add pending capture
Sourcepub fn pending(&self) -> &[CaptureCandidate]
pub fn pending(&self) -> &[CaptureCandidate]
Get pending captures
Sourcepub fn clear_pending(&mut self)
pub fn clear_pending(&mut self)
Clear pending captures
Sourcepub fn confirm_pending(&mut self, index: usize) -> Option<CaptureCandidate>
pub fn confirm_pending(&mut self, index: usize) -> Option<CaptureCandidate>
Confirm and remove a pending capture
Sourcepub fn reject_pending(&mut self, index: usize)
pub fn reject_pending(&mut self, index: usize)
Reject a pending capture
Trait Implementations§
Source§impl Debug for ConversationTracker
impl Debug for ConversationTracker
Source§impl Default for ConversationTracker
impl Default for ConversationTracker
Source§fn default() -> ConversationTracker
fn default() -> ConversationTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConversationTracker
impl RefUnwindSafe for ConversationTracker
impl Send for ConversationTracker
impl Sync for ConversationTracker
impl Unpin for ConversationTracker
impl UnsafeUnpin for ConversationTracker
impl UnwindSafe for ConversationTracker
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 moreCreates a shared type from an unshared type.