Vinsmart06 commited on
Commit
e3493b7
·
verified ·
1 Parent(s): 72ffd16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -113,27 +113,27 @@ class BasicAgent:
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
 
 
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