Remove keys.py and replace with python-dotenv.

- 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`.
This commit is contained in:
James C. Palmer
2023-04-02 06:11:04 -04:00
parent cffe083ff2
commit ef656a0f77
8 changed files with 28 additions and 23 deletions

View File

@@ -1,9 +1,9 @@
import os
import time
import openai
import keys
# Initialize the OpenAI API client
openai.api_key = keys.OPENAI_API_KEY
openai.api_key = os.getenv("OPENAI_API_KEY")
def create_chat_message(role, content):