Correct identifier used for jailbreak prompt override

This commit is contained in:
maver 2023-06-25 16:01:55 +02:00
parent e91e1996b1
commit c920b6c511
1 changed files with 2 additions and 2 deletions

View File

@ -206,14 +206,14 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
// Apply character specific overrides for prompts
eventSource.on(event_types.OAI_BEFORE_CHATCOMPLETION, (prompts) => {
const systemPromptOverride = this.activeCharacter.data.system_prompt ?? null;
const systemPromptOverride = this.activeCharacter.data?.system_prompt ?? null;
const systemPrompt = prompts.get('main') ?? null;
if (systemPromptOverride) {
systemPrompt.content = systemPromptOverride;
prompts.set(systemPrompt, prompts.index('main'));
}
const jailbreakPromptOverride = this.activeCharacter.data.system_prompt ?? null;
const jailbreakPromptOverride = this.activeCharacter.data?.jailbreak_prompt ?? null;
const jailbreakPrompt = prompts.get('jailbreak') ?? null;
if (jailbreakPromptOverride && jailbreakPrompt) {
jailbreakPrompt.content = jailbreakPromptOverride;