From 5680e9ef11ef8403f65823af59a7d52c29548d15 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 3 Mar 2025 12:24:49 +0100 Subject: [PATCH] Update lightrag_server.py --- lightrag/api/lightrag_server.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index 5f2c437f..637595d3 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -20,7 +20,7 @@ from ascii_colors import ASCIIColors from fastapi.middleware.cors import CORSMiddleware from contextlib import asynccontextmanager from dotenv import load_dotenv -from .utils_api import ( +from lightrag.api.utils_api import ( get_api_key_dependency, parse_args, get_default_host, @@ -30,14 +30,14 @@ from lightrag import LightRAG from lightrag.types import GPTKeywordExtractionFormat from lightrag.api import __api_version__ from lightrag.utils import EmbeddingFunc -from .routers.document_routes import ( +from lightrag.api.routers.document_routes import ( DocumentManager, create_document_routes, run_scanning_process, ) -from .routers.query_routes import create_query_routes -from .routers.graph_routes import create_graph_routes -from .routers.ollama_api import OllamaAPI +from lightrag.api.routers.query_routes import create_query_routes +from lightrag.api.routers.graph_routes import create_graph_routes +from lightrag.api.routers.ollama_api import OllamaAPI from lightrag.utils import logger, set_verbose_debug from lightrag.kg.shared_storage import ( @@ -48,7 +48,9 @@ from lightrag.kg.shared_storage import ( ) # Load environment variables -load_dotenv(override=True) +# Updated to use the .env that is inside the current folder +# This update allows the user to put a different.env file for each lightrag folder +load_dotenv(".env", override=True) # Initialize config parser config = configparser.ConfigParser()