ReadOnlySharedMemory#
- class langchain.memory.readonly.ReadOnlySharedMemory[source]#
Bases:
BaseMemory
Memory wrapper that is read-only and cannot be changed.
- param memory: BaseMemory [Required]#
- async aclear() → None#
Async clear memory contents.
- Return type:
None
- async aload_memory_variables(
- inputs: dict[str, Any],
Async return key-value pairs given the text input to the chain.
- Parameters:
inputs (dict[str, Any]) – The inputs to the chain.
- Returns:
A dictionary of key-value pairs.
- Return type:
dict[str, Any]
- async asave_context(
- inputs: dict[str, Any],
- outputs: dict[str, str],
Async save the context of this chain run to memory.
- Parameters:
inputs (dict[str, Any]) – The inputs to the chain.
outputs (dict[str, str]) – The outputs of the chain.
- Return type:
None
- load_memory_variables(
- inputs: dict[str, Any],
Load memory variables from memory.
- Parameters:
inputs (dict[str, Any])
- Return type:
dict[str, str]
- save_context(
- inputs: dict[str, Any],
- outputs: dict[str, str],
Nothing should be saved or changed
- Parameters:
inputs (dict[str, Any])
outputs (dict[str, str])
- Return type:
None
- property memory_variables: list[str]#
Return memory variables.
Examples using ReadOnlySharedMemory