Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reroll #3

Open
Jaroslab opened this issue Mar 4, 2023 · 4 comments
Open

Reroll #3

Jaroslab opened this issue Mar 4, 2023 · 4 comments

Comments

@Jaroslab
Copy link

Jaroslab commented Mar 4, 2023

Is there a way to add a message reroll function after it has been sent by the bot? Or edit function?

@FaustoNisida
Copy link
Owner

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"?

@tovaru
Copy link

tovaru commented Mar 5, 2023

They mean generating the last message with the same prompt again, like what ChatGPT does already.

@FaustoNisida
Copy link
Owner

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.

@Jaroslab
Copy link
Author

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants