pub struct AgentDefinition {
pub name: String,
pub description: String,
pub model: Option<String>,
pub tools: Vec<String>,
pub system_prompt: Option<String>,
pub source: String,
pub extensions: Vec<String>,
pub max_subagent_depth: u8,
pub default_context: DefaultContext,
}Expand description
Agent definition parsed from a markdown file with YAML frontmatter.
Fields§
§name: StringAgent name (a-z, 0-9, hyphens, max 64 chars)
description: StringHuman-readable description (max 1024 chars)
model: Option<String>Optional model override
tools: Vec<String>Tool names to make available. Accepts both YAML array and comma-separated string.
system_prompt: Option<String>System prompt (from frontmatter or body)
source: StringDiscovery scope: “user” or “project”. Set by discovery, not by the file.
extensions: Vec<String>Extensions to load
max_subagent_depth: u8Maximum subagent nesting depth (max 10)
default_context: DefaultContextDefault context mode
Implementations§
Source§impl AgentDefinition
impl AgentDefinition
Sourcepub fn from_markdown(path: &Path) -> Result<AgentDefinition, Error>
pub fn from_markdown(path: &Path) -> Result<AgentDefinition, Error>
Load an agent definition from a markdown file.
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 (const: unstable) · 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<AgentDefinition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentDefinition, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for AgentDefinition
impl Serialize for AgentDefinition
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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