Download src/config.py from stacknet/stacknet-1-1-preview-demo: direct link, hf CLI and curl.
- Browser
- Download file 971 Bytes
-
https://huggingface.co/spaces/stacknet/stacknet-1-1-preview-demo/resolve/26cd782aefe4d31da31c8a71b671c06ebe7b2a44/src/config.py
- Command line
-
hf download hf://spaces/stacknet/stacknet-1-1-preview-demo@26cd782aefe4d31da31c8a71b671c06ebe7b2a44/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/stacknet/stacknet-1-1-preview-demo/resolve/26cd782aefe4d31da31c8a71b671c06ebe7b2a44/src/config.py
971 Bytes
| """ | |
| 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() | |