pub struct SubAgent { /* private fields */ }Expand description
The sub-agent tool.
Constructed with:
workspace: path for sandboxed toolsprovider: the LLM provider (shared Arc from parent)all_tools: the full tool registry from which the sub-agent can drawmax_depth: absolute depth limit (env-configured)current_depth: how deep we already are (passed from parent)permission_hook: optional permission hook inherited from the parent agent
Implementations§
Source§impl SubAgent
impl SubAgent
pub fn new( workspace: impl Into<PathBuf>, provider: Arc<dyn LlmProvider>, all_tools: ToolRegistry, max_depth: usize, current_depth: usize, permission_hook: Option<PermissionHook>, ) -> Self
Trait Implementations§
Source§impl Tool for SubAgent
impl Tool for SubAgent
fn spec(&self) -> ToolSpec
fn execute<'life0, 'async_trait>(
&'life0 self,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn is_readonly(&self) -> bool
fn is_readonly(&self) -> bool
Whether this tool only reads data without side effects.
Default: false (conservative). Override to true for read-only tools.
Auto Trait Implementations§
impl Freeze for SubAgent
impl !RefUnwindSafe for SubAgent
impl Send for SubAgent
impl Sync for SubAgent
impl Unpin for SubAgent
impl UnsafeUnpin for SubAgent
impl !UnwindSafe for SubAgent
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