Reset token counters when switching characters. Put main prompt at the beginning

This commit is contained in:
SillyLossy 2023-06-07 20:04:15 +03:00 committed by maver
parent 14a66ec937
commit e309e18e97

View File

@ -445,6 +445,8 @@ PromptManagerModule.prototype.handleCharacterSelected = function (event) {
if (0 === promptList.length) this.addPromptListForCharacter(this.activeCharacter, openAiDefaultPromptList)
// Check whether the referenced prompts are present.
if (0 === this.serviceSettings.prompts.length) this.setPrompts(openAiDefaultPrompts.prompts);
this.updatePrompts(this.getChatCompletion().getPromptsWithTokenCount());
}
PromptManagerModule.prototype.handleGroupSelected = function (event) {
@ -454,6 +456,8 @@ PromptManagerModule.prototype.handleGroupSelected = function (event) {
if (0 === promptList.length) this.addPromptListForCharacter(characterDummy, openAiDefaultPromptList)
if (0 === this.serviceSettings.prompts.length) this.setPrompts(openAiDefaultPrompts.prompts);
this.updatePrompts(this.getChatCompletion().getPromptsWithTokenCount());
}
PromptManagerModule.prototype.getActiveGroupCharacters = function() {
@ -901,6 +905,10 @@ const openAiDefaultPromptLists = {
};
const openAiDefaultPromptList = [
{
"identifier": "main",
"enabled": true
},
{
"identifier": "worldInfoBefore",
"enabled": true
@ -937,10 +945,6 @@ const openAiDefaultPromptList = [
"identifier": "chatHistory",
"enabled": true
},
{
"identifier": "main",
"enabled": true
},
{
"identifier": "jailbreak",
"enabled": false