wlchee commited on
Commit
37f6085
·
verified ·
1 Parent(s): eff97f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -75,11 +75,17 @@ class BasicAgent:
75
 
76
 
77
  def __call__(self, question: str) -> str:
78
- print(f"Agent received question (first 50 chars): {question[:50]}...")
79
- fixed_answer = "This is a default answer."
80
- print(f"Agent returning fixed answer: {fixed_answer}")
81
- return fixed_answer
82
-
 
 
 
 
 
 
83
 
84
 
85
 
 
75
 
76
 
77
  def __call__(self, question: str) -> str:
78
+ print(f"Agent received question (first 100 chars): {question[:100]}...")
79
+ #fixed_answer = "This is a default answer."
80
+ #print(f"Agent returning fixed answer: {fixed_answer}")
81
+ #return fixed_answer
82
+ try:
83
+ # Use the CodeAgent to handle the question
84
+ response = self.agent.run(question)
85
+ return response
86
+ except Exception as e:
87
+ print(f"Error in agent processing: {e}")
88
+ return f"An error occurred while processing your question: {str(e)}"
89
 
90
 
91