mirror of
https://github.com/danielmiessler/fabric
synced 2024-11-10 07:10:31 +00:00
fixed setup
This commit is contained in:
parent
8312e326e7
commit
c8e1c4d2ea
@ -38,10 +38,10 @@ class Standalone:
|
||||
load_dotenv(env_file)
|
||||
try:
|
||||
apikey = os.environ["OPENAI_API_KEY"]
|
||||
self.client = OpenAI()
|
||||
self.client.api_key = apikey
|
||||
except KeyError:
|
||||
print("OPENAI_API_KEY not found in environment variables.")
|
||||
except:
|
||||
pass
|
||||
self.client = OpenAI()
|
||||
self.client.api_key = apikey
|
||||
|
||||
except FileNotFoundError:
|
||||
print("No API key found. Use the --apikey option to set the key")
|
||||
|
Loading…
Reference in New Issue
Block a user