Thanh Vinh Vo
commited on
Commit
·
1754b4c
1
Parent(s):
51c0d67
update
Browse files
app.py
CHANGED
|
@@ -80,19 +80,15 @@ class BasicAgent:
|
|
| 80 |
additional_authorized_imports=[
|
| 81 |
"requests",
|
| 82 |
"bs4",
|
| 83 |
-
"markdownify",
|
| 84 |
-
"wikipedia",
|
| 85 |
"pandas",
|
| 86 |
"io",
|
| 87 |
"PIL",
|
| 88 |
"chess",
|
| 89 |
"img2text",
|
| 90 |
-
"chess.pgn",
|
| 91 |
"PIL.Image",
|
| 92 |
"bytes",
|
| 93 |
"cv2",
|
| 94 |
"numpy",
|
| 95 |
-
"chess.engine",
|
| 96 |
],
|
| 97 |
name="multimodal_agent",
|
| 98 |
description="""
|
|
@@ -128,6 +124,11 @@ class BasicAgent:
|
|
| 128 |
I am strong at:
|
| 129 |
- Writing code to solve problem.
|
| 130 |
- Browse the web to find information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
""",
|
| 132 |
verbosity_level=0,
|
| 133 |
max_steps=10,
|
|
@@ -145,13 +146,9 @@ class BasicAgent:
|
|
| 145 |
"requests",
|
| 146 |
"bs4",
|
| 147 |
"markdownify",
|
| 148 |
-
"wikipedia",
|
| 149 |
"pandas",
|
| 150 |
"io",
|
| 151 |
"PIL",
|
| 152 |
-
"chess",
|
| 153 |
-
"img2text",
|
| 154 |
-
"chess.pgn",
|
| 155 |
"PIL.Image",
|
| 156 |
"bytes",
|
| 157 |
"cv2",
|
|
@@ -167,12 +164,7 @@ class BasicAgent:
|
|
| 167 |
prompt = f"""
|
| 168 |
Answer the following question:
|
| 169 |
"{question} {"The file name for this question is: " if has_file else ""} {question_id}"
|
| 170 |
-
|
| 171 |
-
Please follow hints below:
|
| 172 |
-
1. `wikipedia` Python package is provided to interact with Wikipedia.
|
| 173 |
-
2. `pandas` Python package is provided. Please use it when there is need to extract structured data (such as tables) from HTML content.
|
| 174 |
-
3. `chess` Python package is provided. Please use it when there is need to solve chess problems.
|
| 175 |
-
4. Please take the question literally! Do not add any additional information or assumptions.
|
| 176 |
"""
|
| 177 |
result = self.manager_agent.run(prompt)
|
| 178 |
print(f"Agent responded with: {result}")
|
|
|
|
| 80 |
additional_authorized_imports=[
|
| 81 |
"requests",
|
| 82 |
"bs4",
|
|
|
|
|
|
|
| 83 |
"pandas",
|
| 84 |
"io",
|
| 85 |
"PIL",
|
| 86 |
"chess",
|
| 87 |
"img2text",
|
|
|
|
| 88 |
"PIL.Image",
|
| 89 |
"bytes",
|
| 90 |
"cv2",
|
| 91 |
"numpy",
|
|
|
|
| 92 |
],
|
| 93 |
name="multimodal_agent",
|
| 94 |
description="""
|
|
|
|
| 124 |
I am strong at:
|
| 125 |
- Writing code to solve problem.
|
| 126 |
- Browse the web to find information.
|
| 127 |
+
- Solving chess problems.
|
| 128 |
+
I have access to the following python packages:
|
| 129 |
+
1. `wikipedia`: to interact with Wikipedia.
|
| 130 |
+
2. `pandas`: to extract structured data (such as tables) from HTML content.
|
| 131 |
+
3. `chess`: to solve chess problems.
|
| 132 |
""",
|
| 133 |
verbosity_level=0,
|
| 134 |
max_steps=10,
|
|
|
|
| 146 |
"requests",
|
| 147 |
"bs4",
|
| 148 |
"markdownify",
|
|
|
|
| 149 |
"pandas",
|
| 150 |
"io",
|
| 151 |
"PIL",
|
|
|
|
|
|
|
|
|
|
| 152 |
"PIL.Image",
|
| 153 |
"bytes",
|
| 154 |
"cv2",
|
|
|
|
| 164 |
prompt = f"""
|
| 165 |
Answer the following question:
|
| 166 |
"{question} {"The file name for this question is: " if has_file else ""} {question_id}"
|
| 167 |
+
Please take the question literally! Do not add any additional information or assumptions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
"""
|
| 169 |
result = self.manager_agent.run(prompt)
|
| 170 |
print(f"Agent responded with: {result}")
|