pub struct TeamRunner { /* private fields */ }Expand description
Sequential team execution engine.
Binds agent roles to async callables and runs them in sequence, passing each agent’s output as the next agent’s input.
Implementations§
Source§impl TeamRunner
impl TeamRunner
Sourcepub fn bind<F, Fut>(&mut self, role: impl Into<String>, agent: F)
pub fn bind<F, Fut>(&mut self, role: impl Into<String>, agent: F)
Bind an agent closure to a role name.
The closure receives the current input and returns the agent’s response.
Sourcepub fn set_sequence(&mut self, roles: &[&str])
pub fn set_sequence(&mut self, roles: &[&str])
Set the execution sequence of role names.
Sourcepub async fn run(&self, input: &str) -> Result<String>
pub async fn run(&self, input: &str) -> Result<String>
Execute the team pipeline sequentially.
Each agent in the sequence receives the previous agent’s output. Returns the last agent’s output as the final result.
§Errors
Returns an error if:
- A bound agent returns an error
- The sequence is empty
- A role in the sequence is not bound
max_iterationsis exceeded
Auto Trait Implementations§
impl Freeze for TeamRunner
impl !RefUnwindSafe for TeamRunner
impl Send for TeamRunner
impl Sync for TeamRunner
impl Unpin for TeamRunner
impl UnsafeUnpin for TeamRunner
impl !UnwindSafe for TeamRunner
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