File size: 971 Bytes
957256e 5a42256 957256e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
"""
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()
@dataclass
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
@property
def tasks_endpoint(self) -> str:
return f"{self.stacknet_url}/tasks"
@property
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()
|