pub struct SubagentFactory<P>where
P: LlmProvider + 'static,{ /* private fields */ }Expand description
Factory for creating subagents with shared resources.
The factory holds references to shared resources (provider, tool registries) and provides convenient methods to create subagents with common configurations.
Implementations§
Source§impl<P> SubagentFactory<P>where
P: LlmProvider + 'static,
impl<P> SubagentFactory<P>where
P: LlmProvider + 'static,
Sourcepub fn with_read_only_registry(self, registry: ToolRegistry<()>) -> Self
pub fn with_read_only_registry(self, registry: ToolRegistry<()>) -> Self
Sets the read-only tool registry (typically glob, grep, read tools).
This registry is used when creating read-only subagents.
Sourcepub fn with_full_registry(self, registry: ToolRegistry<()>) -> Self
pub fn with_full_registry(self, registry: ToolRegistry<()>) -> Self
Sets the full tool registry for full-access subagents.
Sourcepub fn create_read_only(&self, config: SubagentConfig) -> SubagentTool<P>
pub fn create_read_only(&self, config: SubagentConfig) -> SubagentTool<P>
Creates a read-only subagent with only read/search tools.
This is useful for exploration, research, and investigation tasks where the subagent should not modify any files.
§Panics
Panics if no read-only registry has been set.
Sourcepub fn create_full_access(&self, config: SubagentConfig) -> SubagentTool<P>
pub fn create_full_access(&self, config: SubagentConfig) -> SubagentTool<P>
Sourcepub fn create_with_registry(
&self,
config: SubagentConfig,
registry: Arc<ToolRegistry<()>>,
) -> SubagentTool<P>
pub fn create_with_registry( &self, config: SubagentConfig, registry: Arc<ToolRegistry<()>>, ) -> SubagentTool<P>
Creates a subagent with a custom tool registry.
Trait Implementations§
Source§impl<P> Clone for SubagentFactory<P>where
P: LlmProvider + 'static,
impl<P> Clone for SubagentFactory<P>where
P: LlmProvider + 'static,
Auto Trait Implementations§
impl<P> Freeze for SubagentFactory<P>
impl<P> !RefUnwindSafe for SubagentFactory<P>
impl<P> Send for SubagentFactory<P>
impl<P> Sync for SubagentFactory<P>
impl<P> Unpin for SubagentFactory<P>
impl<P> !UnwindSafe for SubagentFactory<P>
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