Compare commits

...

2 Commits

Author SHA1 Message Date
Raven Scott
1a11d281ec fixing duplicate message bug 2023-04-11 17:38:47 +02:00
Raven Scott
7d68f426d0 fixing duplicate message bug 2023-04-11 16:36:15 +02:00

View File

@ -121,17 +121,6 @@ client.on('messageCreate', async (message) => {
role: 'assistant',
content: `Hello, ${message.author.username}, I am here to answer any question you have, how may I help you?`
});
conversation.messages.push({
role: 'user',
content: message.cleanContent
});
} else {
// Append user message to conversation history
conversation.messages.push({
role: 'user',
content: message.cleanContent
});
}
if (message.content === '!reset' || message.content === '!r') {
@ -189,6 +178,8 @@ async function generateResponse(conversation) {
const messagesCopy = [...conversation.messages]; // create a copy of the messages array
console.log(conversation)
try {
const response = await fetch(`http://${process.env.ROOT_IP}:${process.env.ROOT_PORT}/v1/chat/completions`, {
method: 'POST',