Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Use `load_dotenv()` in `chat.py` and `speak.py`.

James C. Palmer5e746afef8eb
diff --git a/scripts/chat.py b/scripts/chat.py
index f2a5a51bcb..e6aa278150 100644
--- a/scripts/chat.py
+++ b/scripts/chat.py
@@ -1,6 +1,10 @@
import os
import time
import openai
+from dotenv import load_dotenv
+
+# Load environment variables from .env file
+load_dotenv()
# Initialize the OpenAI API client
openai.api_key = os.getenv("OPENAI_API_KEY")
diff --git a/scripts/speak.py b/scripts/speak.py
index 405c100f2d..a0f29fc586 100644
--- a/scripts/speak.py
+++ b/scripts/speak.py
@@ -1,8 +1,12 @@
import os
from playsound import playsound
import requests
+from dotenv import load_dotenv
+# Load environment variables from .env file
+load_dotenv()
+
voices = ["ErXwobaYiN019PkySvjV", "EXAVITQu4vr4xnSDxMaL"]
tts_headers = {