pub struct DelegateTool { /* private fields */ }Implementations§
Source§impl DelegateTool
impl DelegateTool
pub fn new( providers: Arc<dyn ChildProviders>, tools: Arc<ToolRegistry>, store: SessionStore, settings: DelegateSettings, ) -> Self
Sourcepub fn with_hooks(self, hooks: LoopHooks) -> Self
pub fn with_hooks(self, hooks: LoopHooks) -> Self
Give every child these loop hooks. Without this a subagent would be the one place a tool result reaches a model unfiltered.
Sourcepub fn with_turn_results(self, turn_results: Arc<TurnResults>) -> Self
pub fn with_turn_results(self, turn_results: Arc<TurnResults>) -> Self
Share the child registry’s per-turn tool-result buffer with the child Agent.
Trait Implementations§
Source§impl Tool for DelegateTool
impl Tool for DelegateTool
Source§fn describe_call(&self, args: &Value) -> String
fn describe_call(&self, args: &Value) -> String
The route, the prompt’s first line and the budget: enough to decide on. Written to survive arguments of the wrong type, because it runs before they are checked.
fn name(&self) -> &str
fn description(&self) -> &str
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema for the arguments object.
fn call<'life0, 'async_trait>(
&'life0 self,
_args: Value,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn call_scoped<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: Value,
scope: &'life1 CallScope<'life2>,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn call_scoped<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
args: Value,
scope: &'life1 CallScope<'life2>,
) -> Pin<Box<dyn Future<Output = Result<String, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
call for a tool that needs to know which run it is part of: who may be
asked, which session it belongs to, how many children the run has started. Almost no
tool does, so the default ignores the scope.Source§fn needs_approval(&self, _args: &Value) -> bool
fn needs_approval(&self, _args: &Value) -> bool
Whether this particular call is put to the
Approver under Policy::Ask. Every call
is, unless a tool says otherwise: the answer is per call because one tool can have a
side-effect-free form (the script tool’s listing) beside a form that runs code. deny
and disabled are not affected — they never run anything.Auto Trait Implementations§
impl !RefUnwindSafe for DelegateTool
impl !UnwindSafe for DelegateTool
impl Forget for DelegateTool
impl Freeze for DelegateToolwhere
*const ArcInner<dyn ChildProviders> is !null: Freeze,
PhantomData<ArcInner<dyn ChildProviders>>: Freeze,
*const ArcInner<ToolRegistry> is !null: Freeze,
PhantomData<ArcInner<ToolRegistry>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<Mutex<Option<Db>>> is !null: Freeze,
PhantomData<ArcInner<Mutex<Option<Db>>>>: Freeze,
PhantomData<Arc<dyn LoopHook>>: Freeze,
*const ArcInner<TurnResults> is !null: Freeze,
PhantomData<ArcInner<TurnResults>>: Freeze,
impl Move for DelegateTool
impl Send for DelegateTool
impl Sync for DelegateTool
impl Unpin for DelegateTool
impl UnsafeUnpin for DelegateToolwhere
*const ArcInner<dyn ChildProviders> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ChildProviders>>: UnsafeUnpin,
*const ArcInner<ToolRegistry> is !null: UnsafeUnpin,
PhantomData<ArcInner<ToolRegistry>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<Mutex<Option<Db>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<Db>>>>: UnsafeUnpin,
PhantomData<Arc<dyn LoopHook>>: UnsafeUnpin,
*const ArcInner<TurnResults> is !null: UnsafeUnpin,
PhantomData<ArcInner<TurnResults>>: UnsafeUnpin,
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