chore: added pre-commit-hooks and ruff formatting for commit-hooks
This commit is contained in:
@@ -12,15 +12,16 @@ TextChunkSchema = TypedDict(
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
@dataclass
|
||||
class QueryParam:
|
||||
mode: Literal["local", "global", "hybrid", "naive"] = "global"
|
||||
only_need_context: bool = False
|
||||
response_type: str = "Multiple Paragraphs"
|
||||
top_k: int = 60
|
||||
max_token_for_text_unit: int = 4000
|
||||
max_token_for_text_unit: int = 4000
|
||||
max_token_for_global_context: int = 4000
|
||||
max_token_for_local_context: int = 4000
|
||||
max_token_for_local_context: int = 4000
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -36,6 +37,7 @@ class StorageNameSpace:
|
||||
"""commit the storage operations after querying"""
|
||||
pass
|
||||
|
||||
|
||||
@dataclass
|
||||
class BaseVectorStorage(StorageNameSpace):
|
||||
embedding_func: EmbeddingFunc
|
||||
@@ -50,6 +52,7 @@ class BaseVectorStorage(StorageNameSpace):
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@dataclass
|
||||
class BaseKVStorage(Generic[T], StorageNameSpace):
|
||||
async def all_keys(self) -> list[str]:
|
||||
@@ -72,7 +75,7 @@ class BaseKVStorage(Generic[T], StorageNameSpace):
|
||||
|
||||
async def drop(self):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
||||
@dataclass
|
||||
class BaseGraphStorage(StorageNameSpace):
|
||||
@@ -113,4 +116,4 @@ class BaseGraphStorage(StorageNameSpace):
|
||||
raise NotImplementedError
|
||||
|
||||
async def embed_nodes(self, algorithm: str) -> tuple[np.ndarray, list[str]]:
|
||||
raise NotImplementedError("Node embedding is not used in lightrag.")
|
||||
raise NotImplementedError("Node embedding is not used in lightrag.")
|
||||
|
Reference in New Issue
Block a user