Class for storing chat message history using Redis. Extends the
BaseListChatMessageHistory class.
class RedisChatMessageHistoryconst chatHistory = new RedisChatMessageHistory({
sessionId: new Date().toISOString(),
sessionTTL: 300,
url: "redis:
});
const chain = new ConversationChain({
llm: new ChatOpenAI({ model: "gpt-3.5-turbo", temperature: 0 }),
memory: { chatHistory },
});
const response = await chain.invoke({
input: "What did I just say my name was?",
});
console.log({ response });A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.