Skip to content

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.

Fixed issues with benchmarking

SwiftyOSd38d3920d797
diff --git a/.env.example b/.env.example
index 251b51f28b..088ff34fc5 100644
--- a/.env.example
+++ b/.env.example
@@ -1,9 +1,11 @@
# Your OpenAI API Key. If GPT-4 is available it will use that, otherwise will use 3.5-turbo
-OPENAI_API_KEY=MY-API-KEY
-
+OPENAI_API_KEY=abc
# If you want to enable Helicone proxy and caching
-# HELICONE_KEY=MY-HELICONE-KEY
-# OPENAI_API_BASE=https://oai.hconeai.com/v1
+HELICONE_KEY=abc
+OPENAI_API_BASE=https://oai.hconeai.com/v1
# Control log level
-LOG_LEVEL=INFO
\ No newline at end of file
+LOG_LEVEL=INFO
+DATABASE_NAME="./agent.db"
+PORT=8000
+AGENT_WORKSPACE="agbenchmark/workspace"
\ No newline at end of file
diff --git a/autogpt/__main__.py b/autogpt/__main__.py
index c2ec549347..8c27bcac28 100644
--- a/autogpt/__main__.py
+++ b/autogpt/__main__.py
@@ -11,9 +11,11 @@ if __name__ == "__main__":
load_dotenv()
database_name = os.getenv("DATABASE_NAME")
port = os.getenv("PORT")
+ workspace = os.getenv("AGENT_WORKSPACE")
auto_gpt = autogpt.agent.AutoGPT()
database = autogpt.db.AgentDB(database_name)
agent = Agent.setup_agent(auto_gpt.task_handler, auto_gpt.step_handler)
agent.db = database
+ agent.workspace = workspace
agent.start(port=port)
diff --git a/autogpt/agent.py b/autogpt/agent.py
index aee4657657..4328dddfd0 100644
--- a/autogpt/agent.py
+++ b/autogpt/agent.py
@@ -14,10 +14,12 @@ class AutoGPT:
await Agent.db.create_step(task.task_id, task.input, is_last=True)
time.sleep(2)
autogpt.utils.run(task.input)
+ # print(f"Created Task id: {task.task_id}")
+ return task
async def step_handler(self, step: Step) -> Step:
- print(f"step: {step.input}")
+ # print(f"step: {step}")
agent_step = await Agent.db.get_step(step.task_id, step.step_id)
updated_step: Step = await Agent.db.update_step(agent_step.task_id, agent_step.step_id, status="completed")
updated_step.output = agent_step.input
diff --git a/autogpt/db.py b/autogpt/db.py
index 1597f264d1..3c85e5225b 100644
--- a/autogpt/db.py
+++ b/autogpt/db.py
@@ -137,7 +137,7 @@ class AgentDB(TaskDB):
for step in steps:
status = Status.created if step[3] == "created" else Status.completed
task.steps.append(Step(task_id=step[1], step_id=step[0], name=step[2], status=status, is_last=True if step[4] == 1 else False, additional_properties=step[5]))
- print(f"Task: {task}")
+ # print(f"Getting task {task_id}.... Task details: {task}")
return task
else:
raise DataNotFoundError("Task not found")
@@ -149,7 +149,14 @@ class AgentDB(TaskDB):
"SELECT * FROM steps WHERE task_id=? AND step_id=?", (task_id, step_id)
)
if step := cursor.fetchone():
- return Step(task_id=task_id, step_id=step_id, name=step[2], status=step[3])
+ return Step(
+ task_id=task_id,
+ step_id=step_id,
+ name=step[2],
+ status=step[3],
+ is_last=step[4] == 1,
+ additional_properties=step[5],
+ )
else:
raise DataNotFoundError("Step not found")
diff --git a/run b/run
new file mode 100755
index 0000000000..11a3c11e1b
--- /dev/null
+++ b/run
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+export PYTHONPATH=$PYTHONPATH:$PWD
+
+python -m autogpt "$@"
+