pub struct ApiConfig {
pub base_url: String,
pub model: String,
pub api_key: Option<String>,
pub max_output_tokens: Option<u32>,
pub thinking: Option<String>,
pub effort: Option<String>,
pub max_cost_usd: Option<f64>,
pub timeout_secs: u64,
pub max_retries: u32,
}Expand description
API connection settings.
Configures the LLM provider: base URL, model, API key, timeouts, cost limits, and thinking mode. The API key is resolved from multiple sources (env vars, config file, CLI flag).
Fields§
§base_url: StringBase URL for the LLM API.
model: StringModel identifier.
api_key: Option<String>API key. Resolved from (in order): config, AGENT_CODE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY env vars.
max_output_tokens: Option<u32>Maximum output tokens per response.
thinking: Option<String>Thinking mode: “enabled”, “disabled”, or “adaptive”.
effort: Option<String>Effort level: “low”, “medium”, “high”.
max_cost_usd: Option<f64>Maximum spend per session in USD.
timeout_secs: u64Request timeout in seconds.
max_retries: u32Maximum retry attempts for transient errors.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ApiConfig
impl<'de> Deserialize<'de> for ApiConfig
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 ApiConfig
impl RefUnwindSafe for ApiConfig
impl Send for ApiConfig
impl Sync for ApiConfig
impl Unpin for ApiConfig
impl UnsafeUnpin for ApiConfig
impl UnwindSafe for ApiConfig
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