Spaces:
Sleeping
Sleeping
Upload agent.py
Browse files
agent.py
CHANGED
@@ -78,12 +78,16 @@ class GAIAAgent(CodeAgent):
|
|
78 |
# Convenience so the object itself can be *called* directly
|
79 |
def __call__(self, question: str, **kwargs: Any) -> str:
|
80 |
steps = self.run(question, **kwargs)
|
|
|
|
|
|
|
|
|
81 |
last_step = None
|
82 |
for step in steps:
|
83 |
last_step = step
|
84 |
-
|
85 |
answer = getattr(last_step, "answer", None)
|
86 |
-
|
87 |
if answer is not None:
|
88 |
return str(answer).strip()
|
89 |
return str(last_step).strip()
|
|
|
78 |
# Convenience so the object itself can be *called* directly
|
79 |
def __call__(self, question: str, **kwargs: Any) -> str:
|
80 |
steps = self.run(question, **kwargs)
|
81 |
+
if isinstance(steps, str):
|
82 |
+
print("DEBUG: steps is a string:", repr(steps))
|
83 |
+
return steps.strip()
|
84 |
+
print("DEBUG: steps is a", type(steps))
|
85 |
last_step = None
|
86 |
for step in steps:
|
87 |
last_step = step
|
88 |
+
print("DEBUG: last_step =", repr(last_step))
|
89 |
answer = getattr(last_step, "answer", None)
|
90 |
+
print("DEBUG: answer =", repr(answer))
|
91 |
if answer is not None:
|
92 |
return str(answer).strip()
|
93 |
return str(last_step).strip()
|