cafierom commited on
Commit
e895bb0
·
verified ·
1 Parent(s): 61ec9db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -349,7 +349,10 @@ def parser_node(state: State) -> State:
349
  query_task = state["query_task"]
350
  tool_choice = state["tool_choice"]
351
 
352
- if (tool_choice[0] == None) and (tool_choice[1] == None):
 
 
 
353
  state["loop_again"] = "finish_gracefully"
354
  return state
355
 
@@ -445,7 +448,7 @@ def loop_or_not(state):
445
  print(f"(line 417) Loop? {state['loop_again']}")
446
  if state["loop_again"] == "loop_again":
447
  return True
448
- elif tate["loop_again"] == "finish_gracefully":
449
  return 'lets_get_outta_here'
450
  else:
451
  return False
 
349
  query_task = state["query_task"]
350
  tool_choice = state["tool_choice"]
351
 
352
+ if type(tool_choice) != tuple and tool_choice == None:
353
+ state["loop_again"] = "finish_gracefully"
354
+ return state
355
+ elif type(tool_choice) == tuple and (tool_choice[0] == None) and (tool_choice[1] == None):
356
  state["loop_again"] = "finish_gracefully"
357
  return state
358
 
 
448
  print(f"(line 417) Loop? {state['loop_again']}")
449
  if state["loop_again"] == "loop_again":
450
  return True
451
+ elif state["loop_again"] == "finish_gracefully":
452
  return 'lets_get_outta_here'
453
  else:
454
  return False