yangdx commited on
Commit
1e7527b
·
1 Parent(s): d3b4df6

Fix OPENAI_API_BASE not working in .env

Browse files
Files changed (1) hide show
  1. lightrag/llm/openai.py +7 -0
lightrag/llm/openai.py CHANGED
@@ -37,6 +37,13 @@ from lightrag.api import __api_version__
37
  import numpy as np
38
  from typing import Any, Union
39
 
 
 
 
 
 
 
 
40
 
41
  class InvalidResponseError(Exception):
42
  """Custom exception class for triggering retry mechanism"""
 
37
  import numpy as np
38
  from typing import Any, Union
39
 
40
+ from dotenv import load_dotenv
41
+
42
+ # use the .env that is inside the current folder
43
+ # allows to use different .env file for each lightrag instance
44
+ # the OS environment variables take precedence over the .env file
45
+ load_dotenv(dotenv_path=".env", override=False)
46
+
47
 
48
  class InvalidResponseError(Exception):
49
  """Custom exception class for triggering retry mechanism"""