mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-10 17:10:45 +01:00
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 (true === promptManager.serviceSettings.names_in_completion && prompt.name)
|
||||||
if (promptManager.isValidName(prompt.name)) chatMessage.name = 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');
|
if (chatCompletion.canAfford(chatMessage)) chatCompletion.insertAtStart(chatMessage, 'chatHistory');
|
||||||
else return false;
|
else return false;
|
||||||
@ -720,7 +720,7 @@ function prepareOpenAIMessages({
|
|||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
const messages = chatCompletion.getMessages();
|
const messages = chatCompletion.getMessages();
|
||||||
promptManager.populateTokenHandler(messages);
|
if (null === promptManager.error) promptManager.populateTokenHandler(messages);
|
||||||
promptManager.setMessages(messages);
|
promptManager.setMessages(messages);
|
||||||
|
|
||||||
// All information are up-to-date, render.
|
// All information are up-to-date, render.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user