MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / __init__

Method __init__

openspace/utils/ui.py:45–78  ·  view source on GitHub ↗

Initialize UI Args: enable_live: Whether to enable live display updates compact: Use compact layout (for smaller terminals)

(self, enable_live: bool = True, compact: bool = False)

Source from the content-addressed store, hash-verified

43 """
44
45 def __init__(self, enable_live: bool = True, compact: bool = False):
46 """
47 Initialize UI
48
49 Args:
50 enable_live: Whether to enable live display updates
51 compact: Use compact layout (for smaller terminals)
52 """
53 self.enable_live = enable_live
54 self.compact = compact
55
56 # Terminal dimensions
57 self.term_width, self.term_height = self._get_terminal_size()
58
59 # State tracking
60 self.agent_status: Dict[str, AgentStatus] = {}
61 self.agent_activities: Dict[str, List[str]] = {}
62 self.grounding_operations: List[Dict[str, Any]] = []
63 self.grounding_backends: List[Dict[str, Any]] = [] # Backend info (type, servers, etc.)
64 self.log_buffer: List[Tuple[str, str, datetime]] = [] # (message, level, timestamp)
65
66 # Metrics
67 self.metrics: Dict[str, Any] = {
68 "start_time": None,
69 "iterations": 0,
70 "completed_tasks": 0,
71 "llm_calls": 0,
72 "grounding_calls": 0,
73 }
74
75 # Live display state
76 self._live_running = False
77 self._live_task: Optional[asyncio.Task] = None
78 self._last_render: List[str] = []
79
80 def _get_terminal_size(self) -> Tuple[int, int]:
81 """Get terminal size"""

Callers

nothing calls this directly

Calls 1

_get_terminal_sizeMethod · 0.95

Tested by

no test coverage detected