-
Notifications
You must be signed in to change notification settings - Fork 43.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
123 additions
and
132 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
autogpts/autogpt/agbenchmark_config/challenges_already_beaten.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"TestWriteFile": true, | ||
"TestReadFile": true, | ||
"TestSortCsv": true, | ||
"TestAnswerQuestionSmallCsv": true, | ||
"TestCombineCsv": true, | ||
"TestLabelCsv": true, | ||
"TestAnswerQuestionCsv": true, | ||
"TestAnswerQuestionCombineCsv": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Age,ID,Name,Occupation,Salary | ||
28,101,John,Engineer,80000 | ||
34,102,Alice,Doctor,120000 | ||
45,103,Bob,Lawyer,95000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Next Gen AutoGPT | ||
|
||
This is a research project into creating the next generation of autogpt, which is an autogpt agent server. | ||
|
||
It will come with the AutoGPT Agent as the default agent | ||
|
||
|
||
## Project Outline | ||
|
||
The project mainly consist of two main component: | ||
|
||
agent_server: Responsible as the API server for creating an agent. | ||
agent_executor: Responsible for executor the agent. | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .server import start_server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import uvicorn | ||
|
||
from fastapi import FastAPI | ||
|
||
from autogpt_server.data import ExecutionQueue | ||
|
||
app = FastAPI( | ||
title="AutoGPT Agent Server", | ||
description=( | ||
"This server is used to execute agents that are created by the AutoGPT system." | ||
), | ||
summary="AutoGPT Agent Server", | ||
version="0.1", | ||
) | ||
|
||
execution_queue : ExecutionQueue = None | ||
|
||
@app.post("/agents/{agent_id}/execute") | ||
def execute_agent(agent_id: str): | ||
execution_id = execution_queue.add(agent_id) | ||
return {"execution_id": execution_id, "agent_id": agent_id} | ||
|
||
def start_server(queue: ExecutionQueue): | ||
global execution_queue | ||
execution_queue = queue | ||
uvicorn.run(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .executor import start_executor |
26 changes: 26 additions & 0 deletions
26
rnd/autogpt_server/autogpt_server/agent_executor/executor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import logging | ||
import time | ||
|
||
from concurrent.futures import ThreadPoolExecutor | ||
|
||
from autogpt_server.data import ExecutionQueue | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
# TODO: Replace this by an actual Agent Execution. | ||
def __execute(id: str, data: str) -> None: | ||
for i in range(5): | ||
print(f"Executor processing step {i}, execution_id: {id}, data: {data}") | ||
time.sleep(1) | ||
print(f"Executor processing completed, execution_id: {id}, data: {data}") | ||
|
||
|
||
def start_executor(pool_size: int, queue: ExecutionQueue) -> None: | ||
with ThreadPoolExecutor(max_workers=pool_size) as executor: | ||
while True: | ||
execution = queue.get() | ||
if not execution: | ||
time.sleep(1) | ||
continue | ||
executor.submit(__execute, execution.execution_id, execution.data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from multiprocessing import Process | ||
|
||
from autogpt_server.agent_api import start_server | ||
from autogpt_server.agent_executor import start_executor | ||
from autogpt_server.data import ExecutionQueue | ||
|
||
if __name__ == "__main__": | ||
queue = ExecutionQueue() | ||
executor_process = Process(target=start_executor, args=(5,queue)) | ||
executor_process.start() | ||
start_server(queue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import uuid | ||
|
||
from multiprocessing import Queue | ||
|
||
class Execution: | ||
def __init__(self, execution_id: str, data: str): | ||
self.execution_id = execution_id | ||
self.data = data | ||
|
||
# TODO: Replace this by a persistent queue. | ||
class ExecutionQueue: | ||
def __init__(self): | ||
self.queue = Queue() | ||
|
||
def add(self, data: str) -> str: | ||
execution_id = uuid.uuid4() | ||
self.queue.put(Execution(str(execution_id), data)) | ||
return str(execution_id) | ||
|
||
def get(self) -> Execution | None: | ||
return self.queue.get() | ||
|
||
def empty(self) -> bool: | ||
return self.queue.empty() | ||
|
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
rnd/nextgenautogpt/pyproject.toml → rnd/autogpt_server/pyproject.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python3 -m autogpt_server.app |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.