mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-15 11:40:44 +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)
|
if (0 === promptList.length) this.addPromptListForCharacter(this.activeCharacter, openAiDefaultPromptList)
|
||||||
// Check whether the referenced prompts are present.
|
// Check whether the referenced prompts are present.
|
||||||
if (0 === this.serviceSettings.prompts.length) this.setPrompts(openAiDefaultPrompts.prompts);
|
if (0 === this.serviceSettings.prompts.length) this.setPrompts(openAiDefaultPrompts.prompts);
|
||||||
|
|
||||||
|
this.updatePrompts(this.getChatCompletion().getPromptsWithTokenCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
PromptManagerModule.prototype.handleGroupSelected = function (event) {
|
PromptManagerModule.prototype.handleGroupSelected = function (event) {
|
||||||
@ -454,6 +456,8 @@ PromptManagerModule.prototype.handleGroupSelected = function (event) {
|
|||||||
|
|
||||||
if (0 === promptList.length) this.addPromptListForCharacter(characterDummy, openAiDefaultPromptList)
|
if (0 === promptList.length) this.addPromptListForCharacter(characterDummy, openAiDefaultPromptList)
|
||||||
if (0 === this.serviceSettings.prompts.length) this.setPrompts(openAiDefaultPrompts.prompts);
|
if (0 === this.serviceSettings.prompts.length) this.setPrompts(openAiDefaultPrompts.prompts);
|
||||||
|
|
||||||
|
this.updatePrompts(this.getChatCompletion().getPromptsWithTokenCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
PromptManagerModule.prototype.getActiveGroupCharacters = function() {
|
PromptManagerModule.prototype.getActiveGroupCharacters = function() {
|
||||||
@ -901,6 +905,10 @@ const openAiDefaultPromptLists = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const openAiDefaultPromptList = [
|
const openAiDefaultPromptList = [
|
||||||
|
{
|
||||||
|
"identifier": "main",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"identifier": "worldInfoBefore",
|
"identifier": "worldInfoBefore",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
@ -937,10 +945,6 @@ const openAiDefaultPromptList = [
|
|||||||
"identifier": "chatHistory",
|
"identifier": "chatHistory",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"identifier": "main",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"identifier": "jailbreak",
|
"identifier": "jailbreak",
|
||||||
"enabled": false
|
"enabled": false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user