-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper.py
16 lines (12 loc) · 895 Bytes
/
helper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Add your utilities or helper functions to this file.
import os
from dotenv import load_dotenv, find_dotenv
# these expect to find a .env file at the directory above the lesson. # the format for that file is (without the comment) #API_KEYNAME=AStringThatIsTheLongAPIKeyFromSomeService
def load_env():
_ = load_dotenv(find_dotenv())
def get_openai_api_key():
load_env()
openai_api_key = os.getenv("OPENAI_API_KEY")
print(openai_api_key)
return openai_api_key
check = get_openai_api_key()