class AstraDBChatMessageHistoryA path to the module that contains the class, eg. ["langchain", "llms"]
const client = new AstraDB(
process.env.ASTRA_DB_APPLICATION_TOKEN,
process.env.ASTRA_DB_ENDPOINT,
process.env.ASTRA_DB_NAMESPACE
);
const collection = await client.collection("test_chat");
const chatHistory = new AstraDBChatMessageHistory({
collection,
sessionId: "YOUR_SESSION_ID",
});
const messages = await chatHistory.getMessages();
await chatHistory.clear();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 for storing chat message history with Astra DB. It extends the BaseListChatMessageHistory class and provides methods to get, add, and clear messages.