Spaces:
Sleeping
Sleeping
| import os | |
| from typing import List, Union | |
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| from pydantic import AnyHttpUrl, field_validator | |
| class Settings(BaseSettings): | |
| API_V1_STR: str = "/api/v1" | |
| PROJECT_NAME: str = "TalentTalk Pro" | |
| # CORS | |
| BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = [] | |
| def assemble_cors_origins(cls, v: Union[str, List[str]]) -> List[str]: | |
| if isinstance(v, str) and not v.startswith("["): | |
| return [i.strip() for i in v.split(",")] | |
| elif isinstance(v, (list, str)): | |
| return v | |
| raise ValueError(v) | |
| # Database | |
| DATABASE_URL: str = "sqlite+aiosqlite:///./talenttalk.db" | |
| # OpenRouter | |
| OPENROUTER_API_KEY: str | |
| GOOGLE_API_KEY: str = "" # Optional fallback or for Multimodal if valid | |
| # Voice Services | |
| ASSEMBLYAI_API_KEY: str = "" | |
| ELEVENLABS_API_KEY: str = "" | |
| # Environment | |
| ENVIRONMENT: str = "development" | |
| LOG_LEVEL: str = "INFO" | |
| model_config = SettingsConfigDict( | |
| env_file=".env", | |
| env_file_encoding="utf-8", | |
| case_sensitive=True, | |
| extra="ignore" | |
| ) | |
| settings = Settings() | |