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 148f7d8 commit d8dbbd3Copy full SHA for d8dbbd3
src/gptcmd/llm/openai.py
@@ -43,7 +43,13 @@ def from_config(cls, conf: Dict):
43
)
44
model = conf.get("model")
45
client_opts = {k: v for k, v in conf.items() if k not in SPECIAL_OPTS}
46
- client = openai.OpenAI(**client_opts)
+ try:
47
+ client = openai.OpenAI(**client_opts)
48
+ except openai.OpenAIError as e:
49
+ # Import late to avoid circular import
50
+ from ..config import ConfigError
51
+
52
+ raise ConfigError(str(e)) from e
53
return cls(client, model=model)
54
55
def _message_to_openai(self, msg: Message) -> Dict[str, Any]:
0 commit comments