Spaces:
Sleeping
Sleeping
| # agent_plan_solve/graph/graph.py | |
| from langgraph.graph import StateGraph, START, END | |
| from agent_plan_solve.graph.state import PlanState | |
| from agent_plan_solve.graph.nodes import ( | |
| _build_initial_plan, | |
| _run_step, | |
| _get_final_response, | |
| _should_continue | |
| ) | |
| __all__ = ["graph"] | |
| print("✅ build_graph.py loaded") | |
| # Build the LangGraph | |
| builder = StateGraph(PlanState) | |
| builder.add_node("initial_plan", _build_initial_plan) | |
| builder.add_node("run", _run_step) | |
| builder.add_node("response", _get_final_response) | |
| builder.add_edge(START, "initial_plan") | |
| builder.add_edge("initial_plan", "run") | |
| builder.add_conditional_edges("run", _should_continue) | |
| builder.add_edge("response", END) | |
| graph = builder.compile() |