pub struct InteractiveSession {
pub messages: Vec<ChatMessage>,
pub thinking: bool,
pub current_response: String,
pub session_id: Option<Uuid>,
pub name: Option<String>,
pub entries: Vec<SessionEntry>,
}Expand description
Interactive session state
Fields§
§messages: Vec<ChatMessage>Chat messages exchanged so far.
thinking: boolWhether the assistant is currently generating a response.
current_response: StringPartial response text accumulated during streaming.
session_id: Option<Uuid>Unique session identifier.
name: Option<String>Optional human-readable session name.
entries: Vec<SessionEntry>Raw session entries for persistence and tree navigation.
Implementations§
Source§impl InteractiveSession
impl InteractiveSession
Sourcepub fn add_user_message(&mut self, content: String)
pub fn add_user_message(&mut self, content: String)
Add a user message to the session.
Sourcepub fn add_assistant_message(&mut self, content: String)
pub fn add_assistant_message(&mut self, content: String)
Add an assistant message to the session.
Sourcepub fn append_to_response(&mut self, text: &str)
pub fn append_to_response(&mut self, text: &str)
Append text to the current partial streaming response.
Sourcepub fn finish_response(&mut self)
pub fn finish_response(&mut self)
Finalize the current streaming response into a full assistant message.
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: &str) -> Option<&SessionEntry>
pub fn get_entry_by_id(&self, id: &str) -> 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§
Source§impl Clone for InteractiveSession
impl Clone for InteractiveSession
Source§fn clone(&self) -> InteractiveSession
fn clone(&self) -> InteractiveSession
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InteractiveSession
impl Debug for InteractiveSession
Source§impl Default for InteractiveSession
impl Default for InteractiveSession
Source§fn default() -> InteractiveSession
fn default() -> InteractiveSession
Returns the “default value” for a type. Read more
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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 more