pub enum ToolExecutionMode {
Parallel,
Serial,
}Expand description
How a tool’s invocations should be scheduled relative to other tools in the same batch of model-produced tool calls.
Tools that only read state (read_file, grep, glob, …) can run
in parallel safely and should use the default ToolExecutionMode::Parallel.
Tools that mutate shared state (apply_patch, exec_command,
write_stdin) should declare
ToolExecutionMode::Serial so the dispatcher runs them one-at-a-time
and avoids interleaving with each other.
The name is intentionally distinct from the turn-level ExecutionMode
(which selects the execution driver) so the two concepts don’t
collide in scope.
Variants§
Parallel
Safe to run concurrently with other parallel tools in the same batch.
Serial
Must run one-at-a-time relative to other serial tools in the batch.
Trait Implementations§
Source§impl Clone for ToolExecutionMode
impl Clone for ToolExecutionMode
Source§fn clone(&self) -> ToolExecutionMode
fn clone(&self) -> ToolExecutionMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ToolExecutionMode
impl Debug for ToolExecutionMode
Source§impl Default for ToolExecutionMode
impl Default for ToolExecutionMode
Source§fn default() -> ToolExecutionMode
fn default() -> ToolExecutionMode
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ToolExecutionMode
impl<'de> Deserialize<'de> for ToolExecutionMode
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolExecutionMode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolExecutionMode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ToolExecutionMode
impl PartialEq for ToolExecutionMode
Source§fn eq(&self, other: &ToolExecutionMode) -> bool
fn eq(&self, other: &ToolExecutionMode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolExecutionMode
impl Serialize for ToolExecutionMode
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for ToolExecutionMode
impl Eq for ToolExecutionMode
impl StructuralPartialEq for ToolExecutionMode
Auto Trait Implementations§
impl Freeze for ToolExecutionMode
impl RefUnwindSafe for ToolExecutionMode
impl Send for ToolExecutionMode
impl Sync for ToolExecutionMode
impl Unpin for ToolExecutionMode
impl UnsafeUnpin for ToolExecutionMode
impl UnwindSafe for ToolExecutionMode
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