Skip to content

Commit

Permalink
Updated the way the openai key is ingested.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard committed Oct 14, 2023
1 parent fc1c4c8 commit 254a853
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import os
import openai
import random

# Initialize OpenAI API
openai.api_key = "your-openai-api-key-here" # Replace with your actual API key
openai.api_key = os.getenv("OPENAI_API_KEY") # Alternative: Use environment variable
if openai.api_key is None:
raise Exception("No OpenAI API key found. Please set it as an environment variable or in main.py")

# Function to generate queries using OpenAI's ChatGPT
def generate_queries_chatgpt(original_query):
Expand Down

0 comments on commit 254a853

Please sign in to comment.