feat(rnd): add FastAPI support to existing project outline (#7165)

### Background

###### Project Outline
Currently, the project mainly consists of these components:

*agent_api*
A component that will expose API endpoints for the creation & execution of agents.
This component will make connections to the database to persist and read the agents.
It will also trigger the agent execution by pushing its execution request to the ExecutionQueue.

*agent_executor*
A component that will execute the agents.
This component will be a pool of processes/threads that will consume the ExecutionQueue and execute the agent accordingly. 
The result and progress of its execution will be persisted in the database.

###### How to test
Execute `poetry run app`. 
Access the swagger page `http://localhost:8000/docs`, there is one API to trigger an execution of one dummy slow task, you fire the API a couple of times and see the `agent_executor` executes the multiple slow tasks concurrently by the pool of Python processes.
The pool size is currently set to `5` (hardcoded in app.py, the code entry point).

##### Changes 🏗️

* Initialize FastAPI for the AutoGPT server project.
* Reduced number of queues to 1 and abstracted into `ExecutionQueue` class.
* Reduced the number of main components into two `api` and `executor`.
This commit is contained in:
Zamil Majdy
2024-06-03 11:39:01 +07:00
committed by GitHub
parent 4e76768bc9
commit 7a932cdf00
21 changed files with 1340 additions and 295 deletions

1151
rnd/autogpt_server/poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff