From b80925fb4d1a39f50c0b803d2a3e7616bbc301c9 Mon Sep 17 00:00:00 2001 From: "Gennings, Matt" Date: Tue, 9 Jan 2024 11:34:08 -0600 Subject: [PATCH] Updated README with .env file instructions --- README.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c10bdcb..8c17dad 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,24 @@ Then, install the dependencies: Make a [Replicate](https://replicate.com), [OpenAI](https://beta.openai.com/), and [ElevenLabs](https://elevenlabs.io) account and set your tokens: -``` -export OPENAI_API_KEY= -export ELEVENLABS_API_KEY= -``` +### Setting Up Environment Variables +Instead of setting your tokens directly in the terminal, we'll use a `.env` file to manage them securely. Follow these steps: + +1. Create a file named `.env` in the root directory of your project. +2. Add your API keys and voice ID to the `.env` file in the following format: + + ``` + OPENAI_API_KEY=your_openai_api_key + ELEVENLABS_API_KEY=your_elevenlabs_api_key + ELEVENLABS_VOICE_ID=your_elevenlabs_voice_id + ``` + + Replace `your_openai_api_key`, `your_elevenlabs_api_key`, and `your_elevenlabs_voice_id` with your actual keys and ID. + +3. The python-dotenv package (already included in `requirements.txt`) will load these variables automatically. + +**Note:** Ensure that `.env` is listed in your `.gitignore` file to keep your API keys secure. Make a new voice in Eleven and get the voice id of that voice using their [get voices](https://elevenlabs.io/docs/api-reference/voices) API, or by clicking the flask icon next to the voice in the VoiceLab tab. ```