wt002 commited on
Commit
f75a052
Β·
verified Β·
1 Parent(s): 7a08145

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +4 -1
agent.py CHANGED
@@ -1133,10 +1133,13 @@ def build_graph(vector_store, provider: str, model_config: dict) -> StateGraph:
1133
  builder.set_entry_point("retriever")
1134
  builder.add_edge("retriever", "assistant")
1135
  builder.add_edge("assistant", "call_llm")
 
 
1136
  builder.add_conditional_edges("call_llm", should_call_tool, {
1137
  "call_tool": "call_tool",
1138
- "end": None
1139
  })
 
1140
  builder.add_edge("call_tool", "call_llm")
1141
 
1142
  return builder.compile()
 
1133
  builder.set_entry_point("retriever")
1134
  builder.add_edge("retriever", "assistant")
1135
  builder.add_edge("assistant", "call_llm")
1136
+ builder.add_node("end", lambda state: state) # Add a terminal node
1137
+
1138
  builder.add_conditional_edges("call_llm", should_call_tool, {
1139
  "call_tool": "call_tool",
1140
+ "end": "end"
1141
  })
1142
+
1143
  builder.add_edge("call_tool", "call_llm")
1144
 
1145
  return builder.compile()