Skip to content

Commit

Permalink
Release 0.3.1 (Significant-Gravitas#4201)
Browse files Browse the repository at this point in the history
* Feature/tighten up ci pipeline (Significant-Gravitas#3700)

* Fix docker volume mounts (Significant-Gravitas#3710)

Co-authored-by: Reinier van der Leer <[email protected]>
Co-authored-by: Nicholas Tindle <[email protected]>

* Feature/enable intuitive logs for community challenge step 1 (Significant-Gravitas#3695)

* Feature/enable intuitive logs summarization (Significant-Gravitas#3697)

* Move task_complete command out of prompt (Significant-Gravitas#3663)

* feat: move task_complete command out of prompt

* fix: formatting fixes

* Add the shutdown command to the test agents

* tests: update test vcrs

---------

Co-authored-by: James Collins <[email protected]>

* Allow users to Disable Commands via the .env (Significant-Gravitas#3667)

* Document Disabling command categories (Significant-Gravitas#3669)

* feat: move task_complete command out of prompt

* fix: formatting fixes

* feat: add command disabling

* docs: document how to disable command categories

* Enable denylist handling for plugins (Significant-Gravitas#3688)

Co-authored-by: Luke Kyohere <[email protected]>
Co-authored-by: Nicholas Tindle <[email protected]>

* Fix call to `plugin.post_planning` (Significant-Gravitas#3414)

Co-authored-by: Nicholas Tindle <[email protected]>

* create information retrieval challenge a (Significant-Gravitas#3770)

Co-authored-by: Richard Beales <[email protected]>

* fix typos (Significant-Gravitas#3798)

* Update run.bat (Significant-Gravitas#3783)

Co-authored-by: Richard Beales <[email protected]>

* Update run.sh (Significant-Gravitas#3752)

Co-authored-by: Richard Beales <[email protected]>

* ADD: Bash block in the contributing markdown (Significant-Gravitas#3701)

Co-authored-by: Richard Beales <[email protected]>

* BUGFIX: Selenium Driver object reference was included in the browsing results for some reason (Significant-Gravitas#3642)

* * there is really no need to return the  reference to the Selenium driver along with the text summary and list of links.

* * removing unused second return value from browse_website()

* * updated cassette

* * updated YAML cassette for test_browse_website

* * after requirements reinstall, another update YAML cassette for test_browse_website

* * another update YAML cassette for test_browse_website, only as a placholder commit to trigger re-testing due to some docker TCP timeout issue

* * another update YAML cassette for test_browse_website

---------

Co-authored-by: batyu <batyu@localhost>

* Update CONTRIBUTING.md

* Self feedback Improvement (Significant-Gravitas#3680)

* Improved `Self-Feedback`

* minor tweak

* Test: Updated `test_get_self_feedback.py`

* community challenges in the wiki (Significant-Gravitas#3764)

* Update README.md

* Update PULL_REQUEST_TEMPLATE.md

Added link to wiki Contributing page

* Add link to wiki Contributing page

* fix

* Add link to wiki page  on Contributing

* Implement Logging of User Input in logs/Debug Folder (Significant-Gravitas#3867)

* Adds USER_INPUT_FILE_NAME

* Update agent.py

* Update agent.py

Log only if console_input is not the authorise_key

* Reformatting

* add information retrieval challenge to the wiki (Significant-Gravitas#3876)

* add code owners policy (Significant-Gravitas#3981)

* add code owners

* added @ to codeowners

* switched to team ownership

* Memory Challenge C (Significant-Gravitas#3908)

* Memory Challenge C

* Working cassettes

* Doc fixes

* Linting and doc fix

* Updated cassette

* One more cassette try

---------

Co-authored-by: merwanehamadi <[email protected]>

* memory challenge c inconsistent (Significant-Gravitas#3985)

* Improve & fix memory challenge docs. (Significant-Gravitas#3989)

Co-authored-by: Kaan Osmanagaoglu <[email protected]>

* Feature/centralize prompt (Significant-Gravitas#3990)

Co-authored-by: xiao.hu <[email protected]>

* Use correct reference to prompt_generator in autogpt/llm/chat.py (Significant-Gravitas#4011)

* fix typos (Significant-Gravitas#3998)

Co-authored-by: Minfeng Lu <[email protected]>
Co-authored-by: Richard Beales <[email protected]>

* fix typo in the getting started docs (Significant-Gravitas#3997)

Co-authored-by: Richard Beales <[email protected]>

* Fix path to workspace directory in setup guide (Significant-Gravitas#3927)

Co-authored-by: Nicholas Tindle <[email protected]>

* document that docker-compose 1.29.0 is minimally required (Significant-Gravitas#3963)

Co-authored-by: Nicholas Tindle <[email protected]>

* Integrate pytest-xdist Plugin for Parallel and Concurrent Testing (Significant-Gravitas#3870)

* Adds pytest-parallel dependencies

* Implement pytest-parallel for faster tests

* Uses pytest-xdist

* Auto number of workers processes

* Update ci.yml

---------

Co-authored-by: Nicholas Tindle <[email protected]>

* explain temperature setting in env file (Significant-Gravitas#4140)

Co-authored-by: Richard Beales <[email protected]>

* Catch JSON error in summary_memory.py (Significant-Gravitas#3996)

Co-authored-by: k-boikov <[email protected]>

* Update duckduckgo dependency - min should be 2.9.5 (Significant-Gravitas#4142)

Co-authored-by: k-boikov <[email protected]>

* Update Dockerfile - add missing scripts and plugins directories. (Significant-Gravitas#3706)

Co-authored-by: k-boikov <[email protected]>

* Updated memory setup links (Significant-Gravitas#3829)

Co-authored-by: k-boikov <[email protected]>

* Parse package versions so upgrades can be forced (Significant-Gravitas#4149)

* parse package versions so upgrades can be forced

* better version from @collijk

* fix typo in autopgt/agent/agent.py (Significant-Gravitas#3747)

Co-authored-by: merwanehamadi <[email protected]>
Co-authored-by: Richard Beales <[email protected]>
Co-authored-by: k-boikov <[email protected]>

* Fix `milvus_memory_test.py` mock `Config` (Significant-Gravitas#3424)

Co-authored-by: k-boikov <[email protected]>

* Implemented showing the number of preauthorised commands left. Significant-Gravitas#1035 (Significant-Gravitas#3322)

Co-authored-by: mayubi <[email protected]>
Co-authored-by: Nicholas Tindle <[email protected]>
Co-authored-by: k-boikov <[email protected]>

* Challenge: Kubernetes and documentation (Significant-Gravitas#4121)

* challenge_kubes_and_readme

* docs

* testing

* black and isort

* revision

* lint

* comments

* blackisort

* docs

* docs

* deleting_cassette

* suggestions

* misspelling_errors

---------

Co-authored-by: merwanehamadi <[email protected]>

* Make sdwebui tests pass (when SD is running) (Significant-Gravitas#3721)

Co-authored-by: Nicholas Tindle <[email protected]>

* Add Edge browser support using EdgeChromiumDriverManager (Significant-Gravitas#3058)

Co-authored-by: Nicholas Tindle <[email protected]>
Co-authored-by: k-boikov <[email protected]>

* Added --install-plugin-deps to Docker (Significant-Gravitas#4151)

Co-authored-by: Nicholas Tindle <[email protected]>

* Feature/basic proxy (Significant-Gravitas#4164)

* basic proxy (Significant-Gravitas#54)

* basic proxy (Significant-Gravitas#55)

* basic proxy

* basic proxy

* basic proxy

* basic proxy

* add back double quotes

* add more specific files

* write file

* basic proxy

* Put back double quotes

* test new CI (Significant-Gravitas#4168)

* test new CI

* test new CI

* remove double quotes

* Feature/test new ci pipeline 2 (Significant-Gravitas#4169)

* test new CI

* remove double quotes

* make it a variable

* make it a variable

* Test New CI Pipeline (Significant-Gravitas#4170)

* introduce dummy prompt change

* introduce dummy prompt change

* empty commit

* empty commit

* empty commit

* push to origin repo

* add s to quote

* Feature/fix rate limiting issue Step 1 (Significant-Gravitas#4173)


* temporarilly remove 3.11

* add back 3.11 (Significant-Gravitas#4185)

* Revert "Put back 3.11 until it's removed as a requirement" (Significant-Gravitas#4191)

---------

Co-authored-by: Reinier van der Leer <[email protected]>
Co-authored-by: merwanehamadi <[email protected]>
Co-authored-by: Peter Petermann <[email protected]>
Co-authored-by: Nicholas Tindle <[email protected]>
Co-authored-by: James Collins <[email protected]>
Co-authored-by: Luke K <[email protected]>
Co-authored-by: Luke Kyohere <[email protected]>
Co-authored-by: Robin Richtsfeld <[email protected]>
Co-authored-by: RainRat <[email protected]>
Co-authored-by: itsmarble <[email protected]>
Co-authored-by: Ambuj Pawar <[email protected]>
Co-authored-by: bszollosinagy <[email protected]>
Co-authored-by: batyu <batyu@localhost>
Co-authored-by: Pi <[email protected]>
Co-authored-by: AbTrax <[email protected]>
Co-authored-by: Andres Caicedo <[email protected]>
Co-authored-by: Douglas Schonholtz <[email protected]>
Co-authored-by: Kaan <[email protected]>
Co-authored-by: Kaan Osmanagaoglu <[email protected]>
Co-authored-by: xiao.hu <[email protected]>
Co-authored-by: Tomasz Kasperczyk <[email protected]>
Co-authored-by: minfeng-ai <[email protected]>
Co-authored-by: Minfeng Lu <[email protected]>
Co-authored-by: Shlomi <[email protected]>
Co-authored-by: Itai Steinherz <[email protected]>
Co-authored-by: Boostrix <[email protected]>
Co-authored-by: Kristian Jackson <[email protected]>
Co-authored-by: k-boikov <[email protected]>
Co-authored-by: Eduardo Salinas <[email protected]>
Co-authored-by: prom3theu5 <[email protected]>
Co-authored-by: dominic-ks <[email protected]>
Co-authored-by: andrey13771 <[email protected]>
Co-authored-by: Marwand Ayubi <[email protected]>
Co-authored-by: mayubi <[email protected]>
Co-authored-by: Media <[email protected]>
Co-authored-by: Cenny <[email protected]>
Co-authored-by: Abdelkarim Habouch <[email protected]>
  • Loading branch information
Show file tree
Hide file tree
Showing 89 changed files with 4,967 additions and 1,103 deletions.
31 changes: 30 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,40 @@
## EXIT_KEY - Key to exit AUTO-GPT
# EXIT_KEY=n

## DISABLED_COMMAND_CATEGORIES - The list of categories of commands that are disabled. Each of the below are an option:
## autogpt.commands.analyze_code
## autogpt.commands.audio_text
## autogpt.commands.execute_code
## autogpt.commands.file_operations
## autogpt.commands.git_operations
## autogpt.commands.google_search
## autogpt.commands.image_gen
## autogpt.commands.improve_code
## autogpt.commands.twitter
## autogpt.commands.web_selenium
## autogpt.commands.write_tests
## autogpt.app
## autogpt.commands.task_statuses
## For example, to disable coding related features, uncomment the next line
# DISABLED_COMMAND_CATEGORIES=autogpt.commands.analyze_code,autogpt.commands.execute_code,autogpt.commands.git_operations,autogpt.commands.improve_code,autogpt.commands.write_tests

################################################################################
### LLM PROVIDER
################################################################################

### OPENAI
## OPENAI_API_KEY - OpenAI API Key (Example: my-openai-api-key)


## NOTE: https://platform.openai.com/docs/api-reference/completions
# The temperature setting in language models like GPT controls the balance between predictable and random responses.
# Lower temperature makes the responses more focused and deterministic, while higher temperature makes them more
# creative and varied. The temperature range typically goes from 0 to 2 in OpenAI's implementation.
##
## TEMPERATURE - Sets temperature in OpenAI (Default: 0)
##
###

## USE_AZURE - Use Azure OpenAI or not (Default: False)
OPENAI_API_KEY=your-openai-api-key
# TEMPERATURE=0
Expand Down Expand Up @@ -165,7 +192,7 @@ OPENAI_API_KEY=your-openai-api-key
### BROWSER
## HEADLESS_BROWSER - Whether to run the browser in headless mode (default: True)
## USE_WEB_BROWSER - Sets the web-browser driver to use with selenium (default: chrome).
## Note: set this to either 'chrome', 'firefox', or 'safari' depending on your current browser
## Note: set this to either 'chrome', 'firefox', 'safari' or 'edge' depending on your current browser
# HEADLESS_BROWSER=True
# USE_WEB_BROWSER=chrome
## BROWSE_CHUNK_MAX_LENGTH - When browsing website, define the length of chunks to summarize (in number of tokens, excluding the response. 75 % of FAST_TOKEN_LIMIT is usually wise )
Expand Down Expand Up @@ -213,7 +240,9 @@ OPENAI_API_KEY=your-openai-api-key
################################################################################

#ALLOWLISTED_PLUGINS - Sets the listed plugins that are allowed (Example: plugin1,plugin2,plugin3)
#DENYLISTED_PLUGINS - Sets the listed plugins that are not allowed (Example: plugin1,plugin2,plugin3)
ALLOWLISTED_PLUGINS=
DENYLISTED_PLUGINS=

################################################################################
### CHAT PLUGIN SETTINGS
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/ @Significant-Gravitas/Auto-GPT-Source
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/1.bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ body:
* Check out our [backlog], [roadmap] and join our [discord] to discuss what's going on
* If you need help, you can ask in the [discussions] section or in [#tech-support]
* **Throughly search the [existing issues] before creating a new one**
* Read our [wiki page on Contributing]
[backlog]: https://github.com/orgs/Significant-Gravitas/projects/1
[roadmap]: https://github.com/orgs/Significant-Gravitas/projects/2
[discord]: https://discord.gg/autogpt
[discussions]: https://github.com/Significant-Gravitas/Auto-GPT/discussions
[#tech-support]: https://discord.com/channels/1092243196446249134/1092275629602394184
[existing issues]: https://github.com/Significant-Gravitas/Auto-GPT/issues?q=is%3Aissue
[wiki page on Contributing]: https://github.com/Significant-Gravitas/Auto-GPT/wiki/Contributing
- type: checkboxes
attributes:
label: ⚠️ Search for existing issues first ⚠️
Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/2.feature.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Feature request 🚀
description: Suggest a new idea for Auto-GPT.
description: Suggest a new idea for Auto-GPT!
labels: ['status: needs triage']
body:
- type: markdown
attributes:
value: |
First, check out our [wiki page on Contributing](https://github.com/Significant-Gravitas/Auto-GPT/wiki/Contributing)
Please provide a searchable summary of the issue in the title above ⬆️.
Thanks for contributing by creating an issue! ❤️
- type: checkboxes
attributes:
label: Duplicates
Expand All @@ -26,4 +25,4 @@ body:
- type: textarea
attributes:
label: Motivation 🔦
description: What are you trying to accomplish? How has the lack of this feature affected you? Providing context helps us come up with a solution that is more useful in the real world.
description: What are you trying to accomplish? How has the lack of this feature affected you? Providing context helps us come up with a solution that is more useful in the real world.
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Provide clear documentation and explanations of the changes made.
Ensure diffs are limited to the intended lines — no applying preferred formatting styles or line endings (unless that's what the PR is about).
For guidance on committing only the specific lines you have changed, refer to this helpful video: https://youtu.be/8-hSNHHbiZg
Check out our [wiki page on Contributing](https://github.com/Significant-Gravitas/Auto-GPT/wiki/Contributing)
By following these guidelines, your PRs are more likely to be merged quickly after testing, as long as they align with the project's overall direction. -->

### Background
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/add-cassettes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Merge and Commit Cassettes

on:
pull_request_target:
types:
- closed

jobs:
update-cassettes:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # This is necessary to fetch all branches and tags

- name: Fetch all branches
run: git fetch --all

- name: Reset branch
run: |
git checkout ${{ github.event.pull_request.base.ref }}
git reset --hard origin/cassette-diff-${{ github.event.pull_request.number }}
- name: Create PR
id: create_pr
uses: peter-evans/create-pull-request@v5
with:
commit-message: Update cassettes
signoff: false
branch: cassette-diff-${{ github.event.pull_request.number }}
delete-branch: false
title: "Update cassettes"
body: "This PR updates the cassettes."
draft: false

- name: Check PR
run: |
echo "Pull Request Number - ${{ steps.create_pr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.create_pr.outputs.pull-request-url }}"
- name: Comment PR URL in the current PR
uses: thollander/actions-comment-pull-request@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
New pull request created for cassettes: [HERE](${{ steps.create_pr.outputs.pull-request-url }}). Please merge it asap.
32 changes: 28 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Python CI
on:
push:
branches: [ master ]
pull_request:
pull_request_target:
branches: [ master, stable ]

concurrency:
group: ${{ format('ci-{0}', github.head_ref && format('pr-{0}', github.event.pull_request.number) || github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}

jobs:
lint:
Expand All @@ -19,6 +19,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Set up Python ${{ env.min-python-version }}
uses: actions/setup-python@v2
Expand Down Expand Up @@ -53,11 +57,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10"]

steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand All @@ -71,7 +79,23 @@ jobs:
- name: Run unittest tests with coverage
run: |
pytest --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term
pytest -n auto --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term
env:
CI: true
PROXY: ${{ vars.PROXY }}
AGENT_MODE: ${{ vars.AGENT_MODE }}
AGENT_TYPE: ${{ vars.AGENT_TYPE }}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3

- name: Stage new files and commit
run: |
git add tests
git diff --cached --quiet && echo "No changes to commit" && exit 0
git config user.email "[email protected]"
git config user.name "GitHub Actions"
git commit -m "Add new cassettes"
git checkout -b cassette-diff-${{ github.event.pull_request.number }}
git remote add target https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.event.pull_request.base.repo.full_name }}
git push -f target cassette-diff-${{ github.event.pull_request.number }}
2 changes: 1 addition & 1 deletion .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
set +e
test_output=$(
docker run --env CI --env OPENAI_API_KEY --entrypoint python ${{ env.IMAGE_NAME }} -m \
pytest --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term 2>&1
pytest -n auto --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term 2>&1
)
test_failure=$?
Expand Down
149 changes: 1 addition & 148 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,148 +1 @@
# Contributing to Auto-GPT

First of all, thank you for considering contributing to our project! We appreciate your time and effort, and we value any contribution, whether it's reporting a bug, suggesting a new feature, or submitting a pull request.

This document provides guidelines and best practices to help you contribute effectively.

## Code of Conduct

By participating in this project, you agree to abide by our [Code of Conduct]. Please read it to understand the expectations we have for everyone who contributes to this project.

[Code of Conduct]: https://docs.agpt.co/code-of-conduct/

## 📢 A Quick Word
Right now we will not be accepting any Contributions that add non-essential commands to Auto-GPT.

However, you absolutely can still add these commands to Auto-GPT in the form of plugins.
Please check out this [template](https://github.com/Significant-Gravitas/Auto-GPT-Plugin-Template).

## Getting Started

1. Fork the repository and clone your fork.
2. Create a new branch for your changes (use a descriptive name, such as `fix-bug-123` or `add-new-feature`).
3. Make your changes in the new branch.
4. Test your changes thoroughly.
5. Commit and push your changes to your fork.
6. Create a pull request following the guidelines in the [Submitting Pull Requests](#submitting-pull-requests) section.

## How to Contribute

### Reporting Bugs

If you find a bug in the project, please create an issue on GitHub with the following information:

- A clear, descriptive title for the issue.
- A description of the problem, including steps to reproduce the issue.
- Any relevant logs, screenshots, or other supporting information.

### Suggesting Enhancements

If you have an idea for a new feature or improvement, please create an issue on GitHub with the following information:

- A clear, descriptive title for the issue.
- A detailed description of the proposed enhancement, including any benefits and potential drawbacks.
- Any relevant examples, mockups, or supporting information.

### Submitting Pull Requests

When submitting a pull request, please ensure that your changes meet the following criteria:

- Your pull request should be atomic and focus on a single change.
- Your pull request should include tests for your change. We automatically enforce this with [CodeCov](https://docs.codecov.com/docs/commit-status)
- You should have thoroughly tested your changes with multiple different prompts.
- You should have considered potential risks and mitigations for your changes.
- You should have documented your changes clearly and comprehensively.
- You should not include any unrelated or "extra" small tweaks or changes.

## Style Guidelines

### Code Formatting

We use the `black` and `isort` code formatters to maintain a consistent coding style across the project. Please ensure that your code is formatted properly before submitting a pull request.

To format your code, run the following commands in the project's root directory:

```bash
python -m black .
python -m isort .
```

Or if you have these tools installed globally:
```bash
black .
isort .
```

### Pre-Commit Hooks

We use pre-commit hooks to ensure that code formatting and other checks are performed automatically before each commit. To set up pre-commit hooks for this project, follow these steps:

Install the pre-commit package using pip:
```bash
pip install pre-commit
```

Run the following command in the project's root directory to install the pre-commit hooks:
```bash
pre-commit install
```

Now, the pre-commit hooks will run automatically before each commit, checking your code formatting and other requirements.

If you encounter any issues or have questions, feel free to reach out to the maintainers or open a new issue on GitHub. We're here to help and appreciate your efforts to contribute to the project.

Happy coding, and once again, thank you for your contributions!

Maintainers will look at PR that have no merge conflicts when deciding what to add to the project. Make sure your PR shows up here:
https://github.com/Significant-Gravitas/Auto-GPT/pulls?q=is%3Apr+is%3Aopen+-label%3Aconflicts

## Testing your changes

If you add or change code, make sure the updated code is covered by tests.
To increase coverage if necessary, [write tests using pytest].

For more info on running tests, please refer to ["Running tests"](https://docs.agpt.co/testing/).

[write tests using pytest]: https://realpython.com/pytest-python-testing/

### API-dependent tests

To run tests that involve making calls to the OpenAI API, we use VCRpy. It caches known
requests and matching responses in so-called *cassettes*, allowing us to run the tests
in CI without needing actual API access.

When changes cause a test prompt to be generated differently, it will likely miss the
cache and make a request to the API, updating the cassette with the new request+response.
*Be sure to include the updated cassette in your PR!*

When you run Pytest locally:

- If no prompt change: you will not consume API tokens because there are no new OpenAI calls required.
- If the prompt changes in a way that the cassettes are not reusable:
- If no API key, the test fails. It requires a new cassette. So, add an API key to .env.
- If the API key is present, the tests will make a real call to OpenAI.
- If the test ends up being successful, your prompt changes didn't introduce regressions. This is good. Commit your cassettes to your PR.
- If the test is unsuccessful:
- Either: Your change made Auto-GPT less capable, in that case, you have to change your code.
- Or: The test might be poorly written. In that case, you can make suggestions to change the test.

In our CI pipeline, Pytest will use the cassettes and not call paid API providers, so we need your help to record the replays that you break.


### Community Challenges
Challenges are goals we need Auto-GPT to achieve.
To pick the challenge you like, go to the tests/integration/challenges folder and select the areas you would like to work on.
- a challenge is new if level_currently_beaten is None
- a challenge is in progress if level_currently_beaten is greater or equal to 1
- a challenge is beaten if level_currently_beaten = max_level

Here is an example of how to run the memory challenge A and attempt to beat level 3.

pytest -s tests/integration/challenges/memory/test_memory_challenge_a.py --level=3

To beat a challenge, you're not allowed to change anything in the tests folder, you have to add code in the autogpt folder

Challenges use cassettes. Cassettes allow us to replay your runs in our CI pipeline.
Don't hesitate to delete the cassettes associated to the challenge you're working on if you need to. Otherwise it will keep replaying the last run.

Once you've beaten a new level of a challenge, please create a pull request and we will analyze how you changed Auto-GPT to beat the challenge.
This document now lives at https://github.com/Significant-Gravitas/Auto-GPT/wiki/Contributing
Loading

0 comments on commit dda8d0f

Please sign in to comment.