Simple
SimpleKVStore #
Bases: BaseInMemoryKVStore
Simple in-memory Key-Value store.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Optional[DATA_TYPE]
|
data to initialize the store with |
None
|
Source code in llama-index-core/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 108 |
|
put #
put(key: str, val: dict, collection: str = DEFAULT_COLLECTION) -> None
Put a key-value pair into the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
31 32 33 34 35 |
|
aput
async
#
aput(key: str, val: dict, collection: str = DEFAULT_COLLECTION) -> None
Put a key-value pair into the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
37 38 39 40 41 |
|
get #
get(key: str, collection: str = DEFAULT_COLLECTION) -> Optional[dict]
Get a value from the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
43 44 45 46 47 48 49 50 |
|
aget
async
#
aget(key: str, collection: str = DEFAULT_COLLECTION) -> Optional[dict]
Get a value from the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
52 53 54 55 56 |
|
get_all #
get_all(collection: str = DEFAULT_COLLECTION) -> Dict[str, dict]
Get all values from the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
58 59 60 |
|
aget_all
async
#
aget_all(collection: str = DEFAULT_COLLECTION) -> Dict[str, dict]
Get all values from the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
62 63 64 |
|
delete #
delete(key: str, collection: str = DEFAULT_COLLECTION) -> bool
Delete a value from the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
66 67 68 69 70 71 72 |
|
adelete
async
#
adelete(key: str, collection: str = DEFAULT_COLLECTION) -> bool
Delete a value from the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
74 75 76 |
|
persist #
persist(persist_path: str, fs: Optional[AbstractFileSystem] = None) -> None
Persist the store.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
78 79 80 81 82 83 84 85 86 87 88 |
|
from_persist_path
classmethod
#
from_persist_path(persist_path: str, fs: Optional[AbstractFileSystem] = None) -> SimpleKVStore
Load a SimpleKVStore from a persist path and filesystem.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
90 91 92 93 94 95 96 97 98 99 |
|
to_dict #
to_dict() -> dict
Save the store as dict.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
101 102 103 |
|
from_dict
classmethod
#
from_dict(save_dict: dict) -> SimpleKVStore
Load a SimpleKVStore from dict.
Source code in llama-index-core/llama_index/core/storage/kvstore/simple_kvstore.py
105 106 107 108 |
|