pub struct CodeConfig {Show 16 fields
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>,
pub agentic_search: Option<AgenticSearchConfig>,
pub agentic_parse: Option<AgenticParseConfig>,
pub document_parser: Option<DocumentParserConfig>,
pub mcp_servers: Vec<McpServerConfig>,
}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)
agentic_search: Option<AgenticSearchConfig>Agentic search tool configuration.
agentic_parse: Option<AgenticParseConfig>Agentic parse tool configuration.
document_parser: Option<DocumentParserConfig>Built-in document context extraction configuration.
mcp_servers: Vec<McpServerConfig>MCP server configurations
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 moreSource§impl Debug for CodeConfig
impl Debug for CodeConfig
Source§impl Default for CodeConfig
impl Default for CodeConfig
Source§fn default() -> CodeConfig
fn default() -> CodeConfig
Source§impl<'de> Deserialize<'de> for CodeConfig
impl<'de> Deserialize<'de> for CodeConfig
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>,
Auto Trait Implementations§
impl Freeze for CodeConfig
impl RefUnwindSafe for CodeConfig
impl Send for CodeConfig
impl Sync for CodeConfig
impl Unpin for CodeConfig
impl UnsafeUnpin for CodeConfig
impl UnwindSafe for CodeConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more