pub struct ConversationState { /* private fields */ }Expand description
Tracks conversation phase and context data.
Implementations§
Source§impl ConversationState
impl ConversationState
pub fn new() -> Self
pub fn phase(&self) -> &Phase
Sourcepub fn transition(&mut self, to: Phase)
pub fn transition(&mut self, to: Phase)
Transition to a new phase.
Sourcepub fn transition_with(&mut self, to: Phase, metadata: Value)
pub fn transition_with(&mut self, to: Phase, metadata: Value)
Transition with metadata.
pub fn get_ctx(&self, key: &str) -> Option<&Value>
pub fn transition_count(&self) -> usize
pub fn history(&self) -> &[Transition]
pub fn is_terminal(&self) -> bool
Sourcepub fn previous_phase(&self) -> Option<&Phase>
pub fn previous_phase(&self) -> Option<&Phase>
Previous phase (before last transition).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConversationState
impl RefUnwindSafe for ConversationState
impl Send for ConversationState
impl Sync for ConversationState
impl Unpin for ConversationState
impl UnsafeUnpin for ConversationState
impl UnwindSafe for ConversationState
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