pub struct App { /* private fields */ }Expand description
Application state and entry point.
Holds an Oxi engine (composition root) and a single Agent built
from it. The legacy App::new(settings) constructor is gone;
use App::from_oxi with a wired Oxi from
build_oxi_engine.
Implementations§
Source§impl App
impl App
Sourcepub async fn from_oxi(oxi: Oxi, settings: Settings) -> Result<Self>
pub async fn from_oxi(oxi: Oxi, settings: Settings) -> Result<Self>
Build an App from a wired Oxi engine and a settings object.
The Oxi should be created via build_oxi_engine (or
services::build_oxi) so that all 11 ports are wired. The
settings hold the user’s runtime configuration (model, thinking
level, etc.).
Sourcepub fn set_wasm_ext(&mut self, ext: Option<Arc<WasmExtensionManager>>)
pub fn set_wasm_ext(&mut self, ext: Option<Arc<WasmExtensionManager>>)
Set the WASM extension manager
Sourcepub fn wasm_ext(&self) -> Option<&Arc<WasmExtensionManager>>
pub fn wasm_ext(&self) -> Option<&Arc<WasmExtensionManager>>
Get the WASM extension manager
Sourcepub fn agent_tools(&self) -> Arc<ToolRegistry> ⓘ
pub fn agent_tools(&self) -> Arc<ToolRegistry> ⓘ
Get the tool registry (for registering extension tools)
Sourcepub fn questionnaire_bridge(&self) -> Option<&Arc<QuestionnaireBridge>>
pub fn questionnaire_bridge(&self) -> Option<&Arc<QuestionnaireBridge>>
Get the questionnaire bridge, if initialized.
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 switch_model(&self, model_id: &str) -> Result<()>
pub async fn switch_model(&self, model_id: &str) -> Result<()>
Switch the model used for future LLM calls.
Auto Trait Implementations§
impl !Freeze for App
impl !RefUnwindSafe for App
impl !UnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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,
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: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
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>
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>
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