pub struct ParallelToolExecutor { /* private fields */ }Expand description
Execute all tool calls concurrently. All tools see the same frozen snapshot.
Two modes differ in how suspension decisions are replayed:
BatchApproval: wait for all suspended calls to have decisions before replayStreaming: replay each decision immediately as it arrives
Implementations§
Source§impl ParallelToolExecutor
impl ParallelToolExecutor
pub const fn batch_approval() -> Self
pub const fn streaming() -> Self
Sourcepub fn decision_replay_policy(&self) -> DecisionReplayPolicy
pub fn decision_replay_policy(&self) -> DecisionReplayPolicy
How the runtime should replay resolved suspend decisions.
Sourcepub fn requires_conflict_check(&self) -> bool
pub fn requires_conflict_check(&self) -> bool
Whether the runtime should enforce parallel patch conflict checks.
Trait Implementations§
Source§impl Clone for ParallelToolExecutor
impl Clone for ParallelToolExecutor
Source§fn clone(&self) -> ParallelToolExecutor
fn clone(&self) -> ParallelToolExecutor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParallelToolExecutor
impl Debug for ParallelToolExecutor
Source§impl Default for ParallelToolExecutor
impl Default for ParallelToolExecutor
Source§impl ToolExecutor for ParallelToolExecutor
impl ToolExecutor for ParallelToolExecutor
Source§fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tools: &'life1 HashMap<String, Arc<dyn Tool>>,
calls: &'life2 [ToolCall],
base_ctx: &'life3 ToolCallContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolExecutionResult>, ToolExecutorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tools: &'life1 HashMap<String, Arc<dyn Tool>>,
calls: &'life2 [ToolCall],
base_ctx: &'life3 ToolCallContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolExecutionResult>, ToolExecutorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute tool calls and return results.
Source§fn requires_incremental_state(&self) -> bool
fn requires_incremental_state(&self) -> bool
Whether the executor needs state refreshed between individual tool calls.
Sequential executors return true; parallel executors return false.
impl Copy for ParallelToolExecutor
Auto Trait Implementations§
impl Freeze for ParallelToolExecutor
impl RefUnwindSafe for ParallelToolExecutor
impl Send for ParallelToolExecutor
impl Sync for ParallelToolExecutor
impl Unpin for ParallelToolExecutor
impl UnsafeUnpin for ParallelToolExecutor
impl UnwindSafe for ParallelToolExecutor
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