standardize .env loading behavior across modules

This commit is contained in:
yangdx
2025-03-29 03:48:38 +08:00
parent 9559ed857b
commit 65574459f9
4 changed files with 13 additions and 8 deletions

View File

@@ -38,8 +38,10 @@ from .prompt import GRAPH_FIELD_SEP, PROMPTS
import time
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)
def chunking_by_token_size(