Fix authors note position not being considered

This commit is contained in:
maver 2023-07-15 19:57:21 +02:00
parent 41aae57f05
commit 76154fd8ee
1 changed files with 8 additions and 3 deletions

View File

@ -561,8 +561,13 @@ function populateChatCompletion (prompts, chatCompletion, {bias, quietPrompt, ty
// Authors Note
if (prompts.has('authorsNote')) {
const authorsNote = Message.fromPrompt(prompts.get('authorsNote'));
if (extension_prompt_types.AFTER_SCENARIO) chatCompletion.insert(authorsNote, 'scenario');
else chatCompletion.insert(authorsNote, 'main')
// ToDo: This should not be retrieved from the ui during runtime
const afterScenario = document.querySelector('input[name="extension_floating_position"]').checked;
// Add authors notes
if (true === afterScenario) chatCompletion.insert(authorsNote, 'scenario');
else chatCompletion.insert(authorsNote, 'main');
}
// Persona Description
@ -672,7 +677,7 @@ function prepareOpenAIMessages({
// Authors Note
const authorsNote = extensionPrompts['2_floating_prompt'];
if (authorsNote && authorsNote.content) mappedPrompts.push({role: 'system', content: authorsNote.content, identifier: 'authorsNote'});
if (authorsNote && authorsNote.value) mappedPrompts.push({role: 'system', content: authorsNote.value, identifier: 'authorsNote'});
// Persona Description
if (power_user.persona_description) {