fixed base and generic
This commit is contained in:
@@ -4,7 +4,6 @@ from typing import (
|
|||||||
TypedDict,
|
TypedDict,
|
||||||
Union,
|
Union,
|
||||||
Literal,
|
Literal,
|
||||||
Generic,
|
|
||||||
TypeVar,
|
TypeVar,
|
||||||
Optional,
|
Optional,
|
||||||
Dict,
|
Dict,
|
||||||
@@ -83,30 +82,30 @@ class BaseVectorStorage(StorageNameSpace):
|
|||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class BaseKVStorage(Generic[T], StorageNameSpace):
|
class BaseKVStorage(StorageNameSpace):
|
||||||
embedding_func: EmbeddingFunc
|
embedding_func: EmbeddingFunc
|
||||||
|
|
||||||
async def all_keys(self) -> list[str]:
|
async def all_keys(self) -> list[str]:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
async def get_by_id(self, id: str) -> Union[T, None]:
|
async def get_by_id(self, id: str) -> Union[dict[str, Any], None]:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
async def get_by_ids(self, ids: list[str]) -> list[Union[T, None]]:
|
async def get_by_ids(self, ids: list[str]) -> list[Union[dict[str, Any], None]]:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
async def filter_keys(self, data: list[str]) -> set[str]:
|
async def filter_keys(self, data: list[str]) -> set[str]:
|
||||||
"""return un-exist keys"""
|
"""return un-exist keys"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
async def upsert(self, data: dict[str, T]) -> None:
|
async def upsert(self, data: dict[str, Any]) -> None:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
async def drop(self) -> None:
|
async def drop(self) -> None:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
async def get_by_status_and_ids(
|
async def get_by_status_and_ids(
|
||||||
self, status: str, ids: list[str]
|
self, status: str
|
||||||
) -> list[dict[str, Any]]:
|
) -> list[dict[str, Any]]:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user