Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
@@ -289,10 +289,10 @@ class MagAgent:
|
|
289 |
tools=[
|
290 |
DownloadTaskAttachmentTool(rate_limiter=rate_limiter),
|
291 |
RetryDuckDuckGoSearchTool(),
|
292 |
-
|
293 |
SpeechToTextTool(),
|
294 |
ExcelReaderTool(),
|
295 |
-
|
296 |
PythonCodeReaderTool(),
|
297 |
search_arxiv,
|
298 |
# PNG2FENTool,
|
@@ -320,21 +320,19 @@ class MagAgent:
|
|
320 |
# f"Answer the following question accurately and concisely: \n"
|
321 |
"You are an advanced AI assistant tasked with answering questions from the GAIA benchmark accurately and concisely. Follow these guidelines:\n\n"
|
322 |
"1. **Question Parsing**:\n"
|
323 |
-
" - Carefully analyze the question, paying attention to punctuation such as question marks (?), commas (,), quotes (\"), and parentheses ().\n"
|
324 |
" - If the question includes direct speech or quoted text (e.g., \"Isn't that hot?\"), treat it as a precise query and preserve the quoted structure in your response.\n\n"
|
325 |
"2. **Handling Input Data**:\n"
|
|
|
326 |
" - When processing external data (e.g., YouTube transcripts, web searches), expect potential issues like missing punctuation, inconsistent formatting, or conversational text.\n"
|
327 |
-
" - Infer appropriate punctuation where possible (e.g., add periods or commas to unpunctuated text) to improve clarity without altering meaning.\n"
|
328 |
" - If the input is ambiguous, prioritize extracting key information relevant to the question.\n\n"
|
329 |
"3. **Response Formatting**:\n"
|
330 |
" - Provide answers that are concise, accurate, and properly punctuated according to standard English grammar.\n"
|
331 |
" - Use quotation marks for direct quotes (e.g., \"Extreamly.\") and appropriate punctuation for lists, sentences, or clarifications.\n"
|
332 |
-
" - If the question asks for a specific quote or response (e.g., what a character says), format the answer clearly, e.g., 'Character says, \"Exact quote.\"'\n\n"
|
333 |
" - If asked about name of place or city, use full complete name without abbreviations (e.g. use Saint Petersburg instead of St.Petersburg). \n"
|
334 |
"4. **Error Handling**:\n"
|
335 |
" - If you cannot retrieve or process data (e.g., due to blocked requests), return a clear error message: \"Unable to retrieve data. Please refine the question or check external sources.\"\n\n"
|
336 |
-
f"Answer the following question: {question} \n"
|
337 |
-
|
338 |
# f"Return the answer as a string."
|
339 |
)
|
340 |
print(f"Calling agent.run for task {task_id}...")
|
|
|
289 |
tools=[
|
290 |
DownloadTaskAttachmentTool(rate_limiter=rate_limiter),
|
291 |
RetryDuckDuckGoSearchTool(),
|
292 |
+
WikipediaSearchTool(),
|
293 |
SpeechToTextTool(),
|
294 |
ExcelReaderTool(),
|
295 |
+
VisitWebpageTool(),
|
296 |
PythonCodeReaderTool(),
|
297 |
search_arxiv,
|
298 |
# PNG2FENTool,
|
|
|
320 |
# f"Answer the following question accurately and concisely: \n"
|
321 |
"You are an advanced AI assistant tasked with answering questions from the GAIA benchmark accurately and concisely. Follow these guidelines:\n\n"
|
322 |
"1. **Question Parsing**:\n"
|
|
|
323 |
" - If the question includes direct speech or quoted text (e.g., \"Isn't that hot?\"), treat it as a precise query and preserve the quoted structure in your response.\n\n"
|
324 |
"2. **Handling Input Data**:\n"
|
325 |
+
f" - If the question references an attachment, use tool to download it with task_id: {task_id}\n"
|
326 |
" - When processing external data (e.g., YouTube transcripts, web searches), expect potential issues like missing punctuation, inconsistent formatting, or conversational text.\n"
|
|
|
327 |
" - If the input is ambiguous, prioritize extracting key information relevant to the question.\n\n"
|
328 |
"3. **Response Formatting**:\n"
|
329 |
" - Provide answers that are concise, accurate, and properly punctuated according to standard English grammar.\n"
|
330 |
" - Use quotation marks for direct quotes (e.g., \"Extreamly.\") and appropriate punctuation for lists, sentences, or clarifications.\n"
|
|
|
331 |
" - If asked about name of place or city, use full complete name without abbreviations (e.g. use Saint Petersburg instead of St.Petersburg). \n"
|
332 |
"4. **Error Handling**:\n"
|
333 |
" - If you cannot retrieve or process data (e.g., due to blocked requests), return a clear error message: \"Unable to retrieve data. Please refine the question or check external sources.\"\n\n"
|
334 |
+
f"Answer the following question: \n {question} \n"
|
335 |
+
|
336 |
# f"Return the answer as a string."
|
337 |
)
|
338 |
print(f"Calling agent.run for task {task_id}...")
|