pub struct Config {
pub workspace: PathBuf,
pub api_base: String,
pub api_key: Option<String>,
pub model: String,
pub provider_type: String,
pub max_steps: usize,
pub temperature: f64,
pub system_prompt: String,
pub retry_max: usize,
pub retry_initial_backoff_secs: u64,
pub retry_max_backoff_secs: u64,
pub shell_timeout_secs: u64,
}Fields§
§workspace: PathBuf§api_base: String§api_key: Option<String>§model: String§provider_type: String§max_steps: usize§temperature: f64§system_prompt: String§retry_max: usize§retry_initial_backoff_secs: u64§retry_max_backoff_secs: u64§shell_timeout_secs: u64Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Load from environment, with config file (~/.recursive/config.toml) as fallback.
Priority: env var > config file > hardcoded default.
The API key is optional here so commands that don’t need the LLM
(e.g. tools, config) still run.
Sourcepub fn require_api_key(&self) -> Result<&str>
pub fn require_api_key(&self) -> Result<&str>
Return the API key or a descriptive error if none was configured.
Sourcepub fn validate_for_agent(&self) -> Result<(), String>
pub fn validate_for_agent(&self) -> Result<(), String>
Validate that the config has enough information to run the agent. Returns a user-friendly error message if not.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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