Expand description
Configuration module — TOML/JSON/YAML config → Agent construction pipeline.
§Overview
This module provides a declarative configuration system for building agents:
- Schema (
AgentConfig) — the deserialization target for config files - Parser (
parse_config,parse_config_file) — multi-format parsing with env var substitution - Builder (
agent_from_config) — constructsArc<dyn Agent>from parsed config
§Example
ⓘ
let config = parse_config_file(Path::new("agent.toml"))?;
let agent = agent_from_config(&config)?;Re-exports§
pub use reference::parse_config_ref;pub use reference::ConfigRef;
Modules§
- reference
- Generic ID reference protocol for config objects.
Structs§
- Agent
Config - Top-level agent configuration. All sections are optional with defaults.
- Agent
Instance Section - A named agent instance that can reference or override a profile.
- Agent
Section - Agent-level configuration.
system_prompthere overrides the profile’s. - Cache
Section - Cache configuration.
- Callbacks
Section - Callback references — Phase 2 WASM plugin loading. In Phase 1, these are stored as strings but not acted upon.
- Compaction
Instance Section - A named compaction instance — a variation of the compaction defaults.
- Compaction
Section - Compaction configuration — unifies context management settings (G5).
- Compat
Section - OpenAI-compat quirk flags.
- Cost
Section - Cost rates for token usage tracking.
- Execution
Section - Execution limits and related configuration.
- Hooks
Section - Hook references — Phase 2 WASM plugin loading. In Phase 1, these are stored as strings but not acted upon.
- Profile
Instance Section - A named profile instance — a variation of the profile blueprint.
- Profile
Section - Profile section — the reusable agent blueprint.
Maps to
AgentProfilein the builder. Multiple agent instances can share the same profile. - Prompt
Instance Section - A system prompt instance — fills content into a strategy’s blocks.
- Provider
Instance - A named provider instance with overrides.
- Provider
Section - Provider configuration — model identity, API credentials, and protocol.
- Retry
Section - Retry configuration for transient provider errors.
- Session
Section - Session-level configuration.
- Skills
Section - Skills configuration.
- Strategy
Block Section - A block definition within a strategy template.
- Strategy
Instance Section - A system prompt strategy instance — defines block structure.
- SubAgents
Section - Sub-agent configuration.
- System
Prompt Section - System prompt instances configuration.
- System
Prompt Strategy Section - System prompt strategy configuration.
- Tool
Instance - A named tool instance with configuration overrides.
- Tools
Section - Tool configuration.
Enums§
- Config
Error - Errors from config parsing and agent construction.
- Config
Format - Supported config file formats.
Functions§
- agent_
from_ config - Construct an agent from a parsed config.
- agent_
from_ config_ with_ registry - Construct an agent from config, resolving tool names via a
ToolRegistry(G10). - agents_
from_ config - Construct multiple agents from a config with agent instances.
- parse_
config - Parse a config string in the specified format.
- parse_
config_ auto - Parse a config string, auto-detecting the format.
- parse_
config_ file - Parse a config file, detecting format from the file extension.