from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore") APP_ENV: str = "dev" DATABASE_URL: str = "postgresql+psycopg://shop:shop@localhost:5432/shop" REDIS_URL: str = "redis://localhost:6379/0" MEILI_URL: str = "http://localhost:7700" MEILI_KEY: str = "shop-dev-master-key" OLLAMA_URL: str = "http://localhost:11434" OLLAMA_CHAT_MODEL: str = "qwen2.5:7b" OLLAMA_EMBED_MODEL: str = "bge-m3" OLLAMA_EMBED_DIM: int = 1024 SMTP_HOST: str = "localhost" SMTP_PORT: int = 1025 MAIL_FROM: str = "shop@example.com" JWT_SECRET: str = "change-me" JWT_ACCESS_MINUTES: int = 15 JWT_REFRESH_DAYS: int = 30 UPLOAD_DIR: str = "./uploads" PUBLIC_BASE_URL: str = "http://localhost:8000" CORS_ORIGINS: str = "http://localhost:5173,http://localhost:5174" @property def cors_list(self) -> list[str]: return [o.strip() for o in self.CORS_ORIGINS.split(",") if o.strip()] settings = Settings()