Simple
SimpleKVStore #
Bases: BaseInMemoryKVStore
简单的内存键值存储。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
可选[数据类型]
|
用于初始化存储的数据 |
None
|
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
put #
put(
key: str,
val: dict,
collection: str = DEFAULT_COLLECTION,
) -> None
将一个键值对放入存储中。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
30 31 32 33 34 |
|
aput
async
#
aput(
key: str,
val: dict,
collection: str = DEFAULT_COLLECTION,
) -> None
将一个键值对放入存储中。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
36 37 38 39 40 |
|
get #
get(
key: str, collection: str = DEFAULT_COLLECTION
) -> Optional[dict]
从商店获取一个值。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
42 43 44 45 46 47 48 49 |
|
aget
async
#
aget(
key: str, collection: str = DEFAULT_COLLECTION
) -> Optional[dict]
从商店获取一个值。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
51 52 53 54 55 |
|
get_all #
get_all(
collection: str = DEFAULT_COLLECTION,
) -> Dict[str, dict]
从商店获取所有的数值。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
57 58 59 |
|
aget_all
async
#
aget_all(
collection: str = DEFAULT_COLLECTION,
) -> Dict[str, dict]
从商店获取所有的数值。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
61 62 63 |
|
delete #
delete(
key: str, collection: str = DEFAULT_COLLECTION
) -> bool
从存储中删除一个数值。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
65 66 67 68 69 70 71 |
|
adelete
async
#
adelete(
key: str, collection: str = DEFAULT_COLLECTION
) -> bool
从存储中删除一个数值。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
73 74 75 |
|
persist #
persist(
persist_path: str,
fs: Optional[AbstractFileSystem] = None,
) -> None
持久化存储。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
77 78 79 80 81 82 83 84 85 86 87 |
|
from_persist_path
classmethod
#
from_persist_path(
persist_path: str,
fs: Optional[AbstractFileSystem] = None,
) -> SimpleKVStore
从持久路径和文件系统加载一个SimpleKVStore。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
89 90 91 92 93 94 95 96 97 98 |
|
to_dict #
to_dict() -> dict
将商店保存为字典。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
100 101 102 |
|
from_dict
classmethod
#
from_dict(save_dict: dict) -> SimpleKVStore
从字典中加载一个SimpleKVStore。
Source code in llama_index/core/storage/kvstore/simple_kvstore.py
104 105 106 107 |
|