From 9e17a304dee13e406a5678f263ac307fb4cc7bd0 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Thu, 27 Apr 2023 17:58:35 +0200 Subject: [PATCH] Minor improvements to the docs for voice config and testing (#3407) --- CONTRIBUTING.md | 17 ++++++++++++----- docs/configuration/voice.md | 4 ++-- docs/setup.md | 5 +---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ac320bd93f9..e736a036ec0f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,15 +99,22 @@ https://github.com/Significant-Gravitas/Auto-GPT/pulls?q=is%3Apr+is%3Aopen+-labe ## 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`]. +To increase coverage if necessary, [write tests using pytest]. For more info on running tests, please refer to ["Running tests"](https://significant-gravitas.github.io/Auto-GPT/testing/). -[write tests using `pytest`]: https://realpython.com/pytest-python-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!* - -In Pytest, we use VCRpy. It's a package that allows us to save OpenAI and other API providers' responses. When you run Pytest locally: - If no prompt change: you will not consume API tokens because there are no new OpenAI calls required. diff --git a/docs/configuration/voice.md b/docs/configuration/voice.md index fcd487fd72ee..728fbaf5fd43 100644 --- a/docs/configuration/voice.md +++ b/docs/configuration/voice.md @@ -11,8 +11,8 @@ premade voices that Auto-GPT can use for speech. 1. Go to [ElevenLabs](https://beta.elevenlabs.io/) and make an account if you don't already have one. -2. Choose and setup the `Starter` plan. -3. Click the top right icon and find "Profile" to locate your API Key. +2. Choose and setup the *Starter* plan. +3. Click the top right icon and find *Profile* to locate your API Key. In the `.env` file set: diff --git a/docs/setup.md b/docs/setup.md index a5d0558c3ddf..7cbab43df0d9 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -73,7 +73,7 @@ Get your OpenAI API key from: [https://platform.openai.com/account/api-keys](htt !!! important Make sure you have [Git](https://git-scm.com/downloads) installed for your OS. -!!! info +!!! info "Executing commands" To execute the given commands, open a CMD, Bash, or Powershell window. On Windows: press ++win+x++ and pick *Terminal*, or ++win+r++ and enter `cmd` @@ -115,9 +115,6 @@ Get your OpenAI API key from: [https://platform.openai.com/account/api-keys](htt 7. Save and close the `.env` file. -!!! info - Get your ElevenLabs API key from: [ElevenLabs](https://elevenlabs.io). You can view your xi-api-key using the "Profile" tab on the website. - !!! info "Using a GPT Azure-instance" If you want to use GPT on an Azure instance, set `USE_AZURE` to `True` and make an Azure configuration file: