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

delete_session() β†’ None[source]#

Delete a session

Return type:

None

async init() β†’ None[source]#
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