pub struct AgentConfig {
pub system_instructions: Option<SystemInstructions>,
pub capabilities: CapabilitiesConfig,
pub tools: Vec<Arc<dyn Tool>>,
pub policies: Vec<Policy>,
pub triggers: Vec<Arc<dyn Trigger>>,
pub workspaces: Vec<PathBuf>,
pub mcp_servers: Vec<McpServerConfig>,
pub conversation_id: Option<String>,
pub gemini: GeminiConfig,
pub response_schema: Option<String>,
}Expand description
Backend-agnostic agent configuration (tools, policies, triggers, workspaces).
Fields§
§system_instructions: Option<SystemInstructions>Optional system-level instructions for the model.
capabilities: CapabilitiesConfigWhich built-in tools are enabled or disabled.
tools: Vec<Arc<dyn Tool>>Custom tools registered into the agent.
policies: Vec<Policy>Safety policies governing tool execution.
triggers: Vec<Arc<dyn Trigger>>Background triggers that fire messages into the agent.
workspaces: Vec<PathBuf>Filesystem workspace roots for path-containment policies.
mcp_servers: Vec<McpServerConfig>MCP server configurations (native only).
conversation_id: Option<String>Resume an existing conversation by ID.
gemini: GeminiConfigGemini-specific model and API key settings.
response_schema: Option<String>JSON schema string for structured output via the finish tool.
Implementations§
Source§impl AgentConfig
impl AgentConfig
Sourcepub fn with_system_instructions(
self,
instr: impl Into<SystemInstructions>,
) -> Self
pub fn with_system_instructions( self, instr: impl Into<SystemInstructions>, ) -> Self
Set the system instructions for the model.
Sourcepub fn with_capabilities(self, cap: CapabilitiesConfig) -> Self
pub fn with_capabilities(self, cap: CapabilitiesConfig) -> Self
Configure which built-in tools are enabled.
Sourcepub fn with_policies(self, policies: Vec<Policy>) -> Self
pub fn with_policies(self, policies: Vec<Policy>) -> Self
Set the safety policies for tool execution.
Sourcepub fn with_workspace(self, ws: impl Into<PathBuf>) -> Self
pub fn with_workspace(self, ws: impl Into<PathBuf>) -> Self
Add a workspace root for path-containment enforcement.
Sourcepub fn with_trigger(self, trigger: Arc<dyn Trigger>) -> Self
pub fn with_trigger(self, trigger: Arc<dyn Trigger>) -> Self
Register a background trigger.
Sourcepub fn with_gemini(self, gemini: GeminiConfig) -> Self
pub fn with_gemini(self, gemini: GeminiConfig) -> Self
Set Gemini-specific configuration (model, API key).
Sourcepub fn with_api_key(self, key: impl Into<String>) -> Self
pub fn with_api_key(self, key: impl Into<String>) -> Self
Set the Gemini API key.
Sourcepub fn with_mcp_server(self, server: McpServerConfig) -> Self
pub fn with_mcp_server(self, server: McpServerConfig) -> Self
Add an MCP server to connect at startup (native only).