Initial commit of integrated agent system
This commit is contained in:
20
backend/runtime/registry.py
Normal file
20
backend/runtime/registry.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Dict, Optional
|
||||
|
||||
|
||||
class RuntimeRegistry:
|
||||
def __init__(self) -> None:
|
||||
self._states: Dict[str, "AgentRuntimeState"] = {}
|
||||
|
||||
def register(self, agent_id: str, state: "AgentRuntimeState") -> None:
|
||||
self._states[agent_id] = state
|
||||
|
||||
def get(self, agent_id: str) -> Optional["AgentRuntimeState"]:
|
||||
return self._states.get(agent_id)
|
||||
|
||||
def list_agents(self) -> list[str]:
|
||||
return list(self._states.keys())
|
||||
|
||||
def clear(self) -> None:
|
||||
self._states.clear()
|
||||
Reference in New Issue
Block a user