naman1102 commited on
Commit
9a37625
·
1 Parent(s): cd98238

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -140,9 +140,12 @@ graph.add_edge(START, "plan")
140
 
141
 
142
 
143
- # 4) After plan, we branch based on whether a tool key was set:
144
- # If plan_node set web_search_query/ocr_path/excel_path, go to "tools"; otherwise go straight to "finalize".
145
- def route_plan(state: AgentState, plan_out: AgentState) -> str:
 
 
 
146
  if plan_out.get("web_search_query") or plan_out.get("ocr_path") or plan_out.get("excel_path"):
147
  return "tools"
148
  return "finalize"
@@ -154,6 +157,7 @@ graph.add_conditional_edges(
154
  )
155
 
156
 
 
157
  graph.add_edge("tools", "run_tools")
158
 
159
  # 5.e) run_tools → finalize
 
140
 
141
 
142
 
143
+
144
+ def route_plan(plan_out: AgentState) -> str:
145
+ """
146
+ plan_out is exactly what plan_node returned (a partial AgentState).
147
+ If it set any of the tool-request keys, route to 'tools'; otherwise 'finalize'.
148
+ """
149
  if plan_out.get("web_search_query") or plan_out.get("ocr_path") or plan_out.get("excel_path"):
150
  return "tools"
151
  return "finalize"
 
157
  )
158
 
159
 
160
+
161
  graph.add_edge("tools", "run_tools")
162
 
163
  # 5.e) run_tools → finalize