diff --git a/public/scripts/openai.js b/public/scripts/openai.js index ab4da51a1..215fe88b4 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -205,7 +205,9 @@ function generateOpenAIPromptCache(charPersonality, topAnchorDepth, anchorTop, b } } if (i === openai_msgs.length - 1 && openai_msgs.length > bottomAnchorThreshold && msg.role === "user") {//For add anchor in end - item = anchorBottom + "\n" + item; + if (anchorBottom) { + item = anchorBottom + "\n" + item; + } } msg["content"] = item;