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

Constructors

Properties

aiPrefix: string = "AI"
humanPrefix: string = "Human"
llm: BaseLanguageModelInterface
memoryKey: string = "history"
prompt: BasePromptTemplate = SUMMARY_PROMPT
summaryChatMessageClass: (new (content) => BaseMessage) = SystemMessage

Type declaration

    • new (content): BaseMessage
    • Parameters

      • content: string

      Returns BaseMessage

Methods

  • 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.

Generated using TypeDoc