pub struct CodeConfig {
pub default_model: Option<String>,
pub providers: Vec<ProviderConfig>,
pub storage_backend: StorageBackend,
pub sessions_dir: Option<PathBuf>,
pub storage_url: Option<String>,
pub skill_dirs: Vec<PathBuf>,
pub agent_dirs: Vec<PathBuf>,
pub max_tool_rounds: Option<usize>,
pub thinking_budget: Option<usize>,
pub memory: Option<MemoryConfig>,
pub queue: Option<SessionQueueConfig>,
pub search: Option<SearchConfig>,
}Expand description
Configuration for A3S Code
Fields§
§default_model: Option<String>Default model in “provider/model” format (e.g., “anthropic/claude-sonnet-4-20250514”)
providers: Vec<ProviderConfig>Provider configurations
storage_backend: StorageBackendSession storage backend
sessions_dir: Option<PathBuf>Sessions directory (for file backend)
storage_url: Option<String>Connection URL for custom storage backend (e.g., “redis://localhost:6379”, “postgres://user:pass@localhost/a3s”)
skill_dirs: Vec<PathBuf>Directories to scan for skill files (*.md with tool definitions)
agent_dirs: Vec<PathBuf>Directories to scan for agent files (*.yaml or *.md)
max_tool_rounds: Option<usize>Maximum tool execution rounds per turn (default: 25)
thinking_budget: Option<usize>Thinking/reasoning budget in tokens
memory: Option<MemoryConfig>Memory system configuration
queue: Option<SessionQueueConfig>Queue configuration (a3s-lane integration)
search: Option<SearchConfig>Search configuration (a3s-search integration)
Implementations§
Source§impl CodeConfig
impl CodeConfig
Sourcepub fn from_file(path: &Path) -> Result<Self>
pub fn from_file(path: &Path) -> Result<Self>
Load configuration from an HCL file.
Only .hcl files are supported. JSON support has been removed.
Sourcepub fn from_hcl(content: &str) -> Result<Self>
pub fn from_hcl(content: &str) -> Result<Self>
Parse configuration from an HCL string.
HCL attributes use snake_case which is converted to camelCase for
serde deserialization. Repeated blocks (e.g., providers, models)
are collected into JSON arrays.
Sourcepub fn save_to_file(&self, path: &Path) -> Result<()>
pub fn save_to_file(&self, path: &Path) -> Result<()>
Save configuration to a JSON file (used for persistence)
Note: This saves as JSON format. To use HCL format, manually create .hcl files.
Sourcepub fn find_provider(&self, name: &str) -> Option<&ProviderConfig>
pub fn find_provider(&self, name: &str) -> Option<&ProviderConfig>
Find a provider by name
Sourcepub fn default_provider_config(&self) -> Option<&ProviderConfig>
pub fn default_provider_config(&self) -> Option<&ProviderConfig>
Get the default provider configuration (parsed from default_model “provider/model” format)
Sourcepub fn default_model_config(&self) -> Option<(&ProviderConfig, &ModelConfig)>
pub fn default_model_config(&self) -> Option<(&ProviderConfig, &ModelConfig)>
Get the default model configuration (parsed from default_model “provider/model” format)
Sourcepub fn default_llm_config(&self) -> Option<LlmConfig>
pub fn default_llm_config(&self) -> Option<LlmConfig>
Get LlmConfig for the default provider and model
Returns None if default provider/model is not configured or API key is missing.
Sourcepub fn llm_config(
&self,
provider_name: &str,
model_id: &str,
) -> Option<LlmConfig>
pub fn llm_config( &self, provider_name: &str, model_id: &str, ) -> Option<LlmConfig>
Get LlmConfig for a specific provider and model
Returns None if provider/model is not found or API key is missing.
Sourcepub fn list_models(&self) -> Vec<(&ProviderConfig, &ModelConfig)>
pub fn list_models(&self) -> Vec<(&ProviderConfig, &ModelConfig)>
List all available models across all providers
Sourcepub fn add_skill_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn add_skill_dir(self, dir: impl Into<PathBuf>) -> Self
Add a skill directory
Sourcepub fn add_agent_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn add_agent_dir(self, dir: impl Into<PathBuf>) -> Self
Add an agent directory
Sourcepub fn has_directories(&self) -> bool
pub fn has_directories(&self) -> bool
Check if any directories are configured
Sourcepub fn has_providers(&self) -> bool
pub fn has_providers(&self) -> bool
Check if provider configuration is available
Trait Implementations§
Source§impl Clone for CodeConfig
impl Clone for CodeConfig
Source§fn clone(&self) -> CodeConfig
fn clone(&self) -> CodeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more