pub struct AgentTool { /* private fields */ }Expand description
A tool that spawns subagents to handle complex, multi-step tasks autonomously.
Implements the Tool trait from tools/types.rs and mirrors the executor
logic previously implemented as inline closures in agent.rs.
Implementations§
Source§impl AgentTool
impl AgentTool
Sourcepub fn new(config: AgentToolConfig) -> Self
pub fn new(config: AgentToolConfig) -> Self
Create a new AgentTool with the given configuration.
Sourcepub fn config(&self) -> &AgentToolConfig
pub fn config(&self) -> &AgentToolConfig
Get a reference to the tool’s configuration.
Trait Implementations§
Source§impl Tool for AgentTool
impl Tool for AgentTool
fn name(&self) -> &str
fn description(&self) -> &str
fn input_schema(&self) -> ToolInputSchema
async fn execute( &self, input: Value, _ctx: &ToolContext, ) -> Result<ToolResult, AgentError>
Source§fn backfill_observable_input(&self, _input: &mut Value)
fn backfill_observable_input(&self, _input: &mut Value)
Backfill observable input before observers see it (SDK stream, transcript, hooks).
Mutates in place to add legacy/derived fields. Must be idempotent.
The original API-bound input is never mutated (preserves prompt cache).
Auto Trait Implementations§
impl Freeze for AgentTool
impl !RefUnwindSafe for AgentTool
impl Send for AgentTool
impl Sync for AgentTool
impl Unpin for AgentTool
impl UnsafeUnpin for AgentTool
impl !UnwindSafe for AgentTool
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