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