pub struct AgentSystem { /* private fields */ }Expand description
Orchestrates multiple agents working together
Implementations§
Source§impl AgentSystem
impl AgentSystem
Sourcepub fn with_config(config: AgentSystemConfig) -> Self
pub fn with_config(config: AgentSystemConfig) -> Self
Create a new agent system with custom configuration
Sourcepub async fn register_agent(
&self,
agent: Arc<dyn Agent>,
) -> Result<(), AgentError>
pub async fn register_agent( &self, agent: Arc<dyn Agent>, ) -> Result<(), AgentError>
Register a new agent with the system
Sourcepub async fn unregister_agent(
&self,
agent_id: &AgentId,
) -> Result<(), AgentError>
pub async fn unregister_agent( &self, agent_id: &AgentId, ) -> Result<(), AgentError>
Unregister an agent from the system
Sourcepub async fn process_with_agent(
&self,
agent_id: &AgentId,
observation: Observation,
) -> Result<Option<Action>, AgentError>
pub async fn process_with_agent( &self, agent_id: &AgentId, observation: Observation, ) -> Result<Option<Action>, AgentError>
Process an observation with a specific agent
Sourcepub async fn broadcast(
&self,
observation: Observation,
) -> HashMap<AgentId, Result<Option<Action>, AgentError>>
pub async fn broadcast( &self, observation: Observation, ) -> HashMap<AgentId, Result<Option<Action>, AgentError>>
Broadcast an observation to all agents and collect their actions
Sourcepub fn config(&self) -> Result<AgentSystemConfig, AgentError>
pub fn config(&self) -> Result<AgentSystemConfig, AgentError>
Get the configuration
Sourcepub fn update_config(&self, config: AgentSystemConfig) -> Result<(), AgentError>
pub fn update_config(&self, config: AgentSystemConfig) -> Result<(), AgentError>
Update the configuration
Sourcepub fn metrics(&self) -> Result<AgentSystemMetrics, AgentError>
pub fn metrics(&self) -> Result<AgentSystemMetrics, AgentError>
Get the system metrics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AgentSystem
impl RefUnwindSafe for AgentSystem
impl Send for AgentSystem
impl Sync for AgentSystem
impl Unpin for AgentSystem
impl UnwindSafe for AgentSystem
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