pub struct CtoAgent {
pub state: CtoState,
/* private fields */
}Fields§
§state: CtoStateImplementations§
Source§impl CtoAgent
impl CtoAgent
pub fn new(llm: LlmClient) -> Self
pub fn set_event_tx(&mut self, tx: Sender<StreamEvent>)
pub fn set_model_config(&mut self, config: ModelConfig)
pub fn set_tui_event_tx(&mut self, tx: UnboundedSender<TuiEvent>)
Sourcepub async fn chat(&mut self, user_message: &str) -> Result<String>
pub async fn chat(&mut self, user_message: &str) -> Result<String>
Send a message and get a response with up to 5 tool iterations.
pub fn history_len(&self) -> usize
pub fn clear_history(&mut self)
pub fn compact_history(&mut self)
pub fn save_history(&self) -> Result<()>
pub fn load_history(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CtoAgent
impl !RefUnwindSafe for CtoAgent
impl Send for CtoAgent
impl Sync for CtoAgent
impl Unpin for CtoAgent
impl UnsafeUnpin for CtoAgent
impl !UnwindSafe for CtoAgent
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