MotorheadMemory#
- class langchain_community.memory.motorhead_memory.MotorheadMemory[source]#
Bases:
BaseChatMemory
Chat message memory backed by Motorhead service.
- param api_key: str | None = None#
- param chat_memory: BaseChatMessageHistory [Optional]#
- param client_id: str | None = None#
- param context: str | None = None#
- param input_key: str | None = None#
- param memory_key: str = 'history'#
- param output_key: str | None = None#
- param return_messages: bool = False#
- param session_id: str [Required]#
- param timeout: int = 3000#
- param url: str = 'https://api.getmetal.io/v1/motorhead'#
- async aclear() None #
Clear memory contents.
- Return type:
None
- async aload_memory_variables(inputs: Dict[str, Any]) 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]) None #
Save context from this conversation to buffer.
- Parameters:
inputs (Dict[str, Any]) β
outputs (Dict[str, str]) β
- Return type:
None
- clear() None #
Clear memory contents.
- Return type:
None
- load_memory_variables(values: Dict[str, Any]) Dict[str, Any] [source]#
Return key-value pairs given the text input to the chain.
- Parameters:
inputs β The inputs to the chain.
values (Dict[str, Any]) β
- Returns:
A dictionary of key-value pairs.
- Return type:
Dict[str, Any]
- save_context(inputs: Dict[str, Any], outputs: Dict[str, str]) None [source]#
Save context from this conversation to buffer.
- Parameters:
inputs (Dict[str, Any]) β
outputs (Dict[str, str]) β
- Return type:
None
- property memory_variables: List[str]#
The string keys this memory class will add to chain inputs.
Examples using MotorheadMemory