Thanh Vinh Vo
commited on
Commit
·
bad363e
1
Parent(s):
bc0254c
update
Browse files
app.py
CHANGED
|
@@ -240,22 +240,7 @@ class BasicAgent:
|
|
| 240 |
verbosity_level=0,
|
| 241 |
max_steps=10,
|
| 242 |
)
|
| 243 |
-
|
| 244 |
-
self.manager_agent = CodeAgent(
|
| 245 |
-
model=InferenceClientModel(
|
| 246 |
-
model_id="Qwen/Qwen2.5-32B-Instruct"
|
| 247 |
-
),
|
| 248 |
-
tools=[get_file, audio_to_text],
|
| 249 |
-
managed_agents=[
|
| 250 |
-
self.multimodal_agent,
|
| 251 |
-
self.code_agent],
|
| 252 |
-
additional_authorized_imports=[
|
| 253 |
-
"pandas"
|
| 254 |
-
],
|
| 255 |
-
planning_interval=5,
|
| 256 |
-
max_steps=10,
|
| 257 |
-
)
|
| 258 |
-
|
| 259 |
def __call__(self, question: str, question_id: str, file_name: str) -> str:
|
| 260 |
print(f"Agent received question: {question}")
|
| 261 |
file = f"Mentioned file: {file_name}" if file_name else ""
|
|
@@ -264,8 +249,10 @@ class BasicAgent:
|
|
| 264 |
"{question}""{file}"
|
| 265 |
Please follow rules below:
|
| 266 |
1. Take the question literally! Do not add any additional information or assumptions.
|
|
|
|
|
|
|
| 267 |
"""
|
| 268 |
-
result = self.
|
| 269 |
print(f"Agent responded with: {result}")
|
| 270 |
return result
|
| 271 |
|
|
|
|
| 240 |
verbosity_level=0,
|
| 241 |
max_steps=10,
|
| 242 |
)
|
| 243 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
def __call__(self, question: str, question_id: str, file_name: str) -> str:
|
| 245 |
print(f"Agent received question: {question}")
|
| 246 |
file = f"Mentioned file: {file_name}" if file_name else ""
|
|
|
|
| 249 |
"{question}""{file}"
|
| 250 |
Please follow rules below:
|
| 251 |
1. Take the question literally! Do not add any additional information or assumptions.
|
| 252 |
+
2. `wikipedia` Python package is provided, we should use it to search and retrieve Wikipedia pages.
|
| 253 |
+
3. `pandas` Python package is provided, we should use it to extract table data from Wikipedia pages.
|
| 254 |
"""
|
| 255 |
+
result = self.code_agent.run(prompt)
|
| 256 |
print(f"Agent responded with: {result}")
|
| 257 |
return result
|
| 258 |
|