From 8e52846a8b844f0dc0ef6dcb713841d6dbb6cad4 Mon Sep 17 00:00:00 2001 From: hyb <468949484@qq.com> Date: Sat, 25 Jan 2025 18:54:40 +0800 Subject: [PATCH] fix: webui fix --- lightrag/api/webui/static/__init__.py | 0 lightrag/api/webui/static/css/__init__.py | 0 lightrag/api/webui/static/js/__init__.py | 0 lightrag/base.py | 20 +++++++++++++++++++- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 lightrag/api/webui/static/__init__.py create mode 100644 lightrag/api/webui/static/css/__init__.py create mode 100644 lightrag/api/webui/static/js/__init__.py diff --git a/lightrag/api/webui/static/__init__.py b/lightrag/api/webui/static/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lightrag/api/webui/static/css/__init__.py b/lightrag/api/webui/static/css/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lightrag/api/webui/static/js/__init__.py b/lightrag/api/webui/static/js/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lightrag/base.py b/lightrag/base.py index 1b5fe98c..36e70893 100644 --- a/lightrag/base.py +++ b/lightrag/base.py @@ -1,5 +1,15 @@ from dataclasses import dataclass, field -from typing import TypedDict, Union, Literal, Generic, TypeVar, Optional, Dict, Any +from typing import ( + TypedDict, + Union, + Literal, + Generic, + TypeVar, + Optional, + Dict, + Any, + List, +) from enum import Enum import numpy as np @@ -140,6 +150,14 @@ class BaseGraphStorage(StorageNameSpace): async def embed_nodes(self, algorithm: str) -> tuple[np.ndarray, list[str]]: raise NotImplementedError("Node embedding is not used in lightrag.") + async def get_all_labels(self) -> List[str]: + raise NotImplementedError + + async def get_knowledge_graph( + self, node_label: str, max_depth: int = 5 + ) -> Dict[str, List[Dict]]: + raise NotImplementedError + class DocStatus(str, Enum): """Document processing status enum"""