Spaces:
Running
Running
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| class Settings(BaseSettings): | |
| model_config = SettingsConfigDict( | |
| env_file=".env", | |
| env_file_encoding="utf-8", | |
| case_sensitive=False, | |
| ) | |
| project_name: str = "Tranimal API Gateway" | |
| api_v1_prefix: str = "/api/v1" | |
| auth_service_url: str = "http://auth-service:8001" | |
| ai_service_url: str | None = None | |
| ai_proxy_timeout_seconds: int = 900 | |
| cors_origins: str = "http://localhost:3000,http://127.0.0.1:3000" | |
| def cors_origin_list(self) -> list[str]: | |
| return [origin.strip() for origin in self.cors_origins.split(",") if origin.strip()] | |
| def ai_enabled(self) -> bool: | |
| return bool(self.ai_service_url) | |
| settings = Settings() | |