from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    app_name: str = "Goodgo AI Services"
    debug: bool = False
    model_path: str = "/app/models"
    log_level: str = "info"
    cors_origins: str = ""
    api_key: str = ""
    rate_limit: str = "60/minute"

    model_config = {"env_prefix": "AI_"}

    @property
    def cors_origin_list(self) -> list[str]:
        if not self.cors_origins:
            return []
        return [o.strip() for o in self.cors_origins.split(",") if o.strip()]


settings = Settings()
