pub struct AiConfig {Show 13 fields
pub provider: String,
pub model: String,
pub timeout_seconds: u64,
pub allow_paid_models: bool,
pub max_tokens: u32,
pub temperature: f32,
pub circuit_breaker_threshold: u32,
pub circuit_breaker_reset_seconds: u64,
pub retry_max_attempts: u32,
pub tasks: Option<TasksConfig>,
pub fallback: Option<FallbackConfig>,
pub custom_guidance: Option<String>,
pub validation_enabled: bool,
}Expand description
AI provider settings.
Fields§
§provider: StringAI provider: one of "gemini", "openrouter", "groq", "cerebras", "zenmux", or "zai".
model: StringModel identifier.
timeout_seconds: u64Request timeout in seconds.
allow_paid_models: boolAllow paid models (default: true).
max_tokens: u32Maximum tokens for API responses.
temperature: f32Temperature for API requests (0.0-1.0).
circuit_breaker_threshold: u32Circuit breaker failure threshold before opening (default: 3).
circuit_breaker_reset_seconds: u64Circuit breaker reset timeout in seconds (default: 60).
retry_max_attempts: u32Maximum retry attempts for rate-limited requests (default: 3).
tasks: Option<TasksConfig>Task-specific model overrides.
fallback: Option<FallbackConfig>Fallback provider chain for resilience.
custom_guidance: Option<String>Custom guidance to override or extend default best practices.
Allows users to provide project-specific tooling recommendations that will be appended to the default best practices context. Useful for enforcing project-specific choices (e.g., poetry instead of uv).
validation_enabled: boolEnable pre-flight model validation with fuzzy matching (default: true).
When enabled, validates that the configured model ID exists in the cached model registry before creating an AI client. Provides helpful suggestions if an invalid model ID is detected.
Implementations§
Source§impl AiConfig
impl AiConfig
Sourcepub fn resolve_for_task(&self, task: TaskType) -> (String, String)
pub fn resolve_for_task(&self, task: TaskType) -> (String, String)
Resolve provider and model for a specific task type.
Returns a tuple of (provider, model) by checking task-specific overrides first, then falling back to the default provider and model.
§Arguments
task- The task type to resolve configuration for
§Returns
A tuple of (provider_name, model_name) strings