pub struct BatchExecutor<P: LlmProvider + 'static> { /* private fields */ }Expand description
Executes multiple tasks through an agent with controlled concurrency.
Unlike ParallelAgent which runs different agents on the same task,
BatchExecutor runs the SAME agent on different tasks with a concurrency limit.
Implementations§
Source§impl<P: LlmProvider + 'static> BatchExecutor<P>
impl<P: LlmProvider + 'static> BatchExecutor<P>
Sourcepub fn builder(agent: AgentRunner<P>) -> BatchExecutorBuilder<P>
pub fn builder(agent: AgentRunner<P>) -> BatchExecutorBuilder<P>
Create a new builder for BatchExecutor.
Sourcepub async fn execute(&self, tasks: Vec<String>) -> Vec<BatchResult>
pub async fn execute(&self, tasks: Vec<String>) -> Vec<BatchResult>
Execute all tasks with controlled concurrency. Returns results for ALL tasks (successes and failures). Results are sorted by input index.
Sourcepub async fn execute_ref(&self, tasks: &[&str]) -> Vec<BatchResult>
pub async fn execute_ref(&self, tasks: &[&str]) -> Vec<BatchResult>
Convenience: execute with string slice references.
Sourcepub fn aggregate_usage(results: &[BatchResult]) -> TokenUsage
pub fn aggregate_usage(results: &[BatchResult]) -> TokenUsage
Returns aggregate token usage across all successful executions.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for BatchExecutor<P>
impl<P> !RefUnwindSafe for BatchExecutor<P>
impl<P> Send for BatchExecutor<P>
impl<P> Sync for BatchExecutor<P>
impl<P> Unpin for BatchExecutor<P>
impl<P> UnsafeUnpin for BatchExecutor<P>
impl<P> !UnwindSafe for BatchExecutor<P>
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