Chatbot-Long-Short-Term-Memory
Chatbot-Long-Short-Term-Memory copied to clipboard
Reroll
Is there a way to add a message reroll function after it has been sent by the bot? Or edit function?
Is there a way to add a message reroll function after it has been sent by the bot? Or edit function?
What do you mean with "reroll"?
They mean generating the last message with the same prompt again, like what ChatGPT does already.
Is there a way to add a message reroll function after it has been sent by the bot? Or edit function?
Yes, you can do it by writing a function that simply recalls the createChatCompletion method on the backend with the same input. Note that you would also have to delete the last two messages obtained from the getLastThreeInteractions() function and from the database(here you would have to delete only the last object) when calling this function in order to generate a new response that is not based on the previous generated message.
Hello again. Sorry if I'm taking up your time, I just don't understand this topic at all. If you don't want to waste time on this, then just close the request. In another case, the next question is, is this function suitable? - async function regenerateResponse(input) { const response = await createChatCompletion(input);
const interactionHistory = await getLastThreeInteractions(); await deleteInteraction(interactionHistory[1].id); await deleteInteraction(interactionHistory[2].id);
const conversation = await getConversation(); conversation.pop(); conversation.pop();
return response; }