mirror of
https://github.com/Hopiu/llm.git
synced 2026-05-17 10:11:06 +00:00
Better error message for invalid API key
This commit is contained in:
parent
9fb3293cba
commit
a5f5801b96
1 changed files with 2 additions and 0 deletions
|
|
@ -112,6 +112,8 @@ def openai_(prompt, system, gpt4, model, stream, no_log, code, _continue, chat_i
|
|||
if code:
|
||||
content = unwrap_markdown(content)
|
||||
print(content)
|
||||
except openai.error.AuthenticationError as ex:
|
||||
raise click.ClickException("{}: {}".format(ex.error.type, ex.error.code))
|
||||
except openai.error.OpenAIError as ex:
|
||||
raise click.ClickException(str(ex))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue