Update app.py
Browse files
app.py
CHANGED
|
@@ -113,27 +113,27 @@ class BasicAgent:
|
|
| 113 |
return ""
|
| 114 |
def execute_tool(self, tool, input_data, file_url):
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
|
| 138 |
def agent_loop(self, question, file_url):
|
| 139 |
|
|
|
|
| 113 |
return ""
|
| 114 |
def execute_tool(self, tool, input_data, file_url):
|
| 115 |
|
| 116 |
+
if tool == "wiki_search":
|
| 117 |
+
return self.wiki_search(input_data)
|
| 118 |
+
|
| 119 |
+
if tool == "scrape_page":
|
| 120 |
+
return self.scrape_page(input_data)
|
| 121 |
+
|
| 122 |
+
if tool == "read_excel":
|
| 123 |
+
file = self.download_file(file_url)
|
| 124 |
+
return self.read_excel(file)
|
| 125 |
+
|
| 126 |
+
if tool == "read_image":
|
| 127 |
+
file = self.download_file(file_url)
|
| 128 |
+
return self.read_image(file)
|
| 129 |
+
|
| 130 |
+
if tool == "calculator":
|
| 131 |
+
try:
|
| 132 |
+
return str(eval(input_data))
|
| 133 |
+
except:
|
| 134 |
+
return "error"
|
| 135 |
+
|
| 136 |
+
return "unknown tool"
|
| 137 |
|
| 138 |
def agent_loop(self, question, file_url):
|
| 139 |
|