Swap elif with else, as usage of this method does not use openai_api_key

This commit is contained in:
Saba
2023-06-04 02:25:08 -07:00
parent 6508379d7b
commit 068ee0ac5e

View File

@@ -43,7 +43,7 @@ def completion_with_backoff(**kwargs):
prompt = kwargs.pop("prompt")
if "api_key" in kwargs:
kwargs["openai_api_key"] = kwargs.get("api_key")
elif "openai_api_key" not in kwargs:
else:
kwargs["openai_api_key"] = os.getenv("OPENAI_API_KEY")
llm = OpenAI(**kwargs, request_timeout=10, max_retries=1)
return llm(prompt)