pub struct AgentEngine { /* private fields */ }Expand description
Agent engine managing multiple agents
Implementations§
Source§impl AgentEngine
impl AgentEngine
pub fn new() -> Self
Sourcepub fn with_cost_tracker(cost_tracker: Arc<CostTracker>) -> Self
pub fn with_cost_tracker(cost_tracker: Arc<CostTracker>) -> Self
Create an engine with cost tracking enabled
Sourcepub fn set_cost_tracker(&mut self, cost_tracker: Arc<CostTracker>)
pub fn set_cost_tracker(&mut self, cost_tracker: Arc<CostTracker>)
Set or replace the cost tracker
Sourcepub fn cost_tracker(&self) -> Option<&Arc<CostTracker>>
pub fn cost_tracker(&self) -> Option<&Arc<CostTracker>>
Get the cost tracker (if configured)
Sourcepub async fn spawn_agent(
&self,
config: AgentConfig,
tool_registry: Arc<ToolRegistry>,
backend: Arc<dyn LLMBackend>,
) -> Result<AgentId, AgentError>
pub async fn spawn_agent( &self, config: AgentConfig, tool_registry: Arc<ToolRegistry>, backend: Arc<dyn LLMBackend>, ) -> Result<AgentId, AgentError>
Spawn a new agent with tracing instrumentation
Sourcepub fn send_message(&self, message: Message) -> Result<(), AgentError>
pub fn send_message(&self, message: Message) -> Result<(), AgentError>
Send a message to an agent
Sourcepub fn agent_count(&self) -> usize
pub fn agent_count(&self) -> usize
Get agent count
Sourcepub fn metrics(&self) -> EngineMetricsSnapshot
pub fn metrics(&self) -> EngineMetricsSnapshot
Get metrics
Source§impl AgentEngine
impl AgentEngine
Sourcepub async fn stop_agent(&self, id: &AgentId) -> Result<(), AgentError>
pub async fn stop_agent(&self, id: &AgentId) -> Result<(), AgentError>
Stop an agent
Trait Implementations§
Source§impl Clone for AgentEngine
impl Clone for AgentEngine
Source§fn clone(&self) -> AgentEngine
fn clone(&self) -> AgentEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for AgentEngine
impl Default for AgentEngine
Auto Trait Implementations§
impl Freeze for AgentEngine
impl !RefUnwindSafe for AgentEngine
impl Send for AgentEngine
impl Sync for AgentEngine
impl Unpin for AgentEngine
impl UnsafeUnpin for AgentEngine
impl !UnwindSafe for AgentEngine
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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