pub struct SynapticAgentConfig {
pub model: ModelConfig,
pub agent: AgentConfig,
pub paths: PathsConfig,
pub mcp: Option<Vec<McpServerConfig>>,
}Expand description
Top-level agent configuration, loaded from TOML / JSON / YAML.
Fields§
§model: ModelConfig§agent: AgentConfig§paths: PathsConfig§mcp: Option<Vec<McpServerConfig>>Implementations§
Source§impl SynapticAgentConfig
impl SynapticAgentConfig
Sourcepub fn load(path: Option<&Path>) -> Result<Self, SynapticError>
pub fn load(path: Option<&Path>) -> Result<Self, SynapticError>
Load configuration from a file (TOML, JSON, or YAML).
Search order:
- Explicit path (if provided)
./synaptic.{toml,json,yaml,yml}~/.synaptic/config.{toml,json,yaml,yml}
Sourcepub fn load_from(source: &dyn ConfigSource) -> Result<Self, SynapticError>
pub fn load_from(source: &dyn ConfigSource) -> Result<Self, SynapticError>
Load from any ConfigSource.
Sourcepub fn parse(content: &str, format: ConfigFormat) -> Result<Self, SynapticError>
pub fn parse(content: &str, format: ConfigFormat) -> Result<Self, SynapticError>
Parse from a string in the given format.
Sourcepub fn resolve_api_key(&self) -> Result<String, SynapticError>
pub fn resolve_api_key(&self) -> Result<String, SynapticError>
Resolve the API key from the environment variable specified in model.api_key_env.
Trait Implementations§
Source§impl Clone for SynapticAgentConfig
impl Clone for SynapticAgentConfig
Source§fn clone(&self) -> SynapticAgentConfig
fn clone(&self) -> SynapticAgentConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SynapticAgentConfig
impl Debug for SynapticAgentConfig
Source§impl<'de> Deserialize<'de> for SynapticAgentConfig
impl<'de> Deserialize<'de> for SynapticAgentConfig
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 SynapticAgentConfig
impl RefUnwindSafe for SynapticAgentConfig
impl Send for SynapticAgentConfig
impl Sync for SynapticAgentConfig
impl Unpin for SynapticAgentConfig
impl UnsafeUnpin for SynapticAgentConfig
impl UnwindSafe for SynapticAgentConfig
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