AstraDBBaseStore#
- class langchain_astradb.storage.AstraDBBaseStore(*args: Any, **kwargs: Any)[source]#
Base class for the DataStax Astra DB data store.
Methods
__init__
(*args,Β **kwargs)Base class for the DataStax Astra DB data store.
amdelete
(keys)Async delete the given keys and their associated values.
amget
(keys)Async get the values associated with the given keys.
amset
(key_value_pairs)Async set the values for the given keys.
ayield_keys
(*[,Β prefix])Async get an iterator over keys that match the given prefix.
decode_value
(value)Decodes value from Astra DB.
encode_value
(value)Encodes value for Astra DB.
mdelete
(keys)Delete the given keys and their associated values.
mget
(keys)Get the values associated with the given keys.
mset
(key_value_pairs)Set the values for the given keys.
yield_keys
(*[,Β prefix])Get an iterator over keys that match the given prefix.
- Parameters:
args (Any)
kwargs (Any)
- __init__(*args: Any, **kwargs: Any) None [source]#
Base class for the DataStax Astra DB data store.
- Parameters:
args (Any)
kwargs (Any)
- Return type:
None
- async amdelete(keys: Sequence[str]) None [source]#
Async delete the given keys and their associated values.
- Parameters:
keys (Sequence[K]) β A sequence of keys to delete.
- Return type:
None
- async amget(keys: Sequence[str]) list[V | None] [source]#
Async get the values associated with the given keys.
- Parameters:
keys (Sequence[K]) β A sequence of keys.
- Returns:
A sequence of optional values associated with the keys. If a key is not found, the corresponding value will be None.
- Return type:
list[V | None]
- async amset(key_value_pairs: Sequence[tuple[str, V]]) None [source]#
Async set the values for the given keys.
- Parameters:
key_value_pairs (Sequence[Tuple[K, V]]) β A sequence of key-value pairs.
- Return type:
None
- async ayield_keys(*, prefix: str | None = None) AsyncIterator[str] [source]#
Async get an iterator over keys that match the given prefix.
- Parameters:
prefix (str) β The prefix to match.
- Yields:
Iterator[K | str] β An iterator over keys that match the given prefix. This method is allowed to return an iterator over either K or str depending on what makes more sense for the given store.
- Return type:
AsyncIterator[str]
- abstract decode_value(value: Any) V | None [source]#
Decodes value from Astra DB.
- Parameters:
value (Any)
- Return type:
V | None
- abstract encode_value(value: V | None) Any [source]#
Encodes value for Astra DB.
- Parameters:
value (V | None)
- Return type:
Any
- mdelete(keys: Sequence[str]) None [source]#
Delete the given keys and their associated values.
- Parameters:
keys (Sequence[K]) β A sequence of keys to delete.
- Return type:
None
- mget(keys: Sequence[str]) list[V | None] [source]#
Get the values associated with the given keys.
- Parameters:
keys (Sequence[K]) β A sequence of keys.
- Returns:
A sequence of optional values associated with the keys. If a key is not found, the corresponding value will be None.
- Return type:
list[V | None]
- mset(key_value_pairs: Sequence[tuple[str, V]]) None [source]#
Set the values for the given keys.
- Parameters:
key_value_pairs (Sequence[Tuple[K, V]]) β A sequence of key-value pairs.
- Return type:
None
- yield_keys(*, prefix: str | None = None) Iterator[str] [source]#
Get an iterator over keys that match the given prefix.
- Parameters:
prefix (str) β The prefix to match.
- Yields:
Iterator[K | str] β An iterator over keys that match the given prefix. This method is allowed to return an iterator over either K or str depending on what makes more sense for the given store.
- Return type:
Iterator[str]