From 20f43b2c17a35b466c0d4ce44c0df8dd8af08e8c Mon Sep 17 00:00:00 2001 From: Grzegorz Gidel Date: Wed, 3 May 2023 17:49:11 +0200 Subject: [PATCH] Fix bottom anchor never being included for OpenAI --- public/scripts/openai.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 6847711b0..ab4da51a1 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -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; }