pub struct DeepAgentConfig {
pub instructions: String,
pub planner: Arc<dyn PlannerHandle>,
pub tools: Vec<ToolBox>,
pub subagent_configs: Vec<SubAgentConfig>,
pub summarization: Option<SummarizationConfig>,
pub tool_interrupts: HashMap<String, HitlPolicy>,
pub builtin_tools: Option<HashSet<String>>,
pub auto_general_purpose: bool,
pub enable_prompt_caching: bool,
pub checkpointer: Option<Arc<dyn Checkpointer>>,
}
Expand description
Configuration for building a deep agent instance.
This is the internal configuration used by the builder and runtime.
Fields§
§instructions: String
§planner: Arc<dyn PlannerHandle>
§tools: Vec<ToolBox>
§subagent_configs: Vec<SubAgentConfig>
§summarization: Option<SummarizationConfig>
§tool_interrupts: HashMap<String, HitlPolicy>
§builtin_tools: Option<HashSet<String>>
§auto_general_purpose: bool
§enable_prompt_caching: bool
§checkpointer: Option<Arc<dyn Checkpointer>>
Implementations§
Source§impl DeepAgentConfig
impl DeepAgentConfig
pub fn new( instructions: impl Into<String>, planner: Arc<dyn PlannerHandle>, ) -> Self
pub fn with_tool(self, tool: ToolBox) -> Self
Sourcepub fn with_subagent_config(self, config: SubAgentConfig) -> Self
pub fn with_subagent_config(self, config: SubAgentConfig) -> Self
Add a sub-agent configuration
Sourcepub fn with_subagent_configs<I>(self, configs: I) -> Selfwhere
I: IntoIterator<Item = SubAgentConfig>,
pub fn with_subagent_configs<I>(self, configs: I) -> Selfwhere
I: IntoIterator<Item = SubAgentConfig>,
Add multiple sub-agent configurations
pub fn with_summarization(self, config: SummarizationConfig) -> Self
pub fn with_tool_interrupt( self, tool_name: impl Into<String>, policy: HitlPolicy, ) -> Self
Sourcepub fn with_builtin_tools<I, S>(self, names: I) -> Self
pub fn with_builtin_tools<I, S>(self, names: I) -> Self
Limit which built-in tools are exposed. When omitted, all built-ins are available.
Built-ins: write_todos, ls, read_file, write_file, edit_file.
The task
tool (for subagents) is always available when subagents are registered.
Sourcepub fn with_auto_general_purpose(self, enabled: bool) -> Self
pub fn with_auto_general_purpose(self, enabled: bool) -> Self
Enable or disable automatic registration of a “general-purpose” subagent. Enabled by default; set to false to opt out.
Sourcepub fn with_prompt_caching(self, enabled: bool) -> Self
pub fn with_prompt_caching(self, enabled: bool) -> Self
Enable or disable Anthropic prompt caching middleware. Disabled by default; set to true to enable caching for better performance.
Sourcepub fn with_checkpointer(self, checkpointer: Arc<dyn Checkpointer>) -> Self
pub fn with_checkpointer(self, checkpointer: Arc<dyn Checkpointer>) -> Self
Set the checkpointer for persisting agent state between runs.
Auto Trait Implementations§
impl Freeze for DeepAgentConfig
impl !RefUnwindSafe for DeepAgentConfig
impl Send for DeepAgentConfig
impl Sync for DeepAgentConfig
impl Unpin for DeepAgentConfig
impl !UnwindSafe for DeepAgentConfig
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