Skip to content

Finding last messages? #57

Open
Open
@msj121

Description

@msj121

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions