Skip to content

Commit c5a7447

Browse files
committed
fixup! fcc8a8b
1 parent fcc8a8b commit c5a7447

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

src/git_draft/bots/__init__.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from collections.abc import Sequence
44
import importlib
5-
import os
65
import sys
76

87
from ..common import (
@@ -64,29 +63,16 @@ def _parse_overrides(overrides: Sequence[str]) -> JSONObject:
6463

6564

6665
def _default_bot(options: JSONObject) -> Bot:
67-
if not os.environ.get("OPENAI_API_KEY"):
68-
raise RuntimeError(
69-
reindent(
70-
"""
71-
The default bot implementation requires an OpenAI API key.
72-
Please specify one via the `$OPENAI_API_KEY` environment
73-
variable or enable a different bot in your configuration.
74-
"""
75-
)
76-
)
77-
7866
try:
7967
from .openai_api import new_completions_bot
8068

8169
except ImportError:
8270
raise RuntimeError(
83-
reindent(
84-
"""
85-
The default bot implementation requires the `openai` Python
86-
package. Please install it or specify a different bot in
87-
your configuration.
88-
"""
89-
)
71+
reindent("""
72+
The default bot implementation requires the `openai` Python
73+
package. Please install it or specify a different bot in
74+
your configuration.
75+
""")
9076
)
9177
else:
9278
return new_completions_bot(**options)

0 commit comments

Comments
 (0)