refactor: standardize .env loading behavior across modules
- Use .env from current folder for each lightrag instance - Allow different .env files for different instances - Make OS env vars take precedence over .env file
This commit is contained in:
@@ -19,9 +19,10 @@ import tiktoken
|
||||
from lightrag.prompt import PROMPTS
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv(override=True)
|
||||
|
||||
# use the .env that is inside the current folder
|
||||
# allows to use different .env file for each lightrag instance
|
||||
# the OS environment variables take precedence over the .env file
|
||||
load_dotenv(dotenv_path=".env", override=False)
|
||||
|
||||
VERBOSE_DEBUG = os.getenv("VERBOSE", "false").lower() == "true"
|
||||
|
||||
|
Reference in New Issue
Block a user