Better error message if .env is empty/does not exist.

This commit is contained in:
VaiTon 2023-07-06 00:16:11 +02:00
parent b1057afdf8
commit 28537b6a84
3 changed files with 11 additions and 6 deletions

View file

@ -6,6 +6,8 @@ load_dotenv()
# Define the folder for storing database
PERSIST_DIRECTORY = os.environ.get('PERSIST_DIRECTORY')
if PERSIST_DIRECTORY is None:
raise Exception("Please set the PERSIST_DIRECTORY environment variable")
# Define the Chroma settings
CHROMA_SETTINGS = Settings(