Skip to main content

vv_agent/sdk/types/
definition.rs

1use std::collections::BTreeMap;
2
3use crate::types::{Metadata, NoToolPolicy, SubAgentConfig};
4
5#[derive(Debug, Clone, PartialEq)]
6pub struct AgentDefinition {
7    pub description: String,
8    pub model: String,
9    pub backend: Option<String>,
10    pub language: String,
11    pub max_cycles: u32,
12    pub memory_compact_threshold: u64,
13    pub memory_threshold_percentage: u8,
14    pub no_tool_policy: NoToolPolicy,
15    pub allow_interruption: bool,
16    pub use_workspace: bool,
17    pub enable_todo_management: bool,
18    pub agent_type: Option<String>,
19    pub native_multimodal: bool,
20    pub enable_sub_agents: bool,
21    pub sub_agents: BTreeMap<String, SubAgentConfig>,
22    pub skill_directories: Vec<String>,
23    pub extra_tool_names: Vec<String>,
24    pub exclude_tools: Vec<String>,
25    pub bash_shell: Option<String>,
26    pub windows_shell_priority: Vec<String>,
27    pub bash_env: BTreeMap<String, String>,
28    pub metadata: Metadata,
29    pub system_prompt: Option<String>,
30    pub system_prompt_template: Option<String>,
31}
32
33impl AgentDefinition {
34    pub fn default_for_model(model: impl Into<String>) -> Self {
35        Self {
36            description: "General-purpose VectorVein agent profile".to_string(),
37            model: model.into(),
38            backend: None,
39            language: "zh-CN".to_string(),
40            max_cycles: 10,
41            memory_compact_threshold: 128_000,
42            memory_threshold_percentage: 90,
43            no_tool_policy: NoToolPolicy::Continue,
44            allow_interruption: true,
45            use_workspace: true,
46            enable_todo_management: true,
47            agent_type: None,
48            native_multimodal: false,
49            enable_sub_agents: false,
50            sub_agents: BTreeMap::new(),
51            skill_directories: Vec::new(),
52            extra_tool_names: Vec::new(),
53            exclude_tools: Vec::new(),
54            bash_shell: None,
55            windows_shell_priority: Vec::new(),
56            bash_env: BTreeMap::new(),
57            metadata: Metadata::new(),
58            system_prompt: None,
59            system_prompt_template: None,
60        }
61    }
62}