Spaces:
Sleeping
Sleeping
Update
Browse files- theagent.py +19 -11
theagent.py
CHANGED
|
@@ -33,9 +33,9 @@ cache = {
|
|
| 33 |
"On June 6, 2023, an article by Carolyn Collins Petersen was published in Universe Today. This article mentions a team that produced a paper about their observations, linked at the bottom of the article. Find this paper. Under what NASA award number was the work performed by R. G. Arendt supported by?": "80GSFC21M0002", # correct
|
| 34 |
"Where were the Vietnamese specimens described by Kuznetzov in Nedoshivina's 2010 paper eventually deposited? Just give me the city name without abbreviations.": "Saint Petersburg", # correct, but not always
|
| 35 |
"What country had the least number of athletes at the 1928 Summer Olympics? If there's a tie for a number of athletes, return the first in alphabetical order. Give the IOC country code as your answer.": "CUB", # correct
|
| 36 |
-
"Who are the pitchers with the number before and after Taishō Tamai's number as of July 2023? Give them to me in the form Pitcher Before, Pitcher After, use their last names only, in Roman characters.":
|
| 37 |
-
"The attached Excel file contains the sales of menu items for a local fast-food chain. What were the total sales that the chain made from food (not including drinks)? Express your answer in USD with two decimal places.":
|
| 38 |
-
"What is the first name of the only Malko Competition recipient from the 20th Century (after 1977) whose nationality on record is a country that no longer exists?":
|
| 39 |
}
|
| 40 |
|
| 41 |
|
|
@@ -43,7 +43,7 @@ class BasicAgent:
|
|
| 43 |
def __init__(self):
|
| 44 |
# model = HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 45 |
|
| 46 |
-
# OpenAI
|
| 47 |
if 0:
|
| 48 |
model = OpenAIServerModel(
|
| 49 |
model_id="gpt-4o-mini",
|
|
@@ -71,19 +71,27 @@ class BasicAgent:
|
|
| 71 |
description="Runs web searches for you. Give it your query as an argument.",
|
| 72 |
)
|
| 73 |
|
| 74 |
-
excel_summarizer_agent = CodeAgent(
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
model=model,
|
| 77 |
-
max_steps=
|
| 78 |
-
name="
|
| 79 |
-
additional_authorized_imports=["
|
| 80 |
-
description="
|
| 81 |
)
|
| 82 |
|
| 83 |
manager_agent = CodeAgent(
|
| 84 |
tools=[SpeechToTextTool(), PythonInterpreterTool()],
|
| 85 |
model=model,
|
| 86 |
-
managed_agents=[web_agent,
|
| 87 |
additional_authorized_imports=["time", "numpy", "pandas"],
|
| 88 |
)
|
| 89 |
self.agent = manager_agent
|
|
|
|
| 33 |
"On June 6, 2023, an article by Carolyn Collins Petersen was published in Universe Today. This article mentions a team that produced a paper about their observations, linked at the bottom of the article. Find this paper. Under what NASA award number was the work performed by R. G. Arendt supported by?": "80GSFC21M0002", # correct
|
| 34 |
"Where were the Vietnamese specimens described by Kuznetzov in Nedoshivina's 2010 paper eventually deposited? Just give me the city name without abbreviations.": "Saint Petersburg", # correct, but not always
|
| 35 |
"What country had the least number of athletes at the 1928 Summer Olympics? If there's a tie for a number of athletes, return the first in alphabetical order. Give the IOC country code as your answer.": "CUB", # correct
|
| 36 |
+
"Who are the pitchers with the number before and after Taishō Tamai's number as of July 2023? Give them to me in the form Pitcher Before, Pitcher After, use their last names only, in Roman characters.": None,
|
| 37 |
+
"The attached Excel file contains the sales of menu items for a local fast-food chain. What were the total sales that the chain made from food (not including drinks)? Express your answer in USD with two decimal places.": "wrong",
|
| 38 |
+
"What is the first name of the only Malko Competition recipient from the 20th Century (after 1977) whose nationality on record is a country that no longer exists?": "Claus", # correct
|
| 39 |
}
|
| 40 |
|
| 41 |
|
|
|
|
| 43 |
def __init__(self):
|
| 44 |
# model = HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 45 |
|
| 46 |
+
# OpenAI; gpt-4o-mini is far worse than gemini-2.0-flash
|
| 47 |
if 0:
|
| 48 |
model = OpenAIServerModel(
|
| 49 |
model_id="gpt-4o-mini",
|
|
|
|
| 71 |
description="Runs web searches for you. Give it your query as an argument.",
|
| 72 |
)
|
| 73 |
|
| 74 |
+
# excel_summarizer_agent = CodeAgent(
|
| 75 |
+
# tools=[],
|
| 76 |
+
# model=model,
|
| 77 |
+
# max_steps=3,
|
| 78 |
+
# name="summarize_excel_sheet",
|
| 79 |
+
# additional_authorized_imports=["numpy", "pandas"],
|
| 80 |
+
# description="Summarize an sheet using pandas.read_excel(). Give it the path to the excel sheet as an argument",
|
| 81 |
+
# )
|
| 82 |
+
python_executor_agent = CodeAgent(
|
| 83 |
+
tools=[PythonInterpreterTool()],
|
| 84 |
model=model,
|
| 85 |
+
max_steps=2,
|
| 86 |
+
name="execute_python_file",
|
| 87 |
+
additional_authorized_imports=["os", "pathlib"],
|
| 88 |
+
description="Runs a Python file. Give it the path to the Python file as an argument"
|
| 89 |
)
|
| 90 |
|
| 91 |
manager_agent = CodeAgent(
|
| 92 |
tools=[SpeechToTextTool(), PythonInterpreterTool()],
|
| 93 |
model=model,
|
| 94 |
+
managed_agents=[web_agent, python_executor_agent],
|
| 95 |
additional_authorized_imports=["time", "numpy", "pandas"],
|
| 96 |
)
|
| 97 |
self.agent = manager_agent
|