minyma/minyma/config.py
Evan Reichard 7f0d74458d
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
[add] migrate chromadb to plugin
2023-11-08 18:35:56 -05:00

26 lines
779 B
Python

import os
def get_env(key, default=None, required=False) -> str:
"""Wrapper for gathering env vars."""
if required:
assert key in os.environ, "Missing Environment Variable: %s" % key
return str(os.environ.get(key, default))
class Config:
"""Wrap application configurations
Attributes
----------
DATA_PATH : str
The path where to store any resources (default: ./)
OPENAI_API_KEY : str
OpenAI API Key - Required
"""
CHROMA_DATA_PATH: str = get_env("CHROMA_DATA_PATH", required=False)
HOME_ASSISTANT_API_KEY: str = get_env("HOME_ASSISTANT_API_KEY", required=False)
HOME_ASSISTANT_URL: str = get_env("HOME_ASSISTANT_URL", required=False)
OPENAI_API_KEY: str = get_env("OPENAI_API_KEY", required=True)