AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
benchmark-fix
Merwane Hamadic7550ba84545
diff --git a/benchmark/agbenchmark/__init__.py b/agbenchmark/__init__.pysimilarity index 100%rename from benchmark/agbenchmark/__init__.pyrename to agbenchmark/__init__.pydiff --git a/agbenchmark/config.json b/agbenchmark/config.jsonnew file mode 100644index 0000000000..fee0da3909--- /dev/null+++ b/agbenchmark/config.json@@ -0,0 +1 @@+{"workspace": "workspace"}\ No newline at end of filediff --git a/benchmark/backend/main.py b/benchmark/backend/main.pyindex c0c2bf2df6..03880f0edf 100644--- a/benchmark/backend/main.py+++ b/benchmark/backend/main.py@@ -9,10 +9,11 @@ from typing import Anysys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))-from agbenchmark.utils.utils import find_absolute_benchmark_pathfrom fastapi import FastAPI, Queryfrom fastapi.middleware.cors import CORSMiddleware+from agbenchmark.utils.utils import find_absolute_benchmark_path+app = FastAPI()origins = ["http://localhost:3000"]diff --git a/benchmark/benchmark/conftest.py b/benchmark/benchmark/conftest.pyindex a93867e49d..74e76b0c17 100644--- a/benchmark/benchmark/conftest.py+++ b/benchmark/benchmark/conftest.py@@ -10,13 +10,7 @@ from typing import Any, Dict, Generatorimport pytest-from benchmark.reports.reports import (- finalize_reports,- generate_combined_suite_report,- generate_single_call_report,- session_finish,-)-from benchmark.utils.data_types import AgentBenchmarkConfig, SuiteConfig+from benchmark.utils.data_types import AgentBenchmarkConfigGLOBAL_TIMEOUT = (1500 # The tests will stop after 25 minutes so we can send the reports.@@ -297,7 +291,7 @@ def run_agent(request: Any) -> Any:stdout=subprocess.PIPE,stderr=subprocess.STDOUT,universal_newlines=True,- cwd=agent_benchmark_config_path.entry_path.parent.parent,+ # cwd=agent_benchmark_config_path.entry_path.parent.parent, # even if it's necessary to make it work, let's get rid ot that, this is too complex)time.sleep(3)yielddiff --git a/benchmark/benchmark/generate_test.py b/benchmark/benchmark/generate_test.pyindex fd81058b35..15e0d3ed61 100644--- a/benchmark/benchmark/generate_test.py+++ b/benchmark/benchmark/generate_test.py@@ -231,7 +231,8 @@ def generate_tests() -> None: # sourcery skip: invert-any-all))- agent_config_path = None+ agent_benchmark_config_path = Path.cwd() / "agbenchmark" / "config.json"+if "--agent-config" in sys.argv:agent_benchmark_config_path = sys.argv[sys.argv.index("--agent-config") + 1]else:diff --git a/benchmark/benchmark/start_benchmark.py b/benchmark/benchmark/start_benchmark.pyindex b7cda4bd4c..b47488f54a 100644--- a/benchmark/benchmark/start_benchmark.py+++ b/benchmark/benchmark/start_benchmark.py@@ -12,8 +12,8 @@ from helicone.lock import HeliconeLockManagersys.path.append("/Users/swifty/dev/Auto-GPT/benchmark")-from agbenchmark.reports.ReportManager import ReportManager-from agbenchmark.utils.utils import ( # get_git_commit_sha,+from benchmark.reports.ReportManager import ReportManager+from benchmark.utils.utils import ( # get_git_commit_sha,AGENT_NAME,calculate_dynamic_paths,)diff --git a/benchmark/benchmark/utils/data_types.py b/benchmark/benchmark/utils/data_types.pyindex 57a327cf15..6950ba3168 100644--- a/benchmark/benchmark/utils/data_types.py+++ b/benchmark/benchmark/utils/data_types.py@@ -78,7 +78,6 @@ class AgentBenchmarkConfig(BaseModel):"""This class represents the configuration for the Agent Benchmark.It includes the following attributes:- - entry_path: The path to the file that, when run, starts the agent configured for benchmarking, realtive location from the config_file.- workspace: The path to the workspace where the benchmark will be run.- reports_folder: The path to the folder where the benchmark reports will be stored.- api_mode: A boolean indicating whether the benchmark is run in API mode.@@ -86,7 +85,6 @@ class AgentBenchmarkConfig(BaseModel):"""agent_benchmark_config_path: Path | None = None- entry_path: Pathworkspace: Pathreports_folder: Path | None = Noneapi_mode: bool = False@@ -95,10 +93,7 @@ class AgentBenchmarkConfig(BaseModel):def get_reports_location(self) -> Path:if not self.reports_folder:self.reports_folder = (- self.agent_benchmark_config_path- / self.entry_path.parent- / ".."- / "reports"+ self.agent_benchmark_config_path / "reports").resolve()return self.reports_folderdiff --git a/benchmark/benchmark/utils/utils.py b/benchmark/benchmark/utils/utils.pyindex 8f9dc20552..e0206b0748 100644--- a/benchmark/benchmark/utils/utils.py+++ b/benchmark/benchmark/utils/utils.py@@ -9,6 +9,8 @@ from typing import Any, List, Optionalimport gitfrom dotenv import load_dotenv+from benchmark.utils.data_types import calculate_info_test_path+load_dotenv()from benchmark.utils.data_types import DIFFICULTY_MAP, DifficultyLeveldiff --git a/benchmark/poetry.lock b/benchmark/poetry.lockindex 7d943095a3..9ab909295d 100644--- a/benchmark/poetry.lock+++ b/benchmark/poetry.lock@@ -2367,6 +2367,17 @@ anyio = ">=3.4.0,<5"[package.extras]full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart", "pyyaml"]+[[package]]+name = "toml"+version = "0.10.2"+description = "Python Library for Tom's Obvious, Minimal Language"+optional = false+python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"+files = [+ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"},+ {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},+]+[[package]]name = "tomli"version = "2.0.1"@@ -2669,4 +2680,4 @@ multidict = ">=4.0"[metadata]lock-version = "2.0"python-versions = "^3.10"-content-hash = "e86dcefdd1198516ad76fafb4877fd46f5b8623a7be52e069c3ac39509ba7c4e"+content-hash = "cbfb78cc028636025da583204d77e7903b41b08ec620eb755cb56211a837e0c1"diff --git a/benchmark/pyproject.toml b/benchmark/pyproject.tomlindex caeee5fccc..a6d37fb7e3 100644--- a/benchmark/pyproject.toml+++ b/benchmark/pyproject.toml@@ -31,6 +31,7 @@ pytest-asyncio = "^0.21.1"uvicorn = "^0.23.2"fastapi = "^0.103.1"python-multipart = "^0.0.6"+toml = "^0.10.2"[tool.poetry.group.dev.dependencies]diff --git a/poetry.lock b/poetry.locknew file mode 100644index 0000000000..8802b86e9f--- /dev/null+++ b/poetry.lock@@ -0,0 +1,7 @@+# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.+package = []++[metadata]+lock-version = "2.0"+python-versions = "^3.11"+content-hash = "81b2fa642d7f2d1219cf80112ace12d689d053d81be7f7addb98144d56fc0fb2"