File tree Expand file tree Collapse file tree 1 file changed +5
-19
lines changed
Expand file tree Collapse file tree 1 file changed +5
-19
lines changed Original file line number Diff line number Diff line change 22
33from collections .abc import Sequence
44import importlib
5- import os
65import sys
76
87from ..common import (
@@ -64,29 +63,16 @@ def _parse_overrides(overrides: Sequence[str]) -> JSONObject:
6463
6564
6665def _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 )
You can’t perform that action at this time.
0 commit comments