mmichiels13 commited on
Commit
93ee42a
·
verified ·
1 Parent(s): cfefd14

Updated to return final_answer

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -35,6 +35,16 @@ class BasicAgent:
35
  print(f"Agent received question (first 50 chars): {question[:50]}...")
36
  fixed_answer = "This is a default answer."
37
  print(f"Agent returning fixed answer: {fixed_answer}")
 
 
 
 
 
 
 
 
 
 
38
  return fixed_answer
39
 
40
  def run_and_submit_all( profile: gr.OAuthProfile | None):
 
35
  print(f"Agent received question (first 50 chars): {question[:50]}...")
36
  fixed_answer = "This is a default answer."
37
  print(f"Agent returning fixed answer: {fixed_answer}")
38
+
39
+ try:
40
+ # Run the agent with the question
41
+ answer = self.agent.run(question)
42
+ print(f"Agent returning answer: {answer[:100]}...")
43
+ fixed_answer = answer
44
+ except Exception as e:
45
+ print(f"Agent error: {e}")
46
+ fixed_answer = f"I encountered an error: {str(e)}"
47
+
48
  return fixed_answer
49
 
50
  def run_and_submit_all( profile: gr.OAuthProfile | None):