简单
简单键值存储 #
基类:EventMutableMappingKVStore[dict]
简单的内存键值存储。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
data
|
Optional[DATA_TYPE]
|
用于初始化存储的数据 |
None
|
workflows/handler.py 中的源代码llama_index/core/storage/kvstore/simple_kvstore.py
16 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 | |
persist #
persist(persist_path: str, fs: Optional[AbstractFileSystem] = None) -> None
持久化存储。
workflows/handler.py 中的源代码llama_index/core/storage/kvstore/simple_kvstore.py
35 36 37 38 39 40 41 42 43 44 45 | |
from_persist_path
classmethod
#
from_persist_path(persist_path: str, fs: Optional[AbstractFileSystem] = None) -> SimpleKVStore
从持久化路径和文件系统加载一个SimpleKVStore。
workflows/handler.py 中的源代码llama_index/core/storage/kvstore/simple_kvstore.py
47 48 49 50 51 52 53 54 55 56 | |
to_dict #
to_dict() -> dict
将存储保存为字典。
workflows/handler.py 中的源代码llama_index/core/storage/kvstore/simple_kvstore.py
58 59 60 | |
from_dict
classmethod
#
from_dict(save_dict: dict) -> SimpleKVStore
从字典加载一个SimpleKVStore。
workflows/handler.py 中的源代码llama_index/core/storage/kvstore/simple_kvstore.py
62 63 64 65 | |
选项: 成员:- SimpleKVStore