Revert "removed get_knowledge_graph"

This commit is contained in:
Yannick Stephan
2025-02-20 14:29:36 +01:00
committed by GitHub
parent 0d4c580859
commit 439685e69c
11 changed files with 324 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ from .utils import (
set_logger,
encode_string_by_tiktoken,
)
from .types import KnowledgeGraph
# TODO: TO REMOVE @Yannick
config = configparser.ConfigParser()
@@ -457,6 +458,13 @@ class LightRAG:
self._storages_status = StoragesStatus.FINALIZED
logger.debug("Finalized Storages")
async def get_knowledge_graph(
self, nodel_label: str, max_depth: int
) -> KnowledgeGraph:
return await self.chunk_entity_relation_graph.get_knowledge_graph(
node_label=nodel_label, max_depth=max_depth
)
def _get_storage_class(self, storage_name: str) -> Callable[..., Any]:
import_path = STORAGES[storage_name]
storage_class = lazy_external_import(import_path, storage_name)