pub struct CapabilitiesConfig {
pub enable_subagents: bool,
pub enabled_tools: Option<Vec<BuiltinTools>>,
pub disabled_tools: Option<Vec<BuiltinTools>>,
pub compaction_threshold: Option<usize>,
pub image_model: String,
pub finish_tool_schema_json: Option<String>,
}Expand description
Agent capability toggles: tool allowlists, subagent support, and compaction.
Construct with the named constructors (with_tools,
read_only, …) for common presets, or with the
TypedBuilder for fine-grained control. Both preserve the SDK-matching
defaults (subagents enabled, default image model):
use agy_bridge::config::CapabilitiesConfig;
let caps = CapabilitiesConfig::builder()
.enable_subagents(false)
.compaction_threshold(8000)
.build();
assert!(!caps.enable_subagents);
assert_eq!(caps.compaction_threshold, Some(8000));Fields§
§enable_subagents: boolWhether this agent can spawn subagents.
enabled_tools: Option<Vec<BuiltinTools>>If set, only these built-in tools are available (allowlist).
disabled_tools: Option<Vec<BuiltinTools>>If set, these built-in tools are removed (denylist).
compaction_threshold: Option<usize>Token threshold that triggers conversation compaction.
image_model: StringThe model to use for image generation.
This setting is a shorthand for GeminiConfig.models.image_generation.name.
If both are specified, the value in GeminiConfig takes precedence and
this field is ignored.
finish_tool_schema_json: Option<String>Optional JSON schema string for the finish tool’s structured output.
Implementations§
Source§impl CapabilitiesConfig
impl CapabilitiesConfig
Sourcepub fn builder() -> CapabilitiesConfigBuilder<((), (), (), (), (), ())>
pub fn builder() -> CapabilitiesConfigBuilder<((), (), (), (), (), ())>
Create a builder for building CapabilitiesConfig.
On the builder, call .enable_subagents(...)(optional), .enabled_tools(...)(optional), .disabled_tools(...)(optional), .compaction_threshold(...)(optional), .image_model(...)(optional), .finish_tool_schema_json(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of CapabilitiesConfig.
Source§impl CapabilitiesConfig
impl CapabilitiesConfig
Sourcepub fn with_tools(tools: Vec<BuiltinTools>) -> Self
pub fn with_tools(tools: Vec<BuiltinTools>) -> Self
Create a capabilities config with only the specified tools enabled.
Subagent support is enabled by default.
Sourcepub fn read_only() -> Self
pub fn read_only() -> Self
Create a capabilities config for read-only agents with subagent support.
Sourcepub fn custom_tools_only() -> Self
pub fn custom_tools_only() -> Self
Create a capabilities config with no builtin tools — only custom tools.
Subagent support is still enabled.
Trait Implementations§
Source§impl Clone for CapabilitiesConfig
impl Clone for CapabilitiesConfig
Source§fn clone(&self) -> CapabilitiesConfig
fn clone(&self) -> CapabilitiesConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more