| @@ -431,7 +431,8 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) { | |||
| 431 | return mesExamplesArray.map(x => x.replace(/<START>\n/i, blockHeading)); | 431 | return mesExamplesArray.map(x => x.replace(/<START>\n/i, blockHeading)); |
| 432 | } | 432 | } |
| 433 | 433 | ||
| 434 | const includeNames = power_user.instruct.names_behavior === names_behavior_types.ALWAYS || (!!selected_group && power_user.instruct.names_behavior === names_behavior_types.FORCE); | 434 | const includeNames = power_user.instruct.names_behavior === names_behavior_types.ALWAYS; |
| 435 | const includeGroupNames = selected_group && (includeNames || power_user.instruct.names_behavior === names_behavior_types.FORCE); | ||
| 435 | 436 | ||
| 436 | let inputPrefix = power_user.instruct.input_sequence || ''; | 437 | let inputPrefix = power_user.instruct.input_sequence || ''; |
| 437 | let outputPrefix = power_user.instruct.output_sequence || ''; | 438 | let outputPrefix = power_user.instruct.output_sequence || ''; |
| @@ -463,7 +464,7 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) { | |||
| 463 | 464 | ||
| 464 | for (const item of mesExamplesArray) { | 465 | for (const item of mesExamplesArray) { |
| 465 | const cleanedItem = item.replace(/<START>/i, '{Example Dialogue:}').replace(/\r/gm, ''); | 466 | const cleanedItem = item.replace(/<START>/i, '{Example Dialogue:}').replace(/\r/gm, ''); |
| 466 | const blockExamples = parseExampleIntoIndividual(cleanedItem); | 467 | const blockExamples = parseExampleIntoIndividual(cleanedItem, includeGroupNames); |
| 467 | 468 | ||
| 468 | if (blockExamples.length === 0) { | 469 | if (blockExamples.length === 0) { |
| 469 | continue; | 470 | continue; |
| @@ -474,8 +475,9 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) { | |||
| 474 | } | 475 | } |
| 475 | 476 | ||
| 476 | for (const example of blockExamples) { | 477 | for (const example of blockExamples) { |
| 478 | // If group names were already included, we don't want to add an additional prefix | ||
| 477 | // If force group/persona names is set, we should override the include names for the user placeholder | 479 | // If force group/persona names is set, we should override the include names for the user placeholder |
| 478 | const includeThisName = includeNames || (power_user.instruct.names_behavior === names_behavior_types.FORCE && example.name == 'example_user'); | 480 | const includeThisName = (includeNames && !includeGroupNames) || (power_user.instruct.names_behavior === names_behavior_types.FORCE && example.name == 'example_user'); |
| 479 | 481 | ||
| 480 | const prefix = example.name == 'example_user' ? inputPrefix : outputPrefix; | 482 | const prefix = example.name == 'example_user' ? inputPrefix : outputPrefix; |
| 481 | const suffix = example.name == 'example_user' ? inputSuffix : outputSuffix; | 483 | const suffix = example.name == 'example_user' ? inputSuffix : outputSuffix; |
| @@ -489,7 +491,6 @@ export function formatInstructModeExamples(mesExamplesArray, name1, name2) { | |||
| 489 | if (formattedExamples.length === 0) { | 491 | if (formattedExamples.length === 0) { |
| 490 | return mesExamplesArray.map(x => x.replace(/<START>\n/i, blockHeading)); | 492 | return mesExamplesArray.map(x => x.replace(/<START>\n/i, blockHeading)); |
| 491 | } | 493 | } |
| 492 | |||
| 493 | return formattedExamples; | 494 | return formattedExamples; |
| 494 | } | 495 | } |
| 495 | 496 | ||