Clean-up continue nudge init

This commit is contained in:
Cohee
2024-03-23 23:11:05 +02:00
parent 6665666098
commit 7b9c0e303f

View File

@ -727,17 +727,10 @@ async function populateChatHistory(messages, prompts, chatCompletion, type = nul
let continueMessage = null;
const instruct = isOpenRouterWithInstruct();
if (type === 'continue' && cyclePrompt && !instruct && !oai_settings.continue_prefill) {
const promptObject = oai_settings.continue_prefill ?
{
identifier: 'continueNudge',
role: 'assistant',
content: cyclePrompt,
system_prompt: true,
} :
{
const promptObject = {
identifier: 'continueNudge',
role: 'system',
content: oai_settings.continue_nudge_prompt.replace('{{lastChatMessage}}', cyclePrompt),
content: oai_settings.continue_nudge_prompt.replace('{{lastChatMessage}}', String(cyclePrompt).trim()),
system_prompt: true,
};
const continuePrompt = new Prompt(promptObject);