//! LLM extraction configuration.

use serde::Deserialize;

/// LLM extraction configuration for semantic claim detection.
///
/// When enabled, Aphoria uses Gemini to extract security-relevant claims
/// from high-value files where regex extractors found nothing. This runs
/// only in persistent mode to preserve ephemeral scan speed.
///
/// # Example
///
/// ```toml
/// [llm]
/// enabled = true
/// provider = "gemini"
/// # model defaults to DEFAULT_LLM_MODEL constant
/// api_key_env = "GEMINI_API_KEY"
/// max_tokens_per_scan = 50000
/// max_tokens_per_file = 4000
/// cache_responses = true
/// timeout_secs = 60
/// high_value_only = true
/// min_confidence = 0.7
/// ```
#[derive(Debug, Clone, Deserialize)]
#[serde(default)]
pub struct LlmConfig {
    /// Enable LLM extraction (opt-in, default: false).
    ///
    /// CRITICAL: This defaults to false. Users must explicitly opt-in
    /// to use LLM-based extraction (requires API key and incurs costs).
    pub enabled: bool,

    /// LLM provider (currently only "gemini" is supported).
    pub provider: String,

    /// Model identifier (defaults to `DEFAULT_LLM_MODEL`).
    pub model: String,

    /// Environment variable containing the API key.
    pub api_key_env: String,

    /// Maximum tokens per scan (budget across all files).
    pub max_tokens_per_scan: usize,

    /// Maximum tokens per individual file.
    pub max_tokens_per_file: usize,

    /// Whether to cache LLM responses (keyed by content hash + model).
    pub cache_responses: bool,

    /// Timeout in seconds for API calls.
    pub timeout_secs: u64,

    /// Only run LLM extraction on high-value files (auth/, config/, crypto/, etc.).
    pub high_value_only: bool,

    /// Minimum confidence threshold for including extracted claims.
    pub min_confidence: f32,
}

// Default implementation is in defaults.rs
