pub struct TaskTool { /* private fields */ }Expand description
The built-in task tool, which also holds the delegation state.
Construct one and include it in the parent’s tool list to enable delegation.
Each nested run gets a new TaskTool with depth + 1 and the child
profile’s own subagents (for recursion).
§Profile ownership
The parent’s tool list (other than this TaskTool) never flows into a
child. The child gets exactly: the profile’s declared tools, plus a fresh
child TaskTool when the profile declares its own subagents.
Implementations§
Source§impl TaskTool
impl TaskTool
Sourcepub fn new(
provider: Arc<dyn ModelProvider>,
parent_model: Model,
parent_config: RunConfig,
subagents: Vec<SubagentProfile>,
options: SubagentOptions,
cancel: CancellationToken,
event_sink: Option<Arc<dyn EventSink>>,
) -> Self
pub fn new( provider: Arc<dyn ModelProvider>, parent_model: Model, parent_config: RunConfig, subagents: Vec<SubagentProfile>, options: SubagentOptions, cancel: CancellationToken, event_sink: Option<Arc<dyn EventSink>>, ) -> Self
Construct the top-level task tool (depth 0).
Include the returned tool in the parent agent’s tool list to enable
delegation to any of subagents.
Trait Implementations§
Source§impl Tool for TaskTool
impl Tool for TaskTool
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
The static definition (name/schema/description).
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: InvokeContext,
input: Value,
) -> Pin<Box<dyn Future<Output = CoreResult<ToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: InvokeContext,
input: Value,
) -> Pin<Box<dyn Future<Output = CoreResult<ToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool with validated input.
Auto Trait Implementations§
impl !RefUnwindSafe for TaskTool
impl !UnwindSafe for TaskTool
impl Freeze for TaskTool
impl Send for TaskTool
impl Sync for TaskTool
impl Unpin for TaskTool
impl UnsafeUnpin for TaskTool
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