mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
@@ -279,9 +279,9 @@ export class TextCompletionService {
|
||||
instructPreset,
|
||||
);
|
||||
} else { // e.g. "<|im_start|>assistant: Hello, my name is"
|
||||
const overridenInstructPreset = structuredClone(instructPreset);
|
||||
overridenInstructPreset.output_suffix = '';
|
||||
overridenInstructPreset.wrap = false;
|
||||
const overriddenInstructPreset = structuredClone(instructPreset);
|
||||
overriddenInstructPreset.output_suffix = '';
|
||||
overriddenInstructPreset.wrap = false;
|
||||
messageContent = formatInstructModeChat(
|
||||
message.role,
|
||||
message.content,
|
||||
@@ -291,7 +291,7 @@ export class TextCompletionService {
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
overridenInstructPreset,
|
||||
overriddenInstructPreset,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -584,7 +584,7 @@ export function getNovelGenerationData(finalPrompt, settings, maxLength, isImper
|
||||
};
|
||||
}
|
||||
|
||||
// Check if the prefix needs to be overriden to use instruct mode
|
||||
// Check if the prefix needs to be overridden to use instruct mode
|
||||
function selectPrefix(selected_prefix, finalPrompt) {
|
||||
let useInstruct = false;
|
||||
const clio = nai_settings.model_novel.includes('clio');
|
||||
|
@@ -132,7 +132,7 @@ function reloadUserAvatar(force = false) {
|
||||
/**
|
||||
* Sort the given personas
|
||||
* @param {string[]} personas - The persona names to sort
|
||||
* @returns {string[]} The sorted persona names arrray, same reference as passed in
|
||||
* @returns {string[]} The sorted persona names array, same reference as passed in
|
||||
*/
|
||||
function sortPersonas(personas) {
|
||||
const option = $('#persona_sort_order').find(':selected');
|
||||
@@ -1821,7 +1821,7 @@ function registerPersonaSlashCommands() {
|
||||
defaultValue: 'chat',
|
||||
enumList: [
|
||||
new SlashCommandEnumValue('chat', 'Lock the persona to the current chat.'),
|
||||
new SlashCommandEnumValue('character', 'Lock this persona to the currently selected character. If the setting is enabled, mutliple personas can be locked to the same character.'),
|
||||
new SlashCommandEnumValue('character', 'Lock this persona to the currently selected character. If the setting is enabled, multiple personas can be locked to the same character.'),
|
||||
new SlashCommandEnumValue('default', 'Lock this persona as the default persona for all new chats.'),
|
||||
],
|
||||
}),
|
||||
@@ -1857,7 +1857,7 @@ function registerPersonaSlashCommands() {
|
||||
defaultValue: 'chat',
|
||||
enumList: [
|
||||
new SlashCommandEnumValue('chat', 'Lock the persona to the current chat.'),
|
||||
new SlashCommandEnumValue('character', 'Lock this persona to the currently selected character. If the setting is enabled, mutliple personas can be locked to the same character.'),
|
||||
new SlashCommandEnumValue('character', 'Lock this persona to the currently selected character. If the setting is enabled, multiple personas can be locked to the same character.'),
|
||||
new SlashCommandEnumValue('default', 'Lock this persona as the default persona for all new chats.'),
|
||||
],
|
||||
}),
|
||||
|
@@ -315,7 +315,7 @@ export class Popup {
|
||||
if (defaultButton) defaultButton.classList.add('menu_button_default');
|
||||
|
||||
// Styling differences depending on the popup type
|
||||
// General styling for all types first, that might be overriden for specific types below
|
||||
// General styling for all types first, that might be overridden for specific types below
|
||||
this.mainInput.style.display = 'none';
|
||||
this.inputControls.style.display = customInputs ? 'block' : 'none';
|
||||
this.closeButton.style.display = 'none';
|
||||
|
@@ -426,7 +426,7 @@ export class ReasoningHandler {
|
||||
if (!this.#isParsingReasoning)
|
||||
return mesChanged;
|
||||
|
||||
// If we are in manual parsing mode, all currently streaming mes tokens will go the the reasoning block
|
||||
// If we are in manual parsing mode, all currently streaming mes tokens will go to the reasoning block
|
||||
this.reasoning = parseTarget.slice(power_user.reasoning.prefix.length);
|
||||
message.mes = '';
|
||||
|
||||
|
@@ -264,9 +264,9 @@ function countWords(str) {
|
||||
* @param {string} type - The type of the message processing (e.g., 'append', 'continue', 'appendFinal', 'swipe').
|
||||
* @param {Object} characters - Object containing character data.
|
||||
* @param {string} this_chid - The character id.
|
||||
* @param {string} oldMesssage - The old message that's being processed.
|
||||
* @param {string} oldMessage - The old message that's being processed.
|
||||
*/
|
||||
async function statMesProcess(line, type, characters, this_chid, oldMesssage) {
|
||||
async function statMesProcess(line, type, characters, this_chid, oldMessage) {
|
||||
if (this_chid === undefined || characters[this_chid] === undefined) {
|
||||
return;
|
||||
}
|
||||
@@ -295,7 +295,7 @@ async function statMesProcess(line, type, characters, this_chid, oldMesssage) {
|
||||
stat.user_msg_count++;
|
||||
stat.user_word_count += countWords(line.mes);
|
||||
} else {
|
||||
let oldLen = oldMesssage.split(' ').length;
|
||||
let oldLen = oldMessage.split(' ').length;
|
||||
stat.user_word_count += countWords(line.mes) - oldLen;
|
||||
}
|
||||
} else {
|
||||
@@ -305,7 +305,7 @@ async function statMesProcess(line, type, characters, this_chid, oldMesssage) {
|
||||
stat.non_user_msg_count++;
|
||||
stat.non_user_word_count += countWords(line.mes);
|
||||
} else {
|
||||
let oldLen = oldMesssage.split(' ').length;
|
||||
let oldLen = oldMessage.split(' ').length;
|
||||
stat.non_user_word_count += countWords(line.mes) - oldLen;
|
||||
}
|
||||
}
|
||||
|
@@ -917,7 +917,7 @@ function newTag(tagName) {
|
||||
/**
|
||||
* @typedef {object} PrintTagListOptions - Optional parameters for printing the tag list.
|
||||
* @property {Tag[]|function(): Tag[]} [tags=undefined] - Optional override of tags that should be printed. Those will not be sorted. If no supplied, tags for the relevant character are printed. Can also be a function that returns the tags.
|
||||
* @property {Tag|Tag[]} [addTag=undefined] - Optionally provide one or multiple tags that should be manually added to this print. Either to the overriden tag list or the found tags based on the entity/key. Will respect the tag exists check.
|
||||
* @property {Tag|Tag[]} [addTag=undefined] - Optionally provide one or multiple tags that should be manually added to this print. Either to the overridden tag list or the found tags based on the entity/key. Will respect the tag exists check.
|
||||
* @property {object|number|string} [forEntityOrKey=undefined] - Optional override for the chosen entity, otherwise the currently selected is chosen. Can be an entity with id property (character, group, tag), or directly an id or tag key.
|
||||
* @property {boolean|string} [empty=true] - Whether the list should be initially empty. If a string string is provided, 'always' will always empty the list, otherwise it'll evaluate to a boolean.
|
||||
* @property {boolean} [sort=true] - Whether the tags should be sorted via the sort function, or kept as is.
|
||||
|
@@ -2316,7 +2316,7 @@ export function deleteWIOriginalDataValue(data, uid) {
|
||||
/**
|
||||
* Splits a given input string that contains one or more keywords or regexes, separated by commas.
|
||||
*
|
||||
* Each part can be a valid regex following the pattern `/myregex/flags` with optional flags. Commmas inside the regex are allowed, slashes have to be escaped like this: `\/`
|
||||
* Each part can be a valid regex following the pattern `/myregex/flags` with optional flags. Commas inside the regex are allowed, slashes have to be escaped like this: `\/`
|
||||
* If a regex doesn't stand alone, it is not treated as a regex.
|
||||
*
|
||||
* @param {string} input - One or multiple keywords or regexes, separated by commas
|
||||
|
Reference in New Issue
Block a user