mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-09 08:38:53 +01:00
Reset token counters when switching characters. Put main prompt at the beginning
This commit is contained in:
parent
14a66ec937
commit
e309e18e97
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user