Siddhant commited on
Commit
50d754a
·
unverified ·
1 Parent(s): bd0a065

environment variable method changed

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -53,7 +53,7 @@ class ChatWrapper:
53
  os.environ["OPENAI_API_KEY"] = ""
54
 
55
  import openai
56
- openai.api_key = os.environ["OPENAI_API_KEY"]
57
  # Run chain and append input.
58
  output = chain({"question": inp, "chat_history": history})["answer"]
59
  history.append((inp, output))
 
53
  os.environ["OPENAI_API_KEY"] = ""
54
 
55
  import openai
56
+ openai.api_key = os.environ.get("OPENAI_API_KEY")
57
  # Run chain and append input.
58
  output = chain({"question": inp, "chat_history": history})["answer"]
59
  history.append((inp, output))