# #region LLMAnalysisModels [C:3] [TYPE Module] [SEMANTICS pydantic, llm, plugin, model, provider-type]
# @BRIEF Define Pydantic models for LLM Analysis plugin.
# @LAYER Domain
# @RELATION DEPENDS_ON -> [EXT:Library:pydantic]

from datetime import UTC, datetime
from enum import Enum

from pydantic import BaseModel, Field


# #region LLMProviderType [TYPE Class]
# @BRIEF Enum for supported LLM providers.
class LLMProviderType(str, Enum):
    OPENAI = "openai"
    OPENROUTER = "openrouter"
    KILO = "kilo"
    LITELLM = "litellm"
# #endregion LLMProviderType

# #region LLMProviderConfig [TYPE Class]
# @BRIEF Configuration for an LLM provider.
class LLMProviderConfig(BaseModel):
    id: str | None = None
    provider_type: LLMProviderType
    name: str
    base_url: str
    api_key: str | None = None
    default_model: str
    is_active: bool = True
    is_multimodal: bool = False
    max_images: int | None = None
# #endregion LLMProviderConfig

# #region ValidationStatus [TYPE Class]
# @BRIEF Enum for dashboard validation status.
class ValidationStatus(str, Enum):
    PASS = "PASS"
    WARN = "WARN"
    FAIL = "FAIL"
    UNKNOWN = "UNKNOWN"
# #endregion ValidationStatus

# #region DetectedIssue [TYPE Class]
# @BRIEF Model for a single issue detected during validation.
class DetectedIssue(BaseModel):
    severity: ValidationStatus
    message: str
    location: str | None = None
# #endregion DetectedIssue

# #region ValidationResult [TYPE Class]
# @BRIEF Model for dashboard validation result.
class ValidationResult(BaseModel):
    id: str | None = None
    dashboard_id: str
    timestamp: datetime = Field(default_factory=lambda: datetime.now(UTC))
    status: ValidationStatus
    screenshot_path: str | None = None
    issues: list[DetectedIssue]
    summary: str
    raw_response: str | None = None
# #endregion ValidationResult

# #endregion LLMAnalysisModels
