strands/tools/executors/mod.rs
1//! Tool executors: how the tool calls of one model turn run.
2//!
3//! [`ConcurrentToolExecutor`] (the default) runs every call of a batch on its own task;
4//! [`SequentialToolExecutor`] runs them one after another. Choose one with
5//! [`ToolExecutorStrategy`].
6//!
7//! The executors only schedule. The agent loop supplies the per-tool pipeline (the before-call
8//! hook, the tool stream, the after-call hook and retries) as a function that reports the call's
9//! events through a sink and returns its [`ToolOutcome`](crate::tools::ToolOutcome).
10
11mod concurrent;
12mod executor;
13mod sequential;
14
15pub use concurrent::ConcurrentToolExecutor;
16pub use executor::ToolExecutorStrategy;
17pub(crate) use executor::{
18 BatchOutcome, CallOutcome, EventSink, ExecutorItem, ToolBatch, ToolPipelineFn, failure_result, panic_result,
19};
20pub use sequential::SequentialToolExecutor;
21
22/// Tests executor scheduling and cancellation with stub pipelines.
23#[cfg(test)]
24mod tests;