pub struct AgentPool { /* private fields */ }Expand description
An agent pool manages multiple agents with different roles.
Implementations§
Source§impl AgentPool
impl AgentPool
pub fn new(provider: Arc<dyn LlmProvider>, config: Config) -> Self
pub fn memory(&self) -> &SharedMemory
pub fn bus(&self) -> &MessageBus
pub fn add_role(&mut self, role: AgentRole)
pub fn get_role(&self, name: &str) -> Option<&AgentRole>
pub fn role_names(&self) -> Vec<&str>
pub fn role_count(&self) -> usize
Sourcepub fn remove_role(&mut self, name: &str) -> bool
pub fn remove_role(&mut self, name: &str) -> bool
Remove a role from the pool. Returns true if the role existed.
pub async fn run_with_role( &self, role_name: &str, goal: &str, ) -> Result<TurnOutcome, Error>
Sourcepub async fn send_task(&self, from: &str, to: &str, content: &str)
pub async fn send_task(&self, from: &str, to: &str, content: &str)
Send a task message from one agent role to another.
Sourcepub async fn send_result(&self, from: &str, to: &str, content: &str)
pub async fn send_result(&self, from: &str, to: &str, content: &str)
Send a result message from one agent role to another.
Auto Trait Implementations§
impl !RefUnwindSafe for AgentPool
impl !UnwindSafe for AgentPool
impl Freeze for AgentPool
impl Send for AgentPool
impl Sync for AgentPool
impl Unpin for AgentPool
impl UnsafeUnpin for AgentPool
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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