pub struct DeepAgentConfig {Show 13 fields
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>>,
pub event_dispatcher: Option<Arc<EventDispatcher>>,
pub enable_pii_sanitization: bool,
pub token_tracking_config: Option<TokenTrackingConfig>,
}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>>§event_dispatcher: Option<Arc<EventDispatcher>>§enable_pii_sanitization: bool§token_tracking_config: Option<TokenTrackingConfig>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.
Sourcepub fn with_event_broadcaster(
self,
broadcaster: Arc<dyn EventBroadcaster>,
) -> Self
pub fn with_event_broadcaster( self, broadcaster: Arc<dyn EventBroadcaster>, ) -> Self
Add an event broadcaster to the agent’s event dispatcher.
Sourcepub fn with_event_dispatcher(self, dispatcher: Arc<EventDispatcher>) -> Self
pub fn with_event_dispatcher(self, dispatcher: Arc<EventDispatcher>) -> Self
Set the event dispatcher directly.
Sourcepub fn with_pii_sanitization(self, enabled: bool) -> Self
pub fn with_pii_sanitization(self, enabled: bool) -> Self
Enable or disable PII sanitization in event data. Enabled by default for security. Disable only if you need raw data and have other security measures in place.
When enabled:
- Message previews are truncated to 100 characters
- Sensitive fields (passwords, tokens, etc.) are redacted
- PII patterns (emails, phones, credit cards) are removed
Sourcepub fn with_token_tracking_config(self, config: TokenTrackingConfig) -> Self
pub fn with_token_tracking_config(self, config: TokenTrackingConfig) -> Self
Configure token tracking for monitoring LLM usage and costs.