Spaces:
Runtime error
Runtime error
| import os | |
| from pydantic import Field | |
| from pydantic_settings import BaseSettings | |
| from dotenv import load_dotenv | |
| # Load .env from project root | |
| load_dotenv(dotenv_path=os.path.join(os.path.dirname(__file__), "..", ".env")) | |
| class Settings(BaseSettings): | |
| """Centralized configuration for all services.""" | |
| # LLM Configuration | |
| openai_api_key: str = "" | |
| anthropic_api_key: str = "" | |
| google_api_key: str = "" | |
| mistral_api_key: str = "" | |
| default_llm_model: str = Field(validation_alias="LLM_MODEL") # Required - set via LLM_MODEL in .env | |
| # Alpaca Configuration | |
| alpaca_api_key: str = "" | |
| alpaca_secret_key: str = "" | |
| alpaca_base_url: str = "https://paper-api.alpaca.markets" | |
| # Service URLs (for inter-service communication) | |
| market_data_url: str = "http://localhost:8001" | |
| financial_reports_url: str = "http://localhost:8002" | |
| chat_url: str = "http://localhost:8003" | |
| # Classification strategy | |
| classification_strategy: str = "extract_then_classify" | |
| # Frontend URL (for CORS) | |
| frontend_url: str = "http://localhost:5173" | |
| class Config: | |
| env_file = ".env" | |
| env_file_encoding = "utf-8" | |
| settings = Settings() | |