Browse Source

fixed setup

pull/174/head
jad2121 12 months ago
parent
commit
c8e1c4d2ea
  1. 8
      installer/client/cli/utils.py

8
installer/client/cli/utils.py

@ -38,10 +38,10 @@ class Standalone:
load_dotenv(env_file) load_dotenv(env_file)
try: try:
apikey = os.environ["OPENAI_API_KEY"] apikey = os.environ["OPENAI_API_KEY"]
self.client = OpenAI() except:
self.client.api_key = apikey pass
except KeyError: self.client = OpenAI()
print("OPENAI_API_KEY not found in environment variables.") self.client.api_key = apikey
except FileNotFoundError: except FileNotFoundError:
print("No API key found. Use the --apikey option to set the key") print("No API key found. Use the --apikey option to set the key")

Loading…
Cancel
Save