File size: 543 Bytes
2febe44
 
 
cbc325b
b7a20f0
 
cbc325b
 
 
 
 
 
 
2febe44
cbc325b
2febe44
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# LangGraph definition: retrieval only. Generation moved to the Gradio +
# ZeroGPU UI Space (see PLAN.md's "Inference architecture" section) since
# ZeroGPU only runs inside a Gradio Space process, not a remote backend call.
from langgraph.graph import StateGraph, END
from script.state import GraphState
from script.retriever import retrieve

def build_graph():
    graph = StateGraph(GraphState)

    graph.add_node("retrieve", retrieve)

    graph.set_entry_point("retrieve")
    graph.add_edge("retrieve", END)

    return graph.compile()