Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finding last messages? #57

Open
msj121 opened this issue Jun 12, 2023 · 0 comments
Open

Finding last messages? #57

msj121 opened this issue Jun 12, 2023 · 0 comments

Comments

@msj121
Copy link

msj121 commented Jun 12, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant