Avoid an empty line in OpenAI when bottom anchor is empty

This commit is contained in:
Grzegorz Gidel
2023-05-03 19:54:18 +02:00
parent 20f43b2c17
commit a61369b52a

View File

@ -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 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; msg["content"] = item;