pub struct Coordinator { /* private fields */ }Expand description
Orchestrates multiple agent instances, routing messages and collecting results.
Implementations§
Source§impl Coordinator
impl Coordinator
Sourcepub async fn spawn_agent(
&self,
agent_type: &str,
name: Option<String>,
) -> Result<String, String>
pub async fn spawn_agent( &self, agent_type: &str, name: Option<String>, ) -> Result<String, String>
Spawn an agent instance.
Returns the instance ID. The agent is created in Pending status
and must be started with run_agent().
Sourcepub async fn run_agent(
&self,
agent_id: &str,
prompt: &str,
) -> Result<AgentResult, String>
pub async fn run_agent( &self, agent_id: &str, prompt: &str, ) -> Result<AgentResult, String>
Run an agent with the given prompt.
Executes the agent as a subprocess and returns the result. The agent’s status is updated throughout the lifecycle.
Sourcepub async fn run_team(&self, tasks: Vec<(&str, &str, &str)>) -> Vec<AgentResult>
pub async fn run_team(&self, tasks: Vec<(&str, &str, &str)>) -> Vec<AgentResult>
Run multiple agents in parallel and collect all results.
Sourcepub async fn send_message(
&self,
to: &str,
from: &str,
content: &str,
) -> Result<(), String>
pub async fn send_message( &self, to: &str, from: &str, content: &str, ) -> Result<(), String>
Send a message to a running agent.
Sourcepub async fn list_agents(&self) -> Vec<AgentInstance>
pub async fn list_agents(&self) -> Vec<AgentInstance>
List all agent instances.
Sourcepub fn registry(&self) -> &AgentRegistry
pub fn registry(&self) -> &AgentRegistry
Get agent registry.
Sourcepub async fn create_team(
&self,
name: &str,
agent_types: &[&str],
) -> Result<String, String>
pub async fn create_team( &self, name: &str, agent_types: &[&str], ) -> Result<String, String>
Create a new team.
Sourcepub async fn list_teams(&self) -> Vec<Team>
pub async fn list_teams(&self) -> Vec<Team>
List active teams.
Auto Trait Implementations§
impl Freeze for Coordinator
impl !RefUnwindSafe for Coordinator
impl Send for Coordinator
impl Sync for Coordinator
impl Unpin for Coordinator
impl UnsafeUnpin for Coordinator
impl !UnwindSafe for Coordinator
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