Spaces:
Running
Running
File size: 1,616 Bytes
0e38162 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #!/usr/bin/env python3
"""
Print the agent dependency graph and execution wave plan to the terminal.
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
from agents import (
ParserAgent, KeywordAgent, ClaimAgent, CitationGapAgent,
ArgumentationAgent, ScoringAgent, ReportAgent,
)
from collections import defaultdict
def visualize():
agents = [
ParserAgent(), KeywordAgent(), ClaimAgent(), CitationGapAgent(),
ArgumentationAgent(), ScoringAgent(), ReportAgent(),
]
waves = defaultdict(list)
for a in agents:
waves[a.wave].append(a)
print("\n=== CitationEdge Agent Execution Plan ===\n")
for wave_num in sorted(waves.keys()):
wave_agents = waves[wave_num]
names = ", ".join(
f"{'[CRITICAL]' if a.critical else '[optional]'} {a.name}"
for a in wave_agents
)
parallel_note = "(parallel)" if len(wave_agents) > 1 else "(single)"
print(f" Wave {wave_num} {parallel_note}: {names}")
print("\n=== Dependency Summary ===\n")
deps = {
"parser": [],
"keyword": ["parser"],
"claim": ["parser"],
"citation_gap": ["parser", "keyword"],
"argumentation": ["claim"],
"scoring": ["argumentation", "citation_gap"],
"report": ["scoring"],
}
for agent, agent_deps in deps.items():
dep_str = ", ".join(agent_deps) if agent_deps else "(none)"
print(f" {agent:<20} depends on: {dep_str}")
print()
if __name__ == "__main__":
visualize()
|