Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web server with create agent endpoint #1139

Conversation

waynehamadi
Copy link
Contributor

@waynehamadi waynehamadi commented Apr 13, 2023

Background

REST API because:

  • soap is old, graphql is oftentimes overkill and not very beginner friendly, gRPC is not yet supported widely by web browsers
  • websockets endpoints will be needed but only to complement the REST API to get live updates. For example if I want to create an agent as a frontend engineer, I don't need to do it through websockets. But websockets will be needed to subscribe to channels (conversations, debugging info, logs, I have many of these channels ready in a branch). These channels will allow a human to understand what his agents are doing, but they can also be used by a mother autoGPT to orchestrate its children.

Changes

Added:

  • the POST /agents endpoint
  • the docker-compose.dev.yml and dockerfile_dev because we need one.

Documentation

Repo of the api following this structure:

Auto-GPT/
├─ autogpt/
│  ├─ models/ ## defines the class that will interact with the DB
│  │  └─ agent.py
│  ├─ tests/ ## tests within the main module, this is very common
│  │  ├─ v1/ ## versioning is key
│  │  │  ├─ features/
│  │  │  │  ├─ agents/
│  │  │  │  │  ├─ create_agents
│  │  │  │  │  ├─ start_agents
│  │  │  │  │  └─ stop_agents
│  │  │  │  ├─ conversation/
│  │  │  │  │  └─ create_conversation
│  │  │  │  ├─ commands/
│  │  │  │  │  └─ create_commands
│  │  │  │  ├─ prompt/
│  │  │  │  │  └─ create_prompts
│  │  │  │  ├─ goals/
│  │  │  │  │  └─ create_goals
│  │  │  │  ├─ metrics/
│  │  │  │  │  └─ create_metrics
│  │  │  │  ├─ events/
│  │  │  │  │  └─ subscribe_events
│  │  │  │  └─ etc...
│  │  │  └─ unit/
│  │  └─ conftest/ ## configuration for tests
├─ v1/
│  ├─ endpoints/ ## all the routes here
│  │  └─ agents.py
│  └─ router/
└─ static/ ## api documentation, very useful to integrate

Test Plan

Screenshot 2023-04-13 at 6 08 39 AM

Screenshot 2023-04-13 at 8 50 25 AM

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@waynehamadi waynehamadi force-pushed the feature/web-server-repo-with-create-agent-endpoint branch from fbe61f6 to 81cecfe Compare April 13, 2023 16:09
@waynehamadi
Copy link
Contributor Author

@Torantulino we can discuss about these additions, I know it's a lot of things added, but that's what we need to set a good direction for the future backend development. I still think autogpt should remain a great CLI, and I will make sure the API and the CLI use the same components.
You can trust me to maintain this api, along with the FastAPI community, which I am sure will be very excited to see AutoGPT use this framework. FastAPI is not very complicated, people that know flask can also maintain it.

@richbeales richbeales added the needs discussion To be discussed among maintainers label Apr 13, 2023
@Swiftyos
Copy link
Contributor

I've been thinking that reorganizing the project by moving the code from scripts into an autogpt module could be beneficial. This modular approach would enhance the organization and maintainability of the codebase, effectively separating concerns and promoting code reusability.

We then could incorporate the API server as a submodule of the autogpt module or as a separate module named server which would further streamline the project structure. This would allow for a clear distinction between the core functionalities and the server component, making it easier to manage and maintain each part independently.

@nponeccop
Copy link
Contributor

@BillSchumacher will improve the organization without breaking things.

@Swiftyos
Copy link
Contributor

@nponeccop and @BillSchumacher I created a PR which starts on the reorg path whilst keeping changes to a minimum:
#1191

@Androbin Androbin mentioned this pull request Apr 17, 2023
5 tasks
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions github-actions bot added conflicts Automatically applied to PRs with merge conflicts labels Apr 17, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

1 similar comment
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@p-i-
Copy link
Contributor

p-i- commented May 5, 2023

This is a mass message from the AutoGPT core team.
Our apologies for the ongoing delay in processing PRs.
This is because we are re-architecting the AutoGPT core!

For more details (and for infor on joining our Discord), please refer to:
https://github.com/Significant-Gravitas/Auto-GPT/wiki/Architecting

SquareandCompass pushed a commit to SquareandCompass/Auto-GPT that referenced this pull request Oct 21, 2023
…avitas#1133)

* simplify the initiation of chat

* version update

* include openai

* completion

* load config list from json

* initiate_chat

* oai config list

* oai config list

* config list

* config_list

* raise_error

* retry_time

* raise condition

* oai config list

* catch file not found

* catch openml error

* handle openml error

* handle openml error

* handle openml error

* handle openml error

* handle openml error

* handle openml error

* close Significant-Gravitas#1139

* use property

* termination msg

* AIUserProxyAgent

* smaller dev container

* update notebooks

* match

* document code execution and AIUserProxyAgent

* gpt 3.5 config list

* rate limit

* variable visibility

* remove unnecessary import

* quote

* notebook comments

* remove mathchat from init import

* two users

* import location

* expose config

* return str not tuple

* rate limit

* ipython user proxy

* message

* None result

* rate limit

* rate limit

* rate limit

* rate limit
SquareandCompass pushed a commit to SquareandCompass/Auto-GPT that referenced this pull request Oct 21, 2023
…ignificant-Gravitas#1142)

* simplify the initiation of chat

* version update

* include openai

* completion

* load config list from json

* initiate_chat

* oai config list

* oai config list

* config list

* config_list

* raise_error

* retry_time

* raise condition

* oai config list

* catch file not found

* catch openml error

* handle openml error

* handle openml error

* handle openml error

* handle openml error

* handle openml error

* handle openml error

* close Significant-Gravitas#1139

* use property

* termination msg

* AIUserProxyAgent

* smaller dev container

* update notebooks

* match

* document code execution and AIUserProxyAgent

* gpt 3.5 config list

* rate limit

* variable visibility

* remove unnecessary import

* quote

* notebook comments

* remove mathchat from init import

* two users

* import location

* expose config

* return str not tuple

* rate limit

* ipython user proxy

* message

* None result

* rate limit

* rate limit

* rate limit

* rate limit

* make auto_reply a common method for all agents

* abs path

* refactor and doc

* set mathchat_termination

* code format

* modified

* emove import

* code quality

* sender -> messages

* system message

* clean agent hierarchy

* dict check

* invalid oai msg

* return

* openml error

* docstr

---------

Co-authored-by: kevin666aa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts needs discussion To be discussed among maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants