pub struct SequentialExecutor { /* private fields */ }Expand description
Executes tools sequentially one by one by using Tool::call
§How it works
- Iterates through tool calls in order
- Executes each call one at a time using
Tool::call - Waits for each call to complete before starting the next
§Example
Given tool calls:
[
ToolCall { id: "1", function: { name: "weather", ... } },
ToolCall { id: "2", function: { name: "search", ... } },
ToolCall { id: "3", function: { name: "weather", ... } },
]The executor will:
- Execute
weather_tool.call(call1)and wait for completion - Execute
search_tool.call(call2)and wait for completion - Execute
weather_tool.call(call3)and wait for completion - Return results in order:
[result1, result2, result3]
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SequentialExecutor
impl !RefUnwindSafe for SequentialExecutor
impl !Send for SequentialExecutor
impl Sync for SequentialExecutor
impl Unpin for SequentialExecutor
impl !UnwindSafe for SequentialExecutor
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