pub struct InteractiveLoop<'a> { /* private fields */ }Expand description
Interactive loop handle
Implementations§
Source§impl<'a> InteractiveLoop<'a>
impl<'a> InteractiveLoop<'a>
Sourcepub async fn send_message(&mut self, prompt: String) -> Result<()>
pub async fn send_message(&mut self, prompt: String) -> Result<()>
Add a user message and get the assistant response
Sourcepub fn messages(&self) -> &[ChatMessage]
pub fn messages(&self) -> &[ChatMessage]
Get current messages
Sourcepub fn current_response(&self) -> &str
pub fn current_response(&self) -> &str
Get the current partial response (while thinking)
Sourcepub fn is_thinking(&self) -> bool
pub fn is_thinking(&self) -> bool
Check if currently thinking
Sourcepub fn entries(&self) -> &[SessionEntry]
pub fn entries(&self) -> &[SessionEntry]
Get session entries for tree navigation
Sourcepub fn get_entry(&self, id: Uuid) -> Option<&SessionEntry>
pub fn get_entry(&self, id: Uuid) -> Option<&SessionEntry>
Get entry by ID
Sourcepub fn switch_model(&self, model_id: &str) -> Result<()>
pub fn switch_model(&self, model_id: &str) -> Result<()>
Switch the model used for future LLM calls
Auto Trait Implementations§
impl<'a> Freeze for InteractiveLoop<'a>
impl<'a> !RefUnwindSafe for InteractiveLoop<'a>
impl<'a> Send for InteractiveLoop<'a>
impl<'a> Sync for InteractiveLoop<'a>
impl<'a> Unpin for InteractiveLoop<'a>
impl<'a> UnsafeUnpin for InteractiveLoop<'a>
impl<'a> !UnwindSafe for InteractiveLoop<'a>
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 more