You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain-hub/prompts/memory/summarize
Anonymous 48989e6a0c update readmes 1 year ago
..
README.md update readmes 1 year ago
prompt.json cr 1 year ago

README.md

Description of Summarize Memory Prompt

Prompt designed to summarize conversation history.

Inputs

This is a description of the inputs that the prompt expects.

  1. summary: Existing summary of conversation up to this point.
  2. new_lines: New lines of conversation to be added into the summary.

Usage

Below is a code snippet for how to use the prompt.

from langchain.prompts import load_prompt
from langchain.chains import ConversationChain
from langchain.chains.conversation.memory import ConversationSummaryMemory

llm = ...
prompt = load_prompt('lc://prompts/memory/summarize/<file-name>')
memory = ConversationSummaryMemory(llm=llm, prompt=prompt)
chain = ConversationChain(llm=llm, memory=memory)