Merge pull request #1 from h-a-s-k/group-chat-tweaks

Group chat tweaks
This commit is contained in:
Hask 2024-01-13 17:43:07 +00:00 committed by GitHub
commit 4eba8e4575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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}}.]", "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_chat_prompt": "[Start a new Chat]",
"new_group_chat_prompt": "[Start a new group chat. Group members: {{group}}]", "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}}]", "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_preset_selected": "Default (none)",
"bias_presets": { "bias_presets": {

View File

@ -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_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_chat_prompt = '[Start a new Chat]';
const default_new_group_chat_prompt = '[Start a new group chat. Group members: {{group}}]'; 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_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_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)'; const default_bias = 'Default (none)';
@ -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. * @param {string[]} mesExamplesArray - Array containing all examples.
* @returns {object[]} - Array containing all examples formatted for chat completion. * @returns {object[]} - Array containing all examples formatted for chat completion.
*/ */
@ -541,14 +541,14 @@ function parseExampleIntoIndividual(messageExampleString) {
let cur_msg_lines = []; let cur_msg_lines = [];
let in_user = false; let in_user = false;
let in_bot = false; let in_bot = false;
// DRY my cock and balls // DRY my cock and balls :)
function add_msg(name, role, system_name) { function add_msg(name, role, system_name) {
// join different newlines (we split them by \n and join by \n) // join different newlines (we split them by \n and join by \n)
// remove char name // remove char name
// strip to remove extra spaces // strip to remove extra spaces
let parsed_msg = cur_msg_lines.join('\n').replace(name + ':', '').trim(); 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}`; parsed_msg = `${name}: ${parsed_msg}`;
} }