pub struct App { /* private fields */ }Expand description
Application state and entry point
Implementations§
Source§impl App
impl App
Sourcepub fn agent_tools(&self) -> Arc<ToolRegistry> ⓘ
pub fn agent_tools(&self) -> Arc<ToolRegistry> ⓘ
Get the tool registry (for registering extension tools)
Sourcepub fn skills(&self) -> RwLockReadGuard<'_, SkillManager>
pub fn skills(&self) -> RwLockReadGuard<'_, SkillManager>
Get a reference to the skill manager
Sourcepub fn activate_skill(&self, name: &str) -> Result<(), String>
pub fn activate_skill(&self, name: &str) -> Result<(), String>
Activate a skill by name. Returns an error string if not found.
Sourcepub fn deactivate_skill(&self, name: &str)
pub fn deactivate_skill(&self, name: &str)
Deactivate a skill by name.
Sourcepub fn active_skills(&self) -> Vec<String>
pub fn active_skills(&self) -> Vec<String>
List currently active skill names
Sourcepub fn agent_state(&self) -> AgentState
pub fn agent_state(&self) -> AgentState
Get a clone of the current state
Sourcepub async fn run_prompt(&self, prompt: String) -> Result<String>
pub async fn run_prompt(&self, prompt: String) -> Result<String>
Run a single prompt and return the response
Sourcepub async fn run_prompt_with_events<F>(
&self,
prompt: String,
on_event: F,
) -> Result<String>
pub async fn run_prompt_with_events<F>( &self, prompt: String, on_event: F, ) -> Result<String>
Run a prompt with event callback
Sourcepub async fn run_interactive(&self) -> Result<InteractiveLoop<'_>>
pub async fn run_interactive(&self) -> Result<InteractiveLoop<'_>>
Run in interactive mode, returning an event stream
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.
See Agent::switch_model for details.
Auto Trait Implementations§
impl !Freeze for App
impl !RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
impl !UnwindSafe for App
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