pub struct AppConfig {Show 36 fields
pub model_provider: String,
pub model: String,
pub model_vlm: Option<String>,
pub model_vlm_provider: Option<String>,
pub api_key: Option<String>,
pub api_base_url: Option<String>,
pub max_tokens: u32,
pub temperature: f64,
pub reasoning_effort: String,
pub auto_save_interval: u32,
pub max_context_tokens: u64,
pub verbose: bool,
pub debug_logging: bool,
pub color_scheme: String,
pub show_token_count: bool,
pub enable_sound: bool,
pub permissions: PermissionConfig,
pub enable_bash: bool,
pub bash_timeout: u32,
pub auto_mode: AutoModeConfig,
pub operation: OperationConfig,
pub max_undo_history: u32,
pub topic_detection: bool,
pub playbook: PlaybookConfig,
pub plan_mode_workflow: String,
pub plan_mode_explore_agent_count: u32,
pub plan_mode_plan_agent_count: u32,
pub plan_mode_explore_variant: String,
pub instructions: Vec<String>,
pub skill_paths: Vec<String>,
pub skill_urls: Vec<String>,
pub default_agent: Option<String>,
pub agents: HashMap<String, AgentConfigInline>,
pub model_variants: HashMap<String, ModelVariant>,
pub formatter: FormatterConfig,
pub config_version: u32,
}Expand description
Application configuration.
Fields§
§model_provider: String§model: String§model_vlm: Option<String>§model_vlm_provider: Option<String>§api_key: Option<String>§api_base_url: Option<String>§max_tokens: u32§temperature: f64§reasoning_effort: String§auto_save_interval: u32§max_context_tokens: u64§verbose: bool§debug_logging: bool§color_scheme: String§show_token_count: bool§enable_sound: bool§permissions: PermissionConfig§enable_bash: bool§bash_timeout: u32§auto_mode: AutoModeConfig§operation: OperationConfig§max_undo_history: u32§topic_detection: bool§playbook: PlaybookConfig§plan_mode_workflow: String§plan_mode_explore_agent_count: u32§plan_mode_plan_agent_count: u32§plan_mode_explore_variant: String§instructions: Vec<String>§skill_paths: Vec<String>§skill_urls: Vec<String>§default_agent: Option<String>§agents: HashMap<String, AgentConfigInline>§model_variants: HashMap<String, ModelVariant>§formatter: FormatterConfig§config_version: u32Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn resolve_agent_role(&self, role: &str) -> (String, String)
pub fn resolve_agent_role(&self, role: &str) -> (String, String)
Resolve the model and provider for a named agent role (e.g. “compact”).
Looks up self.agents[role] and falls back to the primary model/provider.
Sourcepub fn get_api_key_with_env(
&self,
registry_env_var: Option<&str>,
) -> Result<String, String>
pub fn get_api_key_with_env( &self, registry_env_var: Option<&str>, ) -> Result<String, String>
Get the API key from config or the environment.
Resolution order:
registry_env_var(from models.dev registry, e.g.ZHIPU_API_KEY)- Well-known env var for the provider (hardcoded fallback)
- Convention-based env var:
{PROVIDER}_API_KEY(e.g.zai→ZAI_API_KEY) self.api_key(stored in config by the setup wizard)OPENAI_API_KEY(last resort for truly unknown providers)
Sourcepub fn get_api_key(&self) -> Result<String, String>
pub fn get_api_key(&self) -> Result<String, String>
Convenience wrapper that calls [get_api_key_with_env] without registry info.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
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 AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfig
impl UnwindSafe for AppConfig
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