Skip to content

Commit

Permalink
Merge pull request #242 from SuffolkLITLab/no_key_no_log
Browse files Browse the repository at this point in the history
If no openai key, don't try to make an OpenAI obj
  • Loading branch information
nonprofittechy authored Jan 9, 2024
2 parents 461dd77 + 251d27c commit 2970ec3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docassemble/ALToolbox/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@

if os.getenv("OPENAI_API_KEY"):
client: Optional[OpenAI] = OpenAI()
else:
elif get_config("open ai"):
api_key = get_config("open ai", {}).get("key")
client = OpenAI(api_key=api_key)
else:
client = None

always_reserved_names = set(
docassemble.base.util.__all__
Expand Down

0 comments on commit 2970ec3

Please sign in to comment.