|
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.
gpt-llama.cpp/routes/chatRoutes.js
Lines 100 to 104 in 1c8b1c1
...
gpt-llama.cpp/routes/chatRoutes.js
Lines 115 to 120 in 1c8b1c1
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.