Spaces:
Sleeping
Sleeping
Download agent_plan_solve/graph/build_graph.py from Ashmit003/Research_Agent: direct link, hf CLI and curl.
- Browser
- Download file 716 Bytes
-
https://huggingface.co/spaces/Ashmit003/Research_Agent/resolve/main/agent_plan_solve/graph/build_graph.py
- Command line
-
hf download hf://spaces/Ashmit003/Research_Agent/agent_plan_solve/graph/build_graph.py
-
curl -L -o build_graph.py https://huggingface.co/spaces/Ashmit003/Research_Agent/resolve/main/agent_plan_solve/graph/build_graph.py
716 Bytes
| # 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() |