Spaces:
Running
Running
| #!/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() | |