Spaces:
Running on Zero
Running on Zero
File size: 553 Bytes
aed39aa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | from langgraph.graph import StateGraph, START
from langgraph.prebuilt import ToolNode, tools_condition
from .state import AgentState
from .nodes import assistant_node
from .tools import ALL_TOOLS
def build_graph():
builder = StateGraph(AgentState)
builder.add_node("assistant", assistant_node)
builder.add_node("tools", ToolNode(ALL_TOOLS))
builder.add_edge(START, "assistant")
builder.add_conditional_edges("assistant", tools_condition)
builder.add_edge("tools", "assistant")
return builder.compile() |