- Router Core with rule-based routing (1530 lines) - DevTools Backend (file ops, test execution) (393 lines) - CrewAI Orchestrator (4 workflows, 12 agents) (358 lines) - Bot Gateway (Telegram/Discord) (321 lines) - RBAC Service (role resolution) (272 lines) - Structured logging (utils/logger.py) - Docker deployment (docker-compose.yml) - Comprehensive documentation (57KB) - Test suites (41 tests, 95% coverage) - Phase 4 roadmap & ecosystem integration plans Production-ready infrastructure for DAARION microDAOs.
43 lines
949 B
Python
43 lines
949 B
Python
"""
|
|
DAGI Router Internal Models
|
|
|
|
Request/Response models for internal routing
|
|
"""
|
|
|
|
from dataclasses import dataclass
|
|
from typing import Any, Dict, Optional
|
|
|
|
|
|
@dataclass
|
|
class RouterRequest:
|
|
"""
|
|
Normalized request to DAGI Router.
|
|
This is what the routing engine works with.
|
|
"""
|
|
mode: Optional[str] = None
|
|
agent: Optional[str] = None
|
|
dao_id: Optional[str] = None
|
|
source: Optional[str] = None
|
|
session_id: Optional[str] = None
|
|
user_id: Optional[str] = None
|
|
message: Optional[str] = None
|
|
payload: Dict[str, Any] = None
|
|
|
|
def __post_init__(self):
|
|
if self.payload is None:
|
|
self.payload = {}
|
|
|
|
|
|
@dataclass
|
|
class RouterResponse:
|
|
"""Response from provider"""
|
|
ok: bool
|
|
provider_id: str
|
|
data: Any = None
|
|
error: Optional[str] = None
|
|
metadata: Dict[str, Any] = None
|
|
|
|
def __post_init__(self):
|
|
if self.metadata is None:
|
|
self.metadata = {}
|