Fix invalid character name error not being handled
This commit is contained in:
parent
00e9987fb7
commit
6a52d6febd
|
@ -449,7 +449,7 @@ function populateChatHistory(prompts, chatCompletion, type = null, cyclePrompt =
|
|||
|
||||
if (true === promptManager.serviceSettings.names_in_completion && prompt.name)
|
||||
if (promptManager.isValidName(prompt.name)) chatMessage.name = prompt.name;
|
||||
else throw InvalidCharacterNameError();
|
||||
else throw new InvalidCharacterNameError();
|
||||
|
||||
if (chatCompletion.canAfford(chatMessage)) chatCompletion.insertAtStart(chatMessage, 'chatHistory');
|
||||
else return false;
|
||||
|
@ -720,7 +720,7 @@ function prepareOpenAIMessages({
|
|||
}
|
||||
} finally {
|
||||
const messages = chatCompletion.getMessages();
|
||||
promptManager.populateTokenHandler(messages);
|
||||
if (null === promptManager.error) promptManager.populateTokenHandler(messages);
|
||||
promptManager.setMessages(messages);
|
||||
|
||||
// All information are up-to-date, render.
|
||||
|
|
Loading…
Reference in New Issue