45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
"""Web UI dashboard model for agent execution visibility."""
|
|
|
|
from .agent_observability import AgentObservability
|
|
|
|
|
|
class AgentObservabilityDashboard:
|
|
def __init__(self, observability: AgentObservability | None = None):
|
|
self.observability = observability or AgentObservability()
|
|
|
|
def overview(self, user_id: str | None = None):
|
|
return {
|
|
"route": "/admin/ai-evolution/agents",
|
|
"title": "Agent Orchestration Observability",
|
|
"summary": self.observability.summary(user_id),
|
|
"views": [
|
|
{
|
|
"name": "scheduler_flow",
|
|
"title": "OpenClaw/Hermes 调度流程",
|
|
"data": self.observability.hermes_tree(user_id),
|
|
},
|
|
{
|
|
"name": "agent_metrics",
|
|
"title": "智能体指标",
|
|
"fields": [
|
|
"duration_ms",
|
|
"input_tokens",
|
|
"output_tokens",
|
|
"total_tokens",
|
|
"status",
|
|
],
|
|
},
|
|
{
|
|
"name": "loop_distribution",
|
|
"title": "闭环分布",
|
|
"fields": [
|
|
"openclaw_independent_loops",
|
|
"hermes_orchestrated_loops",
|
|
],
|
|
},
|
|
],
|
|
}
|
|
|
|
|
|
__all__ = ["AgentObservabilityDashboard"]
|