pub struct AgentTeam { /* private fields */ }Expand description
Multi-agent team coordinator.
Implementations§
Source§impl AgentTeam
impl AgentTeam
Sourcepub fn new(name: &str, config: TeamConfig) -> Self
pub fn new(name: &str, config: TeamConfig) -> Self
Create a new team.
Sourcepub fn add_member(&mut self, id: &str, role: TeamRole)
pub fn add_member(&mut self, id: &str, role: TeamRole)
Add a member to the team.
Sourcepub fn remove_member(&mut self, id: &str) -> bool
pub fn remove_member(&mut self, id: &str) -> bool
Remove a member from the team.
Sourcepub fn task_board(&self) -> &TeamTaskBoard
pub fn task_board(&self) -> &TeamTaskBoard
Get a reference to the shared task board.
Sourcepub fn task_board_arc(&self) -> Arc<TeamTaskBoard>
pub fn task_board_arc(&self) -> Arc<TeamTaskBoard>
Get a cloneable Arc to the task board.
Sourcepub async fn send_message(
&self,
from: &str,
to: &str,
content: &str,
task_id: Option<&str>,
) -> bool
pub async fn send_message( &self, from: &str, to: &str, content: &str, task_id: Option<&str>, ) -> bool
Send a message to a team member.
Sourcepub fn take_receiver(
&mut self,
member_id: &str,
) -> Option<Receiver<TeamMessage>>
pub fn take_receiver( &mut self, member_id: &str, ) -> Option<Receiver<TeamMessage>>
Take the message receiver for a member (can only be called once per member).
Sourcepub async fn broadcast(&self, from: &str, content: &str, task_id: Option<&str>)
pub async fn broadcast(&self, from: &str, content: &str, task_id: Option<&str>)
Broadcast a message to all members except the sender.
Sourcepub fn members(&self) -> Vec<&TeamMember>
pub fn members(&self) -> Vec<&TeamMember>
Get all members.
Sourcepub fn members_by_role(&self, role: TeamRole) -> Vec<&TeamMember>
pub fn members_by_role(&self, role: TeamRole) -> Vec<&TeamMember>
Get members by role.
Sourcepub fn member_count(&self) -> usize
pub fn member_count(&self) -> usize
Number of members.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentTeam
impl RefUnwindSafe for AgentTeam
impl Send for AgentTeam
impl Sync for AgentTeam
impl Unpin for AgentTeam
impl UnsafeUnpin for AgentTeam
impl UnwindSafe for AgentTeam
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