jlnh commited on
Commit
613f9eb
·
verified ·
1 Parent(s): 28444ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -28,6 +28,8 @@ class BasicAgent:
28
  # Wrap the question in a HumanMessage from langchain_core
29
  messages = [HumanMessage(content=question)]
30
  messages = self.graph.invoke({"messages": messages})
 
 
31
  answer = messages['messages'][-1].content
32
  return answer[14:]
33
 
@@ -99,7 +101,8 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
99
  except Exception as e:
100
  print(f"Error running agent on task {task_id}: {e}")
101
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
102
-
 
103
  if not answers_payload:
104
  print("Agent did not produce any answers to submit.")
105
  return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
 
28
  # Wrap the question in a HumanMessage from langchain_core
29
  messages = [HumanMessage(content=question)]
30
  messages = self.graph.invoke({"messages": messages})
31
+ print(f"messages: {messages}")
32
+ print(f"messages['messages']: {messages['messages']}")
33
  answer = messages['messages'][-1].content
34
  return answer[14:]
35
 
 
101
  except Exception as e:
102
  print(f"Error running agent on task {task_id}: {e}")
103
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
104
+ break
105
+
106
  if not answers_payload:
107
  print("Agent did not produce any answers to submit.")
108
  return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)