Replies: 1 comment
-
🤖 Hello, From your code, it seems like you're using the In your let chatHistory = '';
// First interaction
result = await chain.call({
question: message,
chat_history: chatHistory,
});
chatHistory += `${message}\n${result.text}`;
// Second interaction
const followUpRes = await chain.call({
question: "Was that nice?",
chat_history: chatHistory,
}); In this code, we're updating Also, make sure that the const memory = new BufferMemory({
memoryKey: "chat_history",
inputKey: "question",
outputKey: "text",
}); I hope this helps! Let me know if you have any other questions. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I applied memory to the conversation so it knows what I just told him?
I am using Next.js
Conversation:
Code is here:
Beta Was this translation helpful? Give feedback.
All reactions