pub struct Orchestrator { /* private fields */ }Implementations§
Source§impl Orchestrator
impl Orchestrator
pub fn new( provider: Arc<dyn Provider>, tools: ToolRegistry, middlewares: Vec<Arc<dyn Middleware>>, config: OrchestratorConfig, ) -> Self
pub fn with_turn_middlewares( provider: Arc<dyn Provider>, tools: ToolRegistry, turn_middlewares: Vec<Arc<dyn TurnMiddleware>>, config: OrchestratorConfig, ) -> Self
Sourcepub fn with_lifecycle_hooks(self, hooks: Vec<Arc<dyn LifecycleHook>>) -> Self
pub fn with_lifecycle_hooks(self, hooks: Vec<Arc<dyn LifecycleHook>>) -> Self
Set lifecycle hooks for this orchestrator.
Lifecycle hooks are fire-and-forget observers that cannot block or transform the agent loop. They are called at key points (session start/end, pre/post tool call, pre/post LLM call) for telemetry, billing, and notification use-cases.
Sourcepub fn add_lifecycle_hook(&mut self, hook: Arc<dyn LifecycleHook>)
pub fn add_lifecycle_hook(&mut self, hook: Arc<dyn LifecycleHook>)
Add a single lifecycle hook to this orchestrator.
Sourcepub fn swap_provider(
&self,
new_provider: Arc<dyn Provider>,
) -> Result<String, CoreError>
pub fn swap_provider( &self, new_provider: Arc<dyn Provider>, ) -> Result<String, CoreError>
Swap the active provider at runtime. Returns the name of the new provider.
Sourcepub fn provider_name(&self) -> Result<String, CoreError>
pub fn provider_name(&self) -> Result<String, CoreError>
Get the current provider name.
pub fn run( &self, input: RunInput, event_handler: impl FnMut(AgentEvent), ) -> RunOutput
Sourcepub fn run_cancellable(
&self,
input: RunInput,
cancel: Option<&Arc<AtomicBool>>,
event_handler: impl FnMut(AgentEvent),
) -> RunOutput
pub fn run_cancellable( &self, input: RunInput, cancel: Option<&Arc<AtomicBool>>, event_handler: impl FnMut(AgentEvent), ) -> RunOutput
Run the orchestrator loop with an optional cancellation flag.
If cancel is provided and set to true during execution,
the loop will stop at the next iteration boundary.
Auto Trait Implementations§
impl Freeze for Orchestrator
impl !RefUnwindSafe for Orchestrator
impl Send for Orchestrator
impl Sync for Orchestrator
impl Unpin for Orchestrator
impl UnsafeUnpin for Orchestrator
impl !UnwindSafe for Orchestrator
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