pub struct SubagentConfig {
pub subagents: Vec<Subagent>,
pub delegation_strategy: DelegationStrategy,
}Expand description
Configuration for multiple subagents
§Example
use claude_agent_sdk::subagents::{SubagentConfig, Subagent, DelegationStrategy};
let config = SubagentConfig {
subagents: vec![
Subagent {
name: "reviewer".to_string(),
description: "Code reviewer".to_string(),
instructions: "Review code".to_string(),
allowed_tools: vec!["Read".to_string()],
max_turns: Some(5),
model: None,
},
],
delegation_strategy: DelegationStrategy::Auto,
};Fields§
§subagents: Vec<Subagent>List of available subagents
delegation_strategy: DelegationStrategyStrategy for delegating to subagents
Implementations§
Source§impl SubagentConfig
impl SubagentConfig
Sourcepub fn new(delegation_strategy: DelegationStrategy) -> Self
pub fn new(delegation_strategy: DelegationStrategy) -> Self
Sourcepub fn add_subagent(&mut self, subagent: Subagent)
pub fn add_subagent(&mut self, subagent: Subagent)
Add a subagent to the configuration
§Arguments
subagent- The subagent to add
§Example
let subagent = Subagent {
name: "agent".to_string(),
description: "Description".to_string(),
instructions: "Instructions".to_string(),
allowed_tools: vec![],
max_turns: None,
model: None,
};
config.add_subagent(subagent);Sourcepub fn get_subagent(&self, name: &str) -> Option<&Subagent>
pub fn get_subagent(&self, name: &str) -> Option<&Subagent>
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 moreSource§impl Debug for SubagentConfig
impl Debug for SubagentConfig
Source§impl<'de> Deserialize<'de> for SubagentConfig
impl<'de> Deserialize<'de> for SubagentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SubagentConfig
impl RefUnwindSafe for SubagentConfig
impl Send for SubagentConfig
impl Sync for SubagentConfig
impl Unpin 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