Fix bottom anchor never being included for OpenAI

This commit is contained in:
Grzegorz Gidel
2023-05-03 17:49:11 +02:00
parent a5ae9cc7fb
commit 20f43b2c17

View File

@ -204,7 +204,7 @@ function generateOpenAIPromptCache(charPersonality, topAnchorDepth, anchorTop, b
item = `[${name2} is ${personalityAndAnchor}]\n${item}`;
}
}
if (i === openai_msgs.length - 1 && openai_msgs.length > bottomAnchorThreshold && item.trim().startsWith(name1 + ":")) {//For add anchor in end
if (i === openai_msgs.length - 1 && openai_msgs.length > bottomAnchorThreshold && msg.role === "user") {//For add anchor in end
item = anchorBottom + "\n" + item;
}