manubot / manubot-ai-editor

BSD 3-Clause "New" or "Revised" License
39 stars 9 forks source link

Widens missing OpenAI API key check to include blank strings #46

Closed falquaddoomi closed 4 months ago

falquaddoomi commented 4 months ago

This PR widens the check for a missing OPENAI_API_KEY env var to when that env var is a blank string, which I believe happens when repo in which the AI revision GitHub workflow runs doesn't have the OPENAI_API_KEY secret registered. See here: https://github.com/CU-DBMI/rootstock/blob/main/.github/workflows/ai-revision.yaml#L59.

After this PR, the error message will be "OpenAI API key not found. Please provide it as parameter or set it as an the environment variable OPENAI_API_KEY". Let me know if that's informative enough, or if it should be updated.

Closes #45.

miltondp commented 4 months ago

Faisal, when you merge this, we will need a new AI editor release. When you do that, I can quickly test it.