"""Configuration management for Steward.""" from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): """Application settings loaded from environment variables or .env file.""" model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore") # Telegram telegram_bot_token: str = "" telegram_allowed_user_ids: list[int] = [] # LLM (OpenAI-compatible) openai_api_key: str = "" openai_base_url: str = "https://api.openai.com/v1" openai_model: str = "gpt-4o" openai_system_prompt: str = ( "You are Steward, a persistent, trustworthy AI-assisted personal operations platform. " "You reduce cognitive load by observing, remembering, planning, and proposing actions. " "You are conservative, transparent, and policy-aware. " "Always explain your reasoning." ) # Analysis / proposal worker analysis_target_url: str = "" analysis_target_api_key: str = "" analysis_cron_hour: int = 8 analysis_cron_minute: int = 0 # Thread memory thread_memory_path: str = "thread_memory.json" # MCP / OpenAPI tool server (open-webui/openapi-servers compatible) # Set MCP_SERVER_URL to enable tool calling. The service fetches # /openapi.json from this URL to discover available tools. mcp_server_url: str = "" mcp_server_api_key: str = "" def get_settings() -> Settings: """Return application settings singleton.""" return Settings()