ajwthompson commited on
Commit
fc26409
·
1 Parent(s): f6d4bed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,8 +14,8 @@ def set_openai_api_key(api_key: str):
14
  """Set the api key and return chain.
15
  If no api_key, then None is returned.
16
  """
17
- if os.environ["OPENAI_API_KEY"]:
18
- os.environ["OPENAI_API_KEY"] = api_key
19
  chain = get_chain(vectorstore)
20
  os.environ["OPENAI_API_KEY"] = ""
21
  return chain
 
14
  """Set the api key and return chain.
15
  If no api_key, then None is returned.
16
  """
17
+ if api_key:
18
+ os.environ["OPENAI_API_KEY"] = os.environ["OPENAI_API_KEY"]
19
  chain = get_chain(vectorstore)
20
  os.environ["OPENAI_API_KEY"] = ""
21
  return chain