From 9354697753f264fadadf619ce143119054b16647 Mon Sep 17 00:00:00 2001 From: h-a-s-k <140975143+h-a-s-k@users.noreply.github.com> Date: Sat, 13 Jan 2024 13:06:51 -0300 Subject: [PATCH 1/2] Actually call them example chats --- default/settings.json | 2 +- public/scripts/openai.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/default/settings.json b/default/settings.json index 75e785724..200cfbc21 100644 --- a/default/settings.json +++ b/default/settings.json @@ -562,7 +562,7 @@ "impersonation_prompt": "[Write your next reply from the point of view of {{user}}, using the chat history so far as a guideline for the writing style of {{user}}. Write 1 reply only in internet RP style. Don't write as {{char}} or system. Don't describe actions of {{char}}.]", "new_chat_prompt": "[Start a new Chat]", "new_group_chat_prompt": "[Start a new group chat. Group members: {{group}}]", - "new_example_chat_prompt": "[Start a new Chat]", + "new_example_chat_prompt": "[Example Chat]", "continue_nudge_prompt": "[Continue the following message. Do not include ANY parts of the original message. Use capitalization and punctuation as if your reply is a part of the original message: {{lastChatMessage}}]", "bias_preset_selected": "Default (none)", "bias_presets": { diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 099b3d5f9..bca5d7bec 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -89,7 +89,7 @@ const default_enhance_definitions_prompt = 'If you have more knowledge of {{char const default_wi_format = '[Details of the fictional world the RP is set in:\n{0}]\n'; const default_new_chat_prompt = '[Start a new Chat]'; const default_new_group_chat_prompt = '[Start a new group chat. Group members: {{group}}]'; -const default_new_example_chat_prompt = '[Start a new Chat]'; +const default_new_example_chat_prompt = '[Example Chat]'; const default_claude_human_sysprompt_message = 'Let\'s get started. Please generate your response based on the information and instructions provided above.'; const default_continue_nudge_prompt = '[Continue the following message. Do not include ANY parts of the original message. Use capitalization and punctuation as if your reply is a part of the original message: {{lastChatMessage}}]'; const default_bias = 'Default (none)'; From 074cc13e6051cb4abb59ca86e5e216034881d5df Mon Sep 17 00:00:00 2001 From: h-a-s-k <140975143+h-a-s-k@users.noreply.github.com> Date: Sat, 13 Jan 2024 14:34:17 -0300 Subject: [PATCH 2/2] Fix group chat example messages not including character name --- public/scripts/openai.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/scripts/openai.js b/public/scripts/openai.js index bca5d7bec..3c24c4269 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -464,7 +464,7 @@ function setOpenAIMessages(chat) { } /** - * Formats chat messages into chat completion messages. + * Formats chat examples into chat completion messages. * @param {string[]} mesExamplesArray - Array containing all examples. * @returns {object[]} - Array containing all examples formatted for chat completion. */ @@ -541,14 +541,14 @@ function parseExampleIntoIndividual(messageExampleString) { let cur_msg_lines = []; let in_user = false; let in_bot = false; - // DRY my cock and balls + // DRY my cock and balls :) function add_msg(name, role, system_name) { // join different newlines (we split them by \n and join by \n) // remove char name // strip to remove extra spaces let parsed_msg = cur_msg_lines.join('\n').replace(name + ':', '').trim(); - if (selected_group && role == 'assistant') { + if (selected_group && ['example_user', 'example_assistant'].includes(system_name)) { parsed_msg = `${name}: ${parsed_msg}`; }