Memory#
The Memory module provides an in-RAM version of the DBContextStorage class.
- class MemoryContextStorage(path='', rewrite_existing=False, partial_read_config=None)[source]#
Bases:
DBContextStorageImplements
DBContextStoragestoring contexts in memory, without file backend. Does not serialize any data. By default, it sets path to an empty string.Keeps data in a dictionary and two dictionaries:
main: {context_id: context_info}
turns: {context_id: {labels, requests, responses}}
- Parameters:
path (
str) – Any string, won’t be used.rewrite_existing (
bool) – Whether TURNS modified locally should be updated in database or not.partial_read_config (
Optional[Dict[Literal['labels','requests','responses'],Union[Literal['__all__'],int,Set[int]]]]) – Dictionary of subscripts for all possible turn items.
-
is_concurrent:
bool= True#
- async _load_main_info(ctx_id)[source]#
- Return type:
Optional[ContextMainInfo]