| """ | |
| Configuration management for StackNet Demo. | |
| Loads settings from environment variables with sensible defaults. | |
| """ | |
| import os | |
| from dataclasses import dataclass | |
| from dotenv import load_dotenv | |
| # Load .env file if present | |
| load_dotenv() | |
| class Config: | |
| """Application configuration.""" | |
| # StackNet API | |
| stacknet_url: str = os.getenv("STACKNET_NETWORK_URL", "https://geoffnet.magma-rpc.com") | |
| # Note: API key is provided via UI only, not from environment | |
| # Endpoints | |
| def tasks_endpoint(self) -> str: | |
| return f"{self.stacknet_url}/tasks" | |
| def chat_endpoint(self) -> str: | |
| return f"{self.stacknet_url}/v1/chat/completions" | |
| # Timeouts (seconds) | |
| request_timeout: float = 300.0 # 5 minutes for long operations | |
| # Task types | |
| TASK_TYPE_MEDIA = "media-orchestration" | |
| TASK_TYPE_MCP = "mcp-tool" | |
| TASK_TYPE_AI_PROMPT = "ai-prompt" | |
| # Global config instance | |
| config = Config() | |