Browse Source

update error message during call to openai with an empty key

pull/225/head
Patrick Ruddiman 1 year ago
parent
commit
dd26b356c5
  1. 2
      installer/client/cli/utils.py

2
installer/client/cli/utils.py

@ -259,6 +259,8 @@ class Standalone:
with open(self.args.output, "w") as f:
f.write(response.choices[0].message.content)
except Exception as e:
if getattr(e.__cause__, 'args', [''])[0] == "Illegal header value b'Bearer '":
print("Error: Cannot connect to the OpenAI API Server because the API key is not set. Please run fabric --setup and add a key.")
if "All connection attempts failed" in str(e):
print(
"Error: cannot connect to llama2. If you have not already, please visit https://ollama.com for installation instructions")

Loading…
Cancel
Save