Compare commits
No commits in common. "1a11d281ec75bb6841cf51ed5d950cd4fa0add42" and "d90ceab967209d183f341fa0482a947a121aafb1" have entirely different histories.
1a11d281ec
...
d90ceab967
13
llamabot.js
13
llamabot.js
@ -121,6 +121,17 @@ client.on('messageCreate', async (message) => {
|
|||||||
role: 'assistant',
|
role: 'assistant',
|
||||||
content: `Hello, ${message.author.username}, I am here to answer any question you have, how may I help you?`
|
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') {
|
if (message.content === '!reset' || message.content === '!r') {
|
||||||
@ -178,8 +189,6 @@ async function generateResponse(conversation) {
|
|||||||
|
|
||||||
const messagesCopy = [...conversation.messages]; // create a copy of the messages array
|
const messagesCopy = [...conversation.messages]; // create a copy of the messages array
|
||||||
|
|
||||||
console.log(conversation)
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`http://${process.env.ROOT_IP}:${process.env.ROOT_PORT}/v1/chat/completions`, {
|
const response = await fetch(`http://${process.env.ROOT_IP}:${process.env.ROOT_PORT}/v1/chat/completions`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user