pub struct AgentDefinition {Show 19 fields
pub id: String,
pub name: Option<String>,
pub description: Option<String>,
pub model: String,
pub system_prompt: String,
pub max_rounds: usize,
pub tool_execution_mode: ToolExecutionMode,
pub chat_options: Option<ChatOptions>,
pub fallback_models: Vec<String>,
pub llm_retry_policy: LlmRetryPolicy,
pub behavior_ids: Vec<String>,
pub allowed_tools: Option<Vec<String>>,
pub excluded_tools: Option<Vec<String>>,
pub allowed_skills: Option<Vec<String>>,
pub excluded_skills: Option<Vec<String>>,
pub allowed_agents: Option<Vec<String>>,
pub excluded_agents: Option<Vec<String>>,
pub stop_condition_specs: Vec<StopConditionSpec>,
pub stop_condition_ids: Vec<String>,
}Expand description
Agent composition definition owned by AgentOS.
This is the orchestration-facing model and uses only registry references
(behavior_ids, stop_condition_ids) and declarative specs.
Before execution, AgentOS resolves it into loop-facing [BaseAgent].
Fields§
§id: StringUnique identifier for this agent.
name: Option<String>Human-readable display name used in discovery surfaces.
description: Option<String>Short description exposed to callers/models when this agent is discoverable.
model: StringModel identifier (e.g., “gpt-4”, “claude-3-opus”).
system_prompt: StringSystem prompt for the LLM.
max_rounds: usizeMaximum number of tool call rounds before stopping.
tool_execution_mode: ToolExecutionModeTool execution strategy.
chat_options: Option<ChatOptions>Chat options for the LLM.
fallback_models: Vec<String>Fallback model ids used when the primary model fails.
Evaluated in order after model.
llm_retry_policy: LlmRetryPolicyRetry policy for LLM inference failures.
behavior_ids: Vec<String>Behavior references resolved from AgentOS behavior registry.
allowed_tools: Option<Vec<String>>Tool whitelist (None = all tools available).
excluded_tools: Option<Vec<String>>Tool blacklist.
allowed_skills: Option<Vec<String>>Skill whitelist (None = all skills available).
excluded_skills: Option<Vec<String>>Skill blacklist.
allowed_agents: Option<Vec<String>>Agent whitelist for agent_run delegation (None = all visible agents available).
excluded_agents: Option<Vec<String>>Agent blacklist for agent_run delegation.
stop_condition_specs: Vec<StopConditionSpec>Declarative stop condition specs, resolved at runtime.
stop_condition_ids: Vec<String>Stop condition references resolved from AgentOS StopPolicyRegistry.
Implementations§
Source§impl AgentDefinition
impl AgentDefinition
Sourcepub fn with_id(id: impl Into<String>, model: impl Into<String>) -> Self
pub fn with_id(id: impl Into<String>, model: impl Into<String>) -> Self
Create a new instance with explicit id and model.
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Set system prompt.
Sourcepub fn with_max_rounds(self, max_rounds: usize) -> Self
pub fn with_max_rounds(self, max_rounds: usize) -> Self
Set max rounds.
Sourcepub fn with_chat_options(self, options: ChatOptions) -> Self
pub fn with_chat_options(self, options: ChatOptions) -> Self
Set chat options.
Sourcepub fn with_fallback_models(self, models: Vec<String>) -> Self
pub fn with_fallback_models(self, models: Vec<String>) -> Self
Set fallback model ids to try after the primary model.
Sourcepub fn with_fallback_model(self, model: impl Into<String>) -> Self
pub fn with_fallback_model(self, model: impl Into<String>) -> Self
Add a single fallback model id.
Sourcepub fn with_llm_retry_policy(self, policy: LlmRetryPolicy) -> Self
pub fn with_llm_retry_policy(self, policy: LlmRetryPolicy) -> Self
Set LLM retry policy.
pub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn display_name(&self) -> &str
pub fn display_description(&self) -> &str
pub fn descriptor(&self) -> AgentDescriptor
pub fn with_stop_condition_spec(self, spec: StopConditionSpec) -> Self
pub fn with_stop_condition_specs(self, specs: Vec<StopConditionSpec>) -> Self
pub fn with_tool_execution_mode(self, mode: ToolExecutionMode) -> Self
pub fn with_behavior_ids(self, behavior_ids: Vec<String>) -> Self
pub fn with_behavior_id(self, behavior_id: impl Into<String>) -> Self
pub fn with_stop_condition_id(self, id: impl Into<String>) -> Self
pub fn with_stop_condition_ids(self, ids: Vec<String>) -> Self
pub fn with_allowed_tools(self, tools: Vec<String>) -> Self
pub fn with_excluded_tools(self, tools: Vec<String>) -> Self
pub fn with_allowed_skills(self, skills: Vec<String>) -> Self
pub fn with_excluded_skills(self, skills: Vec<String>) -> Self
pub fn with_allowed_agents(self, agents: Vec<String>) -> Self
pub fn with_excluded_agents(self, agents: Vec<String>) -> Self
Trait Implementations§
Source§impl Clone for AgentDefinition
impl Clone for AgentDefinition
Source§fn clone(&self) -> AgentDefinition
fn clone(&self) -> AgentDefinition
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more