MCPcopy Create free account
hub / github.com/Integuru-AI/Integuru / check_end_condition

Function check_end_condition

integuru/graph_builder.py:7–19  ·  view source on GitHub ↗
(state, agent, to_generate_code)

Source from the content-addressed store, hash-verified

5from integuru.util.print import print_dag, visualize_dag, print_dag_in_reverse
6
7def check_end_condition(state, agent, to_generate_code):
8 agent.dag_manager.detect_cycles()
9
10 if len(state.get("to_be_processed_nodes", [])) == 0:
11 print("------------------------Successfully analyzed!!!-------------------------------", flush=True)
12 print_dag(agent.dag_manager.graph, agent.global_master_node_id)
13 visualize_dag(agent.dag_manager.graph)
14 print_dag_in_reverse(agent.dag_manager.graph, to_generate_code=to_generate_code)
15 return "end"
16 else:
17 print("Continuing execution", flush=True)
18 print(f"Generated graph at current step: {print_dag(agent.dag_manager.graph, agent.global_master_node_id)}", flush=True)
19 return "continue"
20
21
22def build_graph(prompt, har_file_path="network_requests.har", cookie_path="cookies.json", to_generate_code=False):

Callers

nothing calls this directly

Calls 4

print_dagFunction · 0.90
visualize_dagFunction · 0.90
print_dag_in_reverseFunction · 0.90
detect_cyclesMethod · 0.80

Tested by

no test coverage detected