momento_cachedb
langroid/cachedb/momento_cachedb.py
MomentoCacheConfig
¶
MomentoCache(config)
¶
Bases: CacheDB
Momento implementation of the CacheDB.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config |
MomentoCacheConfig
|
The configuration to use. |
required |
Source code in langroid/cachedb/momento_cachedb.py
clear()
¶
store(key, value)
¶
Store a value associated with a key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key under which to store the value. |
required |
value |
Any
|
The value to store. |
required |
Source code in langroid/cachedb/momento_cachedb.py
retrieve(key)
¶
Retrieve the value associated with a key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key to retrieve the value for. |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
Dict[str, Any] | str | None
|
The value associated with the key. |
Source code in langroid/cachedb/momento_cachedb.py
delete_keys(keys)
¶
Delete the keys from the cache.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keys |
List[str]
|
The keys to delete. |
required |
delete_keys_pattern(pattern)
¶
Delete the keys from the cache with the given pattern.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix |
str
|
The pattern to match. |
required |