pub struct SubAgentConfig {
pub system_prompt: SystemPrompt,
pub tools: Vec<String>,
pub model: Option<String>,
pub max_depth: usize,
pub max_turns: Option<usize>,
}Expand description
Configuration for a sub-agent.
Fields§
§system_prompt: SystemPromptSystem prompt for the sub-agent’s loop.
tools: Vec<String>Tool names to include (the sub-agent only sees these tools).
model: Option<String>Optional model override (currently informational; the provider decides).
max_depth: usizeMaximum nesting depth (default 1). Prevents infinite recursion.
max_turns: Option<usize>Maximum turns for the sub-agent’s loop.
Implementations§
Source§impl SubAgentConfig
impl SubAgentConfig
Sourcepub fn new(system_prompt: SystemPrompt) -> Self
pub fn new(system_prompt: SystemPrompt) -> Self
Create a new sub-agent configuration.
Sourcepub fn with_tools(self, tools: Vec<String>) -> Self
pub fn with_tools(self, tools: Vec<String>) -> Self
Set the allowed tools for this sub-agent.
Sourcepub fn with_max_depth(self, max_depth: usize) -> Self
pub fn with_max_depth(self, max_depth: usize) -> Self
Set the maximum nesting depth.
Sourcepub fn with_max_turns(self, max_turns: usize) -> Self
pub fn with_max_turns(self, max_turns: usize) -> Self
Set the maximum turns for the sub-agent’s loop.
Trait Implementations§
Source§impl Clone for SubAgentConfig
impl Clone for SubAgentConfig
Source§fn clone(&self) -> SubAgentConfig
fn clone(&self) -> SubAgentConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SubAgentConfig
impl RefUnwindSafe for SubAgentConfig
impl Send for SubAgentConfig
impl Sync for SubAgentConfig
impl Unpin for SubAgentConfig
impl UnsafeUnpin for SubAgentConfig
impl UnwindSafe for SubAgentConfig
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