pub struct InteractiveSession {
pub messages: Vec<ChatMessage>,
pub thinking: bool,
pub current_response: String,
pub session_id: Option<Uuid>,
pub entries: Vec<SessionEntry>,
}Expand description
Interactive session state
Fields§
§messages: Vec<ChatMessage>§thinking: bool§current_response: String§session_id: Option<Uuid>§entries: Vec<SessionEntry>Implementations§
Source§impl InteractiveSession
impl InteractiveSession
pub fn new() -> Self
pub fn add_user_message(&mut self, content: String)
pub fn add_assistant_message(&mut self, content: String)
pub fn append_to_response(&mut self, text: &str)
pub fn finish_response(&mut self)
Sourcepub fn entries(&self) -> &[SessionEntry]
pub fn entries(&self) -> &[SessionEntry]
Get all entries in the session
Sourcepub fn get_entry(&self, index: usize) -> Option<&SessionEntry>
pub fn get_entry(&self, index: usize) -> Option<&SessionEntry>
Get entry at a specific index
Sourcepub fn get_entry_by_id(&self, id: Uuid) -> Option<&SessionEntry>
pub fn get_entry_by_id(&self, id: Uuid) -> Option<&SessionEntry>
Get entry by ID
Sourcepub fn truncate_at(&mut self, index: usize)
pub fn truncate_at(&mut self, index: usize)
Truncate entries at a given index (for branching)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InteractiveSession
impl RefUnwindSafe for InteractiveSession
impl Send for InteractiveSession
impl Sync for InteractiveSession
impl Unpin for InteractiveSession
impl UnsafeUnpin for InteractiveSession
impl UnwindSafe for InteractiveSession
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().