First "proper" version

This commit is contained in:
KAuser2094
2023-03-06 12:32:22 +00:00
parent 8be32f90da
commit ce3ec3359e
3 changed files with 16 additions and 10 deletions
+7 -3
View File
@@ -12,6 +12,8 @@ import subprocess
from termcolor import colored
from colorama import init
import dotenv
# Check if the user globally disabled the safety switch
def get_yolo_safety_switch_config():
@@ -78,10 +80,12 @@ if __name__ == "__main__":
ask_flag = False # safety switch -a command line argument
yolo = "" # user's answer to safety switch (-a) question y/n
# Two options for the user to specify they openai api key
home_path = os.path.expanduser("~")
openai.api_key = os.getenv("OPENAI_API_KEY")
# Two options for the user to specify they openai api key. Windows: Comment out the one you are not using (Causes extra line to appear)
home_path = os.path.expanduser("~")
openai.api_key_path = os.path.join(home_path,".openai.apikey")
dotenv.load_dotenv()
openai.api_key = os.getenv("OPENAI_API_KEY")
# Parse arguments and make sure we have at least a single word
if len(sys.argv) < 2: