use std::time::Duration;
#[non_exhaustive]
#[derive(Debug, Clone)]
pub struct AiConfig {
pub base_url: String,
pub api_key: String,
pub model: String,
pub image_scope: ImageScope,
pub timeout: Duration,
pub max_retries: u32,
}
impl AiConfig {
pub fn new(
base_url: impl Into<String>,
api_key: impl Into<String>,
model: impl Into<String>,
) -> Self {
Self {
base_url: base_url.into(),
api_key: api_key.into(),
model: model.into(),
image_scope: ImageScope::All,
timeout: Duration::from_secs(120),
max_retries: 3,
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum ImageScope {
#[default]
All,
LowConfidencePagesOnly,
}