class RedisChatMessageHistoryA path to the module that contains the class, eg. ["langchain", "llms"]
const chatHistory = new RedisChatMessageHistory({
sessionId: new Date().toISOString(),
sessionTTL: 300,
url: "redis:
});
const chain = new ConversationChain({
llm: new ChatOpenAI({ model: "gpt-4o-mini", 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.
Class used to store chat message history in Redis. It provides methods to add, retrieve, and clear messages from the chat history.