Fix continue prefill newline prefix
This commit is contained in:
parent
5515f28105
commit
2b481dae2d
|
@ -752,7 +752,8 @@ async function populateChatHistory(messages, prompts, chatCompletion, type = nul
|
||||||
if (type === 'continue' && oai_settings.continue_prefill && chatPrompt === firstNonInjected) {
|
if (type === 'continue' && oai_settings.continue_prefill && chatPrompt === firstNonInjected) {
|
||||||
// in case we are using continue_prefill and the latest message is an assistant message, we want to prepend the users assistant prefill on the message
|
// in case we are using continue_prefill and the latest message is an assistant message, we want to prepend the users assistant prefill on the message
|
||||||
if (chatPrompt.role === 'assistant') {
|
if (chatPrompt.role === 'assistant') {
|
||||||
const continueMessage = await Message.createAsync(chatMessage.role, substituteParams(oai_settings.assistant_prefill + '\n\n') + chatMessage.content, chatMessage.identifier);
|
const messageContent = [substituteParams(oai_settings.assistant_prefill), chatMessage.content].filter(x => x).join('\n\n');
|
||||||
|
const continueMessage = await Message.createAsync(chatMessage.role, messageContent, chatMessage.identifier);
|
||||||
const collection = new MessageCollection('continuePrefill', continueMessage);
|
const collection = new MessageCollection('continuePrefill', continueMessage);
|
||||||
chatCompletion.add(collection, -1);
|
chatCompletion.add(collection, -1);
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue