refactor(autogpt, forge): Remove `autogpts` directory (#7163)

- Moved `autogpt` and `forge` to project root
- Removed `autogpts` directory
- Moved and renamed submodule `autogpts/autogpt/tests/vcr_cassettes` to `autogpt/tests/vcr_cassettes`
- When using CLI agents will be created in `agents` directory (instead of `autogpts`)
- Renamed relevant docs, code and config references from `autogpts/[forge|autogpt]` to `[forge|autogpt]` and from `*../../*` to `*../*`
- Updated `CODEOWNERS`, GitHub Actions and Docker `*.yml` configs
- Updated symbolic links in `docs`
pull/7166/head
Krzysztof Czerwinski 2024-05-22 13:08:54 +01:00 committed by GitHub
parent 3475aaf384
commit 4c325724ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
229 changed files with 84 additions and 87 deletions

4
.github/CODEOWNERS vendored
View File

@ -1,5 +1,5 @@
.github/workflows/ @Significant-Gravitas/devops
autogpts/autogpt/ @Significant-Gravitas/maintainers
autogpts/forge/ @Significant-Gravitas/forge-maintainers
autogpt/ @Significant-Gravitas/maintainers
forge/ @Significant-Gravitas/forge-maintainers
benchmark/ @Significant-Gravitas/benchmark-maintainers
frontend/ @Significant-Gravitas/frontend-maintainers

4
.github/labeler.yml vendored
View File

@ -1,10 +1,10 @@
AutoGPT Agent:
- changed-files:
- any-glob-to-any-file: autogpts/autogpt/**
- any-glob-to-any-file: autogpt/**
Forge:
- changed-files:
- any-glob-to-any-file: autogpts/forge/**
- any-glob-to-any-file: forge/**
Benchmark:
- changed-files:

View File

@ -5,14 +5,14 @@ on:
branches: [ master, development, ci-test* ]
paths:
- '.github/workflows/autogpt-ci.yml'
- 'autogpts/autogpt/**'
- '!autogpts/autogpt/tests/vcr_cassettes'
- 'autogpt/**'
- '!autogpt/tests/vcr_cassettes'
pull_request:
branches: [ master, development, release-* ]
paths:
- '.github/workflows/autogpt-ci.yml'
- 'autogpts/autogpt/**'
- '!autogpts/autogpt/tests/vcr_cassettes'
- 'autogpt/**'
- '!autogpt/tests/vcr_cassettes'
concurrency:
group: ${{ format('autogpt-ci-{0}', github.head_ref && format('{0}-{1}', github.event_name, github.event.pull_request.number) || github.sha) }}
@ -21,7 +21,7 @@ concurrency:
defaults:
run:
shell: bash
working-directory: autogpts/autogpt
working-directory: autogpt
jobs:
lint:
@ -48,7 +48,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('autogpts/autogpt/pyproject.toml') }}-${{ steps.get_date.outputs.date }}
key: ${{ runner.os }}-poetry-${{ hashFiles('autogpt/pyproject.toml') }}-${{ steps.get_date.outputs.date }}
- name: Install Python dependencies
run: |
@ -170,7 +170,7 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ runner.os == 'macOS' && '~/Library/Caches/pypoetry' || '~/.cache/pypoetry' }}
key: poetry-${{ runner.os }}-${{ hashFiles('autogpts/autogpt/poetry.lock') }}
key: poetry-${{ runner.os }}-${{ hashFiles('autogpt/poetry.lock') }}
- name: Install Poetry (Unix)
if: runner.os != 'Windows'
@ -293,4 +293,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: test-logs
path: autogpts/autogpt/logs/
path: autogpt/logs/

View File

@ -25,7 +25,7 @@ jobs:
name: Build image
uses: docker/build-push-action@v5
with:
context: autogpts/autogpt
context: autogpt
build-args: BUILD_TYPE=${{ matrix.build-type }}
load: true # save to docker images
# use GHA cache as read-only

View File

@ -5,14 +5,14 @@ on:
branches: [ master, development ]
paths:
- '.github/workflows/autogpt-docker-ci.yml'
- 'autogpts/autogpt/**'
- '!autogpts/autogpt/tests/vcr_cassettes'
- 'autogpt/**'
- '!autogpt/tests/vcr_cassettes'
pull_request:
branches: [ master, development, release-* ]
paths:
- '.github/workflows/autogpt-docker-ci.yml'
- 'autogpts/autogpt/**'
- '!autogpts/autogpt/tests/vcr_cassettes'
- 'autogpt/**'
- '!autogpt/tests/vcr_cassettes'
concurrency:
group: ${{ format('autogpt-docker-ci-{0}', github.head_ref && format('pr-{0}', github.event.pull_request.number) || github.sha) }}
@ -20,7 +20,7 @@ concurrency:
defaults:
run:
working-directory: autogpts/autogpt
working-directory: autogpt
env:
IMAGE_NAME: auto-gpt
@ -49,7 +49,7 @@ jobs:
name: Build image
uses: docker/build-push-action@v5
with:
context: autogpts/autogpt
context: autogpt
build-args: BUILD_TYPE=${{ matrix.build-type }}
tags: ${{ env.IMAGE_NAME }}
labels: GIT_REVISION=${{ github.sha }}
@ -119,7 +119,7 @@ jobs:
name: Build image
uses: docker/build-push-action@v5
with:
context: autogpts/autogpt
context: autogpt
build-args: BUILD_TYPE=dev # include pytest
tags: >
${{ env.IMAGE_NAME }},

View File

@ -12,7 +12,7 @@ on:
defaults:
run:
working-directory: autogpts/autogpt
working-directory: autogpt
env:
IMAGE_NAME: auto-gpt
@ -48,7 +48,7 @@ jobs:
name: Build image
uses: docker/build-push-action@v5
with:
context: autogpts/autogpt
context: autogpt
build-args: BUILD_TYPE=release
load: true # save to docker images
# push: true # TODO: uncomment when this issue is fixed: https://github.com/moby/buildkit/issues/1555

View File

@ -42,7 +42,7 @@ jobs:
- name: Benchmark ${{ matrix.agent-name }}
run: |
./run agent start ${{ matrix.agent-name }}
cd autogpts/${{ matrix.agent-name }}
cd ${{ matrix.agent-name }}
set +e # Do not quit on non-zero exit codes
poetry run agbenchmark run -N 3 \

View File

@ -8,7 +8,8 @@ on:
branches: [ master, development, ci-test* ]
paths:
- '.github/workflows/autogpts-ci.yml'
- 'autogpts/**'
- 'autogpt/**'
- 'forge/**'
- 'benchmark/**'
- 'run'
- 'cli.py'
@ -18,7 +19,8 @@ on:
branches: [ master, development, release-* ]
paths:
- '.github/workflows/autogpts-ci.yml'
- 'autogpts/**'
- 'autogpt/**'
- 'forge/**'
- 'benchmark/**'
- 'run'
- 'cli.py'
@ -48,14 +50,14 @@ jobs:
python-version: ${{ env.min-python-version }}
- name: Install Poetry
working-directory: ./autogpts/${{ matrix.agent-name }}/
working-directory: ./${{ matrix.agent-name }}/
run: |
curl -sSL https://install.python-poetry.org | python -
- name: Run regression tests
run: |
./run agent start ${{ matrix.agent-name }}
cd autogpts/${{ matrix.agent-name }}
cd ${{ matrix.agent-name }}
poetry run agbenchmark --mock --test=BasicRetrieval --test=Battleship --test=WebArenaTask_0
poetry run agbenchmark --test=WriteFile
env:

View File

@ -89,14 +89,14 @@ jobs:
python-version: ${{ env.min-python-version }}
- name: Install Poetry
working-directory: ./autogpts/${{ matrix.agent-name }}/
working-directory: ./${{ matrix.agent-name }}/
run: |
curl -sSL https://install.python-poetry.org | python -
- name: Run regression tests
run: |
./run agent start ${{ matrix.agent-name }}
cd autogpts/${{ matrix.agent-name }}
cd ${{ matrix.agent-name }}
set +e # Ignore non-zero exit codes and continue execution
echo "Running the following command: poetry run agbenchmark --maintain --mock"
@ -119,7 +119,7 @@ jobs:
echo "Running the following command: poetry run agbenchmark --test=WriteFile"
poetry run agbenchmark --test=WriteFile
cd ../../benchmark
cd ../benchmark
poetry install
echo "Adding the BUILD_SKILL_TREE environment variable. This will attempt to add new elements in the skill tree. If new elements are added, the CI fails because they should have been pushed"
export BUILD_SKILL_TREE=true

View File

@ -117,7 +117,7 @@ jobs:
branch=$(jq -r '.["branch_to_benchmark"]' arena/$AGENT_NAME.json)
git clone "$link" -b "$branch" "$AGENT_NAME"
cd $AGENT_NAME
cp ./autogpts/$AGENT_NAME/.env.example ./autogpts/$AGENT_NAME/.env || echo "file not found"
cp ./$AGENT_NAME/.env.example ./$AGENT_NAME/.env || echo "file not found"
./run agent start $AGENT_NAME
cd ../benchmark
poetry install

View File

@ -5,7 +5,7 @@ on:
push:
branches: [ master, development, release-* ]
paths-ignore:
- 'autogpts/autogpt/tests/vcr_cassettes'
- 'autogpt/tests/vcr_cassettes'
- 'benchmark/reports/**'
# So that the `dirtyLabel` is removed if conflicts are resolve
# We recommend `pull_request_target` so that github secrets are available.

4
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "autogpts/autogpt/tests/vcr_cassettes"]
path = autogpts/autogpt/tests/vcr_cassettes
[submodule "autogpt/tests/vcr_cassettes"]
path = autogpt/tests/vcr_cassettes
url = https://github.com/Significant-Gravitas/Auto-GPT-test-cassettes

View File

@ -74,7 +74,7 @@ Lists all the available agents.
**Output**:
```
🎉 New agent 'my_agent' created and switched to the new directory in autogpts folder.
🎉 New agent 'my_agent' created and switched to the new directory in agents folder.
```
Creates a new agent named 'my_agent'.

View File

@ -22,12 +22,12 @@ Be part of the revolution! **AutoGPT** is here to stay, at the forefront of AI i
### 🏗️ Forge
**Forge your own agent!** – Forge is a ready-to-go template for your agent application. All the boilerplate code is already handled, letting you channel all your creativity into the things that set *your* agent apart. All tutorials are located [here](https://medium.com/@aiedge/autogpt-forge-e3de53cc58ec). Components from the [`forge.sdk`](/autogpts/forge/forge/sdk) can also be used individually to speed up development and reduce boilerplate in your agent project.
**Forge your own agent!** – Forge is a ready-to-go template for your agent application. All the boilerplate code is already handled, letting you channel all your creativity into the things that set *your* agent apart. All tutorials are located [here](https://medium.com/@aiedge/autogpt-forge-e3de53cc58ec). Components from the [`forge.sdk`](/forge/forge/sdk) can also be used individually to speed up development and reduce boilerplate in your agent project.
🚀 [**Getting Started with Forge**](https://github.com/Significant-Gravitas/AutoGPT/blob/master/autogpts/forge/tutorials/001_getting_started.md) –
🚀 [**Getting Started with Forge**](https://github.com/Significant-Gravitas/AutoGPT/blob/master/forge/tutorials/001_getting_started.md) –
This guide will walk you through the process of creating your own agent and using the benchmark and user interface.
📘 [Learn More](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpts/forge) about Forge
📘 [Learn More](https://github.com/Significant-Gravitas/AutoGPT/tree/master/forge) about Forge
### 🎯 Benchmark

View File

@ -41,7 +41,7 @@ repos:
# types: [ python ]
- id: pytest-check
name: pytest-check
entry: bash -c 'cd autogpts/autogpt && poetry run pytest --cov=autogpt tests/unit'
entry: bash -c 'cd autogpt && poetry run pytest --cov=autogpt tests/unit'
language: system
pass_filenames: false
always_run: true

View File

@ -34,4 +34,4 @@ class MyAgent(Agent):
self.my_component = MyComponent()
```
For more customization, you can override the `propose_action` and `execute` or even subclass `BaseAgent` directly. This way you can have full control over the agent's components and behavior. Have a look at the [implementation of Agent](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpts/autogpt/autogpt/agents/agent.py) for more details.
For more customization, you can override the `propose_action` and `execute` or even subclass `BaseAgent` directly. This way you can have full control over the agent's components and behavior. Have a look at the [implementation of Agent](https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpt/autogpt/agents/agent.py) for more details.

View File

@ -98,9 +98,7 @@ class AgentProtocolServer:
app.include_router(router, prefix="/ap/v1")
script_dir = os.path.dirname(os.path.realpath(__file__))
frontend_path = (
pathlib.Path(script_dir)
.joinpath("../../../../frontend/build/web")
.resolve()
pathlib.Path(script_dir).joinpath("../../../frontend/build/web").resolve()
)
if os.path.exists(frontend_path):

View File

@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
def get_bulletin_from_web():
try:
response = requests.get(
"https://raw.githubusercontent.com/Significant-Gravitas/AutoGPT/master/autogpts/autogpt/BULLETIN.md" # noqa: E501
"https://raw.githubusercontent.com/Significant-Gravitas/AutoGPT/master/autogpt/BULLETIN.md" # noqa: E501
)
if response.status_code == 200:
return response.text
@ -45,7 +45,7 @@ def vcs_state_diverges_from_master() -> bool:
"""
Returns whether a git repo is present and contains changes that are not in `master`.
"""
paths_we_care_about = "autogpts/autogpt/autogpt/**/*.py"
paths_we_care_about = "autogpt/autogpt/**/*.py"
try:
repo = Repo(search_parent_directories=True)

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -1,4 +1,4 @@
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
[[package]]
name = "agbenchmark"
@ -38,7 +38,7 @@ uvicorn = "^0.23.2"
[package.source]
type = "directory"
url = "../../benchmark"
url = "../benchmark"
[[package]]
name = "agent-protocol-client"
@ -355,7 +355,7 @@ uvicorn = "^0.23.2"
webdriver-manager = "^4.0.1"
[package.extras]
benchmark = ["agbenchmark @ file:///home/reinier/code/agpt/Auto-GPT/benchmark"]
benchmark = ["agbenchmark @ file:///Users/czerwinski/Projects/AutoGPT/benchmark"]
[package.source]
type = "directory"
@ -7184,4 +7184,4 @@ benchmark = ["agbenchmark"]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "d79316409dd12b59677b9d5c31717f8147bac58ee96d42ce9fb0d01cdcf826b0"
content-hash = "6427a16e1d25b69fd8dcaf50f851b6e04b80677a0389a93c04dbd8cbed0cfef1"

View File

@ -6,7 +6,7 @@ authors = [
]
readme = "README.md"
description = "An open-source attempt to make GPT-4 autonomous"
homepage = "https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpts/autogpt"
homepage = "https://github.com/Significant-Gravitas/AutoGPT/tree/master/autogpt"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
@ -24,7 +24,7 @@ serve = "autogpt.app.cli:serve"
python = "^3.10"
anthropic = "^0.25.1"
autogpt-forge = { path = "../forge", develop = true }
# autogpt-forge = {git = "https://github.com/Significant-Gravitas/AutoGPT.git", subdirectory = "autogpts/forge"}
# autogpt-forge = {git = "https://github.com/Significant-Gravitas/AutoGPT.git", subdirectory = "forge"}
beautifulsoup4 = "^4.12.2"
charset-normalizer = "^3.1.0"
click = "*"
@ -57,7 +57,7 @@ tiktoken = "^0.5.0"
openapi-python-client = "^0.14.0"
# Benchmarking
agbenchmark = { path = "../../benchmark", optional = true }
agbenchmark = { path = "../benchmark", optional = true }
# agbenchmark = {git = "https://github.com/Significant-Gravitas/AutoGPT.git", subdirectory = "benchmark", optional = true}
google-cloud-logging = "^3.8.0"
google-cloud-storage = "^2.13.0"

View File

@ -55,7 +55,7 @@ async def generate_release_notes(repo_path: Optional[Path] = None):
git_log = repo.git.log(
f"{last_release_tag.name}...{new_release_ref}",
"autogpts/autogpt/",
"autogpt/",
no_merges=True,
follow=True,
)
@ -80,7 +80,7 @@ async def generate_release_notes(repo_path: Optional[Path] = None):
EXAMPLE_RELEASE_NOTES = """
First some important notes w.r.t. using the application:
* `run.sh` has been renamed to `autogpt.sh`
* The project has been restructured. The AutoGPT Agent is now located in `autogpts/autogpt`.
* The project has been restructured. The AutoGPT Agent is now located in `autogpt`.
* The application no longer uses a single workspace for all tasks. Instead, every task that you run the agent on creates a new workspace folder. See the [usage guide](https://docs.agpt.co/autogpt/usage/#workspace) for more information.
## New features ✨
@ -89,12 +89,12 @@ First some important notes w.r.t. using the application:
Our agent now works with the [Agent Protocol](/#-agent-protocol), a REST API that allows creating tasks and executing the agent's step-by-step process. This allows integration with other applications, and we also use it to connect to the agent through the UI.
* **UI 💻**
With the aforementioned Agent Protocol integration comes the benefit of using our own open-source Agent UI. Easily create, use, and chat with multiple agents from one interface.
When starting the application through the project's new [CLI](/#-cli), it runs with the new frontend by default, with benchmarking capabilities. Running `autogpt.sh serve` in the subproject folder (`autogpts/autogpt`) will also serve the new frontend, but without benchmarking functionality.
When starting the application through the project's new [CLI](/#-cli), it runs with the new frontend by default, with benchmarking capabilities. Running `autogpt.sh serve` in the subproject folder (`autogpt`) will also serve the new frontend, but without benchmarking functionality.
Running the application the "old-fashioned" way, with the terminal interface (let's call it TTY mode), is still possible with `autogpt.sh run`.
* **Resuming agents 🔄**
In TTY mode, the application will now save the agent's state when quitting, and allows resuming where you left off at a later time!
* **GCS and S3 workspace backends 📦**
To further support running the application as part of a larger system, Google Cloud Storage and S3 workspace backends were added. Configuration options for this can be found in [`.env.template`](/autogpts/autogpt/.env.template).
To further support running the application as part of a larger system, Google Cloud Storage and S3 workspace backends were added. Configuration options for this can be found in [`.env.template`](/autogpt/.env.template).
* **Documentation Rewrite 📖**
The [documentation](https://docs.agpt.co) has been restructured and mostly rewritten to clarify and simplify the instructions, and also to accommodate the other subprojects that are now in the repo.
* **New Project CLI 🔧**
@ -110,8 +110,8 @@ First some important notes w.r.t. using the application:
This is mostly made possible by the `autogpt.core.configuration` module, which was also expanded with a few new features for it. Most notably, the new `from_env` attribute on the `UserConfigurable` field decorator and corresponding logic in `SystemConfiguration.from_env()` and related functions.
* **Monorepo**
As mentioned, the repo has been restructured to accommodate the AutoGPT Agent, Forge, AGBenchmark and the new Frontend.
* AutoGPT Agent has been moved to `autogpts/autogpt`
* Forge now lives in `autogpts/forge`, and the project's new CLI makes it easy to create new Forge-based agents.
* AutoGPT Agent has been moved to `autogpt`
* Forge now lives in `forge`, and the project's new CLI makes it easy to create new Forge-based agents.
* AGBenchmark -> `benchmark`
* Frontend -> `frontend`

View File

@ -67,7 +67,7 @@ def test_get_bulletin_from_web_success(mock_get):
assert expected_content in bulletin
mock_get.assert_called_with(
"https://raw.githubusercontent.com/Significant-Gravitas/AutoGPT/master/autogpts/autogpt/BULLETIN.md" # noqa: E501
"https://raw.githubusercontent.com/Significant-Gravitas/AutoGPT/master/autogpt/BULLETIN.md" # noqa: E501
)

Some files were not shown because too many files have changed in this diff Show More