Class BaseConversationSummaryMemoryAbstract

Abstract class that provides a structure for storing and managing the memory of a conversation. It includes methods for predicting a new summary for the conversation given the existing messages and summary.

Hierarchy (view full)

Constructors

Properties

aiPrefix: string = "AI"
chatHistory: BaseChatMessageHistory
humanPrefix: string = "Human"
inputKey?: string
llm: BaseLanguageModelInterface<any, BaseLanguageModelCallOptions>
memoryKey: string = "history"
outputKey?: string
prompt: BasePromptTemplate<any, BasePromptValueInterface, any> = SUMMARY_PROMPT
returnMessages: boolean = false
summaryChatMessageClass: (new (content: string) => BaseMessage) = SystemMessage

Accessors

  • get memoryKeys(): string[]
  • Returns string[]

Methods

  • Abstract method that should take an object of input values and return a Promise that resolves with an object of memory variables. The implementation of this method should load the memory variables from the provided input values.

    Parameters

    Returns Promise<MemoryVariables>

    Promise that resolves with an object of memory variables.

  • Predicts a new summary for the conversation given the existing messages and summary.

    Parameters

    • messages: BaseMessage[]

      Existing messages in the conversation.

    • existingSummary: string

      Current summary of the conversation.

    Returns Promise<string>

    A promise that resolves to a new summary string.