pub struct StreamingToolExecutor { /* private fields */ }Expand description
Implementations§
Source§impl StreamingToolExecutor
impl StreamingToolExecutor
Sourcepub fn submit(
&mut self,
item: ToolCallItem,
tool_map: &HashMap<String, Arc<dyn Tool>>,
timeout: Option<Duration>,
ctx: &ToolContext,
)
pub fn submit( &mut self, item: ToolCallItem, tool_map: &HashMap<String, Arc<dyn Tool>>, timeout: Option<Duration>, ctx: &ToolContext, )
Submit a tool for immediate execution.
The tool is looked up in tool_map and spawned as a background task.
If the tool is not found, the task will resolve with an error result.
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Returns true if any tools have been submitted.
Sourcepub async fn collect(self) -> (Vec<ToolCallItem>, Vec<ToolResult>)
pub async fn collect(self) -> (Vec<ToolCallItem>, Vec<ToolResult>)
Await all submitted tasks and return (items, results) in submission order.
Items and results are returned as separate vectors so callers can use
the existing execute_and_record_tool_calls pipeline unchanged.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamingToolExecutor
impl RefUnwindSafe for StreamingToolExecutor
impl Send for StreamingToolExecutor
impl Sync for StreamingToolExecutor
impl Unpin for StreamingToolExecutor
impl UnsafeUnpin for StreamingToolExecutor
impl UnwindSafe for StreamingToolExecutor
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