#[non_exhaustive]pub struct CustomAgentConfig {
pub name: String,
pub display_name: Option<String>,
pub description: Option<String>,
pub tools: Option<Vec<String>>,
pub prompt: String,
pub mcp_servers: Option<HashMap<String, McpServerConfig>>,
pub infer: Option<bool>,
pub skills: Option<Vec<String>>,
}Expand description
Configures a custom agent (sub-agent) for the session.
Custom agents have their own prompt, tool allowlist, and optionally
their own MCP servers and skill set. The agent named in
SessionConfig::agent (or the runtime default) is the active one
when the session starts.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringUnique name of the custom agent.
display_name: Option<String>Display name for UI purposes.
description: Option<String>Description of what the agent does.
tools: Option<Vec<String>>List of tool names the agent can use. None means all tools.
prompt: StringPrompt content for the agent.
mcp_servers: Option<HashMap<String, McpServerConfig>>MCP servers specific to this agent.
infer: Option<bool>Whether the agent is available for model inference.
skills: Option<Vec<String>>Skill names to preload into this agent’s context at startup.
Implementations§
Source§impl CustomAgentConfig
impl CustomAgentConfig
Sourcepub fn new(name: impl Into<String>, prompt: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, prompt: impl Into<String>) -> Self
Construct a custom agent configuration with the required name
and prompt fields populated.
All other fields default to unset; use the with_* chain to
customize them. Fields are also pub if direct assignment is
preferred for Option<T> pass-through.
Sourcepub fn with_display_name(self, display_name: impl Into<String>) -> Self
pub fn with_display_name(self, display_name: impl Into<String>) -> Self
Set the display name shown in the CLI’s agent-selection UI.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description of what the agent does.
Sourcepub fn with_tools<I, S>(self, tools: I) -> Self
pub fn with_tools<I, S>(self, tools: I) -> Self
Restrict the agent to a specific tool allowlist. When unset, the agent inherits the parent session’s tool set.
Sourcepub fn with_mcp_servers(
self,
mcp_servers: HashMap<String, McpServerConfig>,
) -> Self
pub fn with_mcp_servers( self, mcp_servers: HashMap<String, McpServerConfig>, ) -> Self
Configure agent-specific MCP servers.
Sourcepub fn with_infer(self, infer: bool) -> Self
pub fn with_infer(self, infer: bool) -> Self
Whether the agent participates in model inference.
Sourcepub fn with_skills<I, S>(self, skills: I) -> Self
pub fn with_skills<I, S>(self, skills: I) -> Self
Set the skills preloaded into the agent’s context at startup.
Trait Implementations§
Source§impl Clone for CustomAgentConfig
impl Clone for CustomAgentConfig
Source§fn clone(&self) -> CustomAgentConfig
fn clone(&self) -> CustomAgentConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more