Fixed 'str' object is not callable error.
Browse files
app.py
CHANGED
@@ -25,8 +25,11 @@ class BasicAgent:
|
|
25 |
|
26 |
try:
|
27 |
search_result = self.agent.run(question) # CodeAgent typically uses .run()
|
28 |
-
#
|
29 |
-
|
|
|
|
|
|
|
30 |
except Exception as e:
|
31 |
answer = f"Error during search: {e}"
|
32 |
|
|
|
25 |
|
26 |
try:
|
27 |
search_result = self.agent.run(question) # CodeAgent typically uses .run()
|
28 |
+
# Make sure search_result is treated as a string, not as a callable object
|
29 |
+
if callable(search_result):
|
30 |
+
answer = f"Search result for '{question[:50]}...': {search_result()}"
|
31 |
+
else:
|
32 |
+
answer = f"Search result for '{question[:50]}...': {search_result}"
|
33 |
except Exception as e:
|
34 |
answer = f"Error during search: {e}"
|
35 |
|