Spaces:
Sleeping
Sleeping
geadmin
commited on
Commit
·
2075a30
1
Parent(s):
119632c
add question in error
Browse files
app.py
CHANGED
@@ -18,16 +18,16 @@ class BasicAgent:
|
|
18 |
|
19 |
def __call__(self, question: str) -> str:
|
20 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
|
|
21 |
# fixed_answer = "This is a default answer."
|
22 |
# print(f"Agent returning fixed answer: {fixed_answer}")
|
23 |
# return fixed_answer
|
24 |
-
try:
|
25 |
result = self.agent.run(question)
|
26 |
print(f"Agent answer: {result}")
|
27 |
return result
|
28 |
except Exception as e:
|
29 |
print(f"Error answering {e}")
|
30 |
-
return f"{
|
31 |
|
32 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
33 |
"""
|
|
|
18 |
|
19 |
def __call__(self, question: str) -> str:
|
20 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
21 |
+
try:
|
22 |
# fixed_answer = "This is a default answer."
|
23 |
# print(f"Agent returning fixed answer: {fixed_answer}")
|
24 |
# return fixed_answer
|
|
|
25 |
result = self.agent.run(question)
|
26 |
print(f"Agent answer: {result}")
|
27 |
return result
|
28 |
except Exception as e:
|
29 |
print(f"Error answering {e}")
|
30 |
+
return f"{e} Error generating answer"
|
31 |
|
32 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
33 |
"""
|