keldenl/gpt-llama.cpp

Finding last messages?

msj121 opened this issue · 0 comments

let lastMessages = [maybeLastMessage];
if (maybeLastMessage.role !== 'user') {
const lastLastMessage = messages.pop();
lastMessages = [lastLastMessage, ...lastMessages];
}

...
const samePrompt =
global.lastRequest &&
global.lastRequest.type === 'chat' &&
compareArrays(global.lastRequest.messages, messages);
const continuedInteraction =
!!global.childProcess && samePrompt && messages.length > 1;

Shouldn't the first quote just loop until it hits "assistant" as a role? I want to enter a "system" message and then a "user" message after. But then the logic here would cause the system to think it is a new conversation because it doesn't match the last conversation.

I can put a user message and after a system message but the chat response behaves badly when I do this.