from pathlib import Path from pydantic_settings import BaseSettings PROJECT_ROOT = Path(__file__).parent.parent class Settings(BaseSettings): # required in production and has safe defaults for testing anthropic_api_key: str = "" model: str = "claude-sonnet-4-5-20250929" safedir: str = "./workspace" max_tokens: int = 8096 use_sandbox: bool = True model_config = { "env_file": PROJECT_ROOT / ".env" if (PROJECT_ROOT / ".env").exists() else None, "extra": "ignore", } # create singleton instance, causes validation settings = Settings()