Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import inspect
|
|
| 5 |
import pandas as pd
|
| 6 |
from tools import (
|
| 7 |
Web_research,
|
| 8 |
-
|
| 9 |
Wikipedia_reader,
|
| 10 |
translate_everything,
|
| 11 |
Find_wikipedia_URL,
|
|
@@ -35,7 +35,7 @@ class BasicAgent:
|
|
| 35 |
print("BasicAgent initialized.")
|
| 36 |
# Load tools only once
|
| 37 |
self.web_search = Web_research()
|
| 38 |
-
self.
|
| 39 |
self.python_code_tool = PythonInterpreterTool()
|
| 40 |
self.wiki_tool = Wikipedia_reader()
|
| 41 |
self.translator = translate_everything()
|
|
@@ -51,7 +51,7 @@ class BasicAgent:
|
|
| 51 |
self.translator,
|
| 52 |
self.wiki_tool,
|
| 53 |
self.web_search,
|
| 54 |
-
self.
|
| 55 |
self.python_code_tool,
|
| 56 |
self.audio_tool,
|
| 57 |
self.vegetable_info_retriever,
|
|
@@ -73,9 +73,11 @@ class BasicAgent:
|
|
| 73 |
"(2) If the question is in English, do not use the translator. Determine whether it requires a web search, "
|
| 74 |
"and if so, use only the exact words from the question as keywords—no synonyms. "
|
| 75 |
"(3) If a web search is needed and the answer is likely on Wikipedia, try using the wiki_url_tool to find the relevant page; "
|
| 76 |
-
"if that fails, search manually; if you
|
| 77 |
-
"(4) Never use synonyms not present in the question.
|
| 78 |
-
"If
|
|
|
|
|
|
|
| 79 |
"FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. "
|
| 80 |
"If you are asked for a number, don’t use comma to write your number neither use units such as $ or percent sign unless specified otherwise. "
|
| 81 |
"If you are asked for a string, don’t use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. "
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
from tools import (
|
| 7 |
Web_research,
|
| 8 |
+
image_interpreter,
|
| 9 |
Wikipedia_reader,
|
| 10 |
translate_everything,
|
| 11 |
Find_wikipedia_URL,
|
|
|
|
| 35 |
print("BasicAgent initialized.")
|
| 36 |
# Load tools only once
|
| 37 |
self.web_search = Web_research()
|
| 38 |
+
self.image_tool = image_interpreter()
|
| 39 |
self.python_code_tool = PythonInterpreterTool()
|
| 40 |
self.wiki_tool = Wikipedia_reader()
|
| 41 |
self.translator = translate_everything()
|
|
|
|
| 51 |
self.translator,
|
| 52 |
self.wiki_tool,
|
| 53 |
self.web_search,
|
| 54 |
+
self.image_tool,
|
| 55 |
self.python_code_tool,
|
| 56 |
self.audio_tool,
|
| 57 |
self.vegetable_info_retriever,
|
|
|
|
| 73 |
"(2) If the question is in English, do not use the translator. Determine whether it requires a web search, "
|
| 74 |
"and if so, use only the exact words from the question as keywords—no synonyms. "
|
| 75 |
"(3) If a web search is needed and the answer is likely on Wikipedia, try using the wiki_url_tool to find the relevant page; "
|
| 76 |
+
"if that fails, search manually; if you read a wikipedia page, always use the wiki_tool to extract data from Wikipedia tables. They may be usefull to answer the questions. "
|
| 77 |
+
"(4) Never use synonyms not present in the question. "
|
| 78 |
+
"(5) If the input contains an image, use image_tool to describe it. If it contains an mp3 audio, use audio_tool to translate it to text."
|
| 79 |
+
"(6) If you need to know the list of vegetables, you will find it with vegetable_info_retriever."
|
| 80 |
+
"Never make assumptions to answer a question. . If you do not know the answer, say so clearly. Always report your thoughts and finish your answer with the following template: "
|
| 81 |
"FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. "
|
| 82 |
"If you are asked for a number, don’t use comma to write your number neither use units such as $ or percent sign unless specified otherwise. "
|
| 83 |
"If you are asked for a string, don’t use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. "
|