64 lines
1.7 KiB
Python
64 lines
1.7 KiB
Python
"""Agent Team swarms adapter package."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from importlib import import_module
|
|
from typing import Any
|
|
|
|
__all__ = [
|
|
"AgentTeamOrchestrator",
|
|
"BridgeAttempt",
|
|
"BridgeResult",
|
|
"ExecutionMode",
|
|
"NanobotAgentAdapter",
|
|
"ProcedureMemory",
|
|
"ProcedureRecord",
|
|
"ResolvedTeamPlan",
|
|
"RunMemory",
|
|
"RunRecord",
|
|
"SwarmsBridge",
|
|
"SwarmsPolicy",
|
|
"SwarmsRunPlanner",
|
|
"SwarmsRunResult",
|
|
"SwarmsRunSpec",
|
|
]
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
if name == "AgentTeamOrchestrator":
|
|
from nanobot.agent_team.orchestrator import AgentTeamOrchestrator
|
|
|
|
return AgentTeamOrchestrator
|
|
if name == "NanobotAgentAdapter":
|
|
from nanobot.agent_team.swarms_adapter import NanobotAgentAdapter
|
|
|
|
return NanobotAgentAdapter
|
|
if name == "SwarmsBridge":
|
|
from nanobot.agent_team.swarms_bridge import SwarmsBridge
|
|
|
|
return SwarmsBridge
|
|
if name == "SwarmsPolicy":
|
|
from nanobot.agent_team.swarms_policy import SwarmsPolicy
|
|
|
|
return SwarmsPolicy
|
|
if name == "SwarmsRunPlanner":
|
|
from nanobot.agent_team.swarms_planner import SwarmsRunPlanner
|
|
|
|
return SwarmsRunPlanner
|
|
if name in {"ProcedureMemory", "RunMemory"}:
|
|
memory = import_module("nanobot.agent_team.memory")
|
|
return getattr(memory, name)
|
|
if name in {
|
|
"BridgeAttempt",
|
|
"BridgeResult",
|
|
"ExecutionMode",
|
|
"ProcedureRecord",
|
|
"ResolvedTeamPlan",
|
|
"RunRecord",
|
|
"SwarmsRunResult",
|
|
"SwarmsRunSpec",
|
|
}:
|
|
types = import_module("nanobot.agent_team.types")
|
|
return getattr(types, name)
|
|
raise AttributeError(name)
|