Fix M.env AX_GRAPH_NODES not working problem
This commit is contained in:
parent
0afe35a9fd
commit
d4c4a40c53
4 changed files with 25 additions and 3 deletions
|
|
@ -29,12 +29,20 @@ from neo4j import ( # type: ignore
|
||||||
AsyncManagedTransaction,
|
AsyncManagedTransaction,
|
||||||
)
|
)
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
from dotenv import load_dotenv
|
||||||
config.read("config.ini", "utf-8")
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
# Get maximum number of graph nodes from environment variable, default is 1000
|
# Get maximum number of graph nodes from environment variable, default is 1000
|
||||||
MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000))
|
MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000))
|
||||||
|
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read("config.ini", "utf-8")
|
||||||
|
|
||||||
|
|
||||||
# Set neo4j logger level to ERROR to suppress warning logs
|
# Set neo4j logger level to ERROR to suppress warning logs
|
||||||
logging.getLogger("neo4j").setLevel(logging.ERROR)
|
logging.getLogger("neo4j").setLevel(logging.ERROR)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,13 @@ from .shared_storage import (
|
||||||
set_all_update_flags,
|
set_all_update_flags,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000))
|
MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,13 @@ if not pm.is_installed("asyncpg"):
|
||||||
import asyncpg # type: ignore
|
import asyncpg # type: ignore
|
||||||
from asyncpg import Pool # type: ignore
|
from asyncpg import Pool # type: ignore
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
|
||||||
# Get maximum number of graph nodes from environment variable, default is 1000
|
# Get maximum number of graph nodes from environment variable, default is 1000
|
||||||
MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000))
|
MAX_GRAPH_NODES = int(os.getenv("MAX_GRAPH_NODES", 1000))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1560,7 +1560,7 @@ async def _find_most_related_edges_from_entities(
|
||||||
):
|
):
|
||||||
node_names = [dp["entity_name"] for dp in node_datas]
|
node_names = [dp["entity_name"] for dp in node_datas]
|
||||||
batch_edges_dict = await knowledge_graph_inst.get_nodes_edges_batch(node_names)
|
batch_edges_dict = await knowledge_graph_inst.get_nodes_edges_batch(node_names)
|
||||||
|
|
||||||
all_edges = []
|
all_edges = []
|
||||||
seen = set()
|
seen = set()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue