Adds the gTTS (Google Text-to-Speech) Python library as a fallback for text-to-speech conversion in the speak.py file. The changes were made to ensure that users can still convert text to speech even if the ElevenLabs API key is not set or if the API encounters an error. Additionally, the requirements.txt file has been updated to include the new gTTS dependency.
This pull request adds functionality to the project to allow for a choice between the original Google search method and the Google Custom Search API. The google_search method uses the original method of scraping the HTML from the search results page, using googlesearch-python, while the google_official_search method uses the Google Custom Search API to retrieve search results.
How to test:
To test the functionality, ensure that you have valid API keys and search engine IDs for both the Google search method and the Google Custom Search API. You can set these values in your environment variables as described in the README.md file.
Additional Notes:
This pull request only adds functionality and makes improvements to existing code. No new features or major changes have been introduced.
- Removed `keys.py`.
- Added `.env.template`.
- Added `.env` to `.gitignore`.
- Updated various files that imported `keys` to use `os.getenv` instead.
- Updated `requirements.txt` dependencies.
- Updated README.md with instructions on setting up environment variables.
This change improves security, flexibility, and makes it easier to use Auto-GPT in notebooks. Environment variables are stored in `.env` and loaded via `load_dotenv()` in `scripts/main.py`.