We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent edb1982 commit 9b8f4e1Copy full SHA for 9b8f4e1
gptme/llm.py
@@ -27,7 +27,7 @@ def init_llm(llm: str):
27
if llm == "openai":
28
if "OPENAI_API_KEY" in os.environ:
29
api_key = os.environ["OPENAI_API_KEY"]
30
- elif api_key := config["env"]["OPENAI_API_KEY"]:
+ elif api_key := config["env"].get("OPENAI_API_KEY", None):
31
pass
32
else:
33
print("Error: OPENAI_API_KEY not set in env or config, see README.")
0 commit comments