Don't use user filler

This commit is contained in:
Cohee 2024-08-26 17:16:02 +03:00
parent 7d4b3e0800
commit 2b32c8638a

View File

@ -401,9 +401,8 @@ function convertAI21Messages(messages, charName = '', userName = '') {
messages.splice(0, i);
// Check if the first message in the array is of type user, if not, interject with humanMsgFix or a blank message.
// Also prevents erroring out if the messages array is empty.
if (messages.length === 0 || (messages.length > 0 && messages[0].role !== 'user')) {
// Prevent erroring out if the messages array is empty.
if (messages.length === 0) {
messages.unshift({
role: 'user',
content: '[Start a new chat]',