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,8 +205,10 @@ 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 (anchorBottom) {
item = anchorBottom + "\n" + item;
}
}
msg["content"] = item;
openai_msgs[i] = msg;