pub struct AgentDefinition {
pub name: String,
pub description: String,
pub mode: AgentMode,
pub native: bool,
pub hidden: bool,
pub permissions: PermissionPolicy,
pub model: Option<ModelConfig>,
pub prompt: Option<String>,
pub max_steps: Option<usize>,
pub can_spawn_subagents: bool,
}Expand description
Agent definition
Defines the configuration and capabilities of an agent type.
Fields§
§name: StringAgent identifier (e.g., “explore”, “plan”, “general”)
description: StringDescription of what the agent does
mode: AgentModeAgent mode: “subagent” or “primary”
native: boolWhether this is a built-in agent
Whether to hide from UI
permissions: PermissionPolicyPermission rules for this agent
model: Option<ModelConfig>Optional model override
prompt: Option<String>System prompt for this agent
max_steps: Option<usize>Maximum execution steps (tool rounds)
can_spawn_subagents: boolWhether this agent can spawn subagents (default: false)
Implementations§
Source§impl AgentDefinition
impl AgentDefinition
Mark as hidden from UI
Sourcepub fn with_permissions(self, permissions: PermissionPolicy) -> Self
pub fn with_permissions(self, permissions: PermissionPolicy) -> Self
Set permission policy
Sourcepub fn with_model(self, model: ModelConfig) -> Self
pub fn with_model(self, model: ModelConfig) -> Self
Set model override
Sourcepub fn with_prompt(self, prompt: &str) -> Self
pub fn with_prompt(self, prompt: &str) -> Self
Set system prompt
Sourcepub fn with_max_steps(self, max_steps: usize) -> Self
pub fn with_max_steps(self, max_steps: usize) -> Self
Set maximum execution steps
Sourcepub fn allow_subagents(self) -> Self
pub fn allow_subagents(self) -> Self
Allow spawning subagents
Trait Implementations§
Source§impl Clone for AgentDefinition
impl Clone for AgentDefinition
Source§fn clone(&self) -> AgentDefinition
fn clone(&self) -> AgentDefinition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentDefinition
impl Debug for AgentDefinition
Source§impl<'de> Deserialize<'de> for AgentDefinition
impl<'de> Deserialize<'de> for AgentDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentDefinition
impl RefUnwindSafe for AgentDefinition
impl Send for AgentDefinition
impl Sync for AgentDefinition
impl Unpin for AgentDefinition
impl UnsafeUnpin for AgentDefinition
impl UnwindSafe for AgentDefinition
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