Merge branch 'staging' of https://github.com/SillyTavern/SillyTavern into staging
This commit is contained in:
commit
5d34c8aef5
|
@ -163,6 +163,8 @@
|
|||
"custom_stopping_strings_macro": true,
|
||||
"fuzzy_search": true,
|
||||
"encode_tags": false,
|
||||
"enableLabMode": false,
|
||||
"enableZenSliders": false,
|
||||
"ui_mode": 1
|
||||
},
|
||||
"extension_settings": {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "sillytavern",
|
||||
"version": "1.10.8",
|
||||
"version": "1.10.9",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sillytavern",
|
||||
"version": "1.10.8",
|
||||
"version": "1.10.9",
|
||||
"hasInstallScript": true,
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
"type": "git",
|
||||
"url": "https://github.com/SillyTavern/SillyTavern.git"
|
||||
},
|
||||
"version": "1.10.8",
|
||||
"version": "1.10.9",
|
||||
"scripts": {
|
||||
"start": "node server.js",
|
||||
"start-multi": "node server.js --disableCsrf",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
.tag_view_item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: baseline;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
|
|
@ -715,8 +715,8 @@
|
|||
Temperature
|
||||
<div class="fa-solid fa-circle-info opacity50p" title="Temperature controls the randomness in token selection: - low temperature (<1.0) leads to more predictable text, favoring higher probability tokens. - high temperature (>1.0) increases creativity and diversity in the output by giving lower probability tokens a better chance. Set to 1.0 for the original probabilities."></div>
|
||||
</small>
|
||||
<input class="neo-range-slider" type="range" id="temp" name="volume" min="0.0" max="2.0" step="0.01">
|
||||
<input class="neo-range-input" type="number" min="0.0" max="2.0" step="0.01" data-for="temp" id="temp_counter">
|
||||
<input class="neo-range-slider" type="range" id="temp" name="volume" min="0.0" max="4.0" step="0.01">
|
||||
<input class="neo-range-input" type="number" min="0.0" max="4.0" step="0.01" data-for="temp" id="temp_counter">
|
||||
</div>
|
||||
<div data-newbie-hidden class="alignitemscenter flex-container flexFlowColumn flexBasis48p flexGrow flexShrink gap0">
|
||||
<small data-i18n="Top K">
|
||||
|
@ -2502,6 +2502,7 @@
|
|||
<input type="search" class="text_pole textarea_compact" data-i18n="[placeholder]Search..." id="world_info_search" placeholder="Search...">
|
||||
<select id="world_info_sort_order" class="margin0">
|
||||
<option data-rule="priority" value="0">Priority</option>
|
||||
<option data-rule="custom" value="13">Custom</option>
|
||||
<option data-order="asc" data-field="comment" value="1">Title A-Z</option>
|
||||
<option data-order="desc" data-field="comment" value="2">Title Z-A</option>
|
||||
<option data-order="asc" data-field="content" data-rule="length" value="3">Tokens ↗</option>
|
||||
|
@ -2680,7 +2681,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div name="UserSettingsSecondColumn" id="UI-Customization" class="flex-container flexFlowColumn wide100p">
|
||||
<div name="UserSettingsSecondColumn" id="UI-Customization" class="flex-container flexFlowColumn wide100p flexNoGap">
|
||||
<div name="themeToggles">
|
||||
<h4 data-i18n="Theme Toggles">Theme Toggles</h4>
|
||||
<label data-newbie-hidden for="fast_ui_mode" class="checkbox_label" title="removes blur from window backgrounds" data-i18n="[title]removes blur from window backgrounds">
|
||||
|
@ -2737,6 +2738,13 @@
|
|||
</label>
|
||||
</div>
|
||||
<h4><span data-i18n="Miscellaneous">Miscellaneous</span></h4>
|
||||
<div title="If set in the advanced character definitions, this field will be displayed in the characters list.">
|
||||
<label for="aux_field" data-i18n="Aux List Field">Aux List Field</label>
|
||||
<select id="aux_field">
|
||||
<option data-i18n="Character Version" value="character_version">Character Version</option>
|
||||
<option data-i18n="Created by" value="creator">Created by</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="play_message_sound" class="checkbox_label">
|
||||
<input id="play_message_sound" type="checkbox" />
|
||||
|
@ -3088,7 +3096,7 @@
|
|||
</div>
|
||||
<div id="create_dummy_persona" class="menu_button menu_button_icon" title="Create a dummy persona" data-i18n="[title]Create a dummy persona">
|
||||
<i class="fa-solid fa-person-circle-question fa-fw"></i>
|
||||
<span data-i18n="Blank">Blank</span>
|
||||
<span data-i18n="Create">Create</span>
|
||||
</div>
|
||||
</h4>
|
||||
<div id="user_avatar_block">
|
||||
|
@ -3752,7 +3760,7 @@
|
|||
<form class="world_entry_form wi-card-entry">
|
||||
<div class="inline-drawer wide100p">
|
||||
<div class="inline-drawer-toggle inline-drawer-header gap5px padding0">
|
||||
<!-- <span class="drag-handle">☰</span> -->
|
||||
<span class="drag-handle">☰</span>
|
||||
<div class="gap5px world_entry_thin_controls wide100p alignitemscenter">
|
||||
<div class="fa-fw fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
|
||||
<span class="flex-container alignitemscenter wide100p">
|
||||
|
|
|
@ -1050,9 +1050,10 @@ function getCharacterBlock(item, id) {
|
|||
template.find('.ch_description').hide();
|
||||
}
|
||||
|
||||
const version = item.data?.character_version || '';
|
||||
if (version) {
|
||||
template.find('.character_version').text(version);
|
||||
const auxFieldName = power_user.aux_field || 'character_version';
|
||||
const auxFieldValue = (item.data && item.data[auxFieldName]) || '';
|
||||
if (auxFieldValue) {
|
||||
template.find('.character_version').text(auxFieldValue);
|
||||
}
|
||||
else {
|
||||
template.find('.character_version').hide();
|
||||
|
|
|
@ -371,7 +371,7 @@ function RA_checkOnlineStatus() {
|
|||
connection_made = false;
|
||||
} else {
|
||||
if (online_status !== undefined && online_status !== "no_connection") {
|
||||
$("#send_textarea").attr("placeholder", `Type a message, or /? for command list`); //on connect, placeholder tells user to type message
|
||||
$("#send_textarea").attr("placeholder", `Type a message, or /? for help`); //on connect, placeholder tells user to type message
|
||||
$('#send_form').removeClass("no-connection");
|
||||
$("#API-status-top").removeClass("fa-plug-circle-exclamation redOverlayGlow");
|
||||
$("#API-status-top").addClass("fa-plug");
|
||||
|
|
|
@ -39,7 +39,23 @@ async function uploadUserAvatar(url, name) {
|
|||
}
|
||||
|
||||
async function createDummyPersona() {
|
||||
await uploadUserAvatar(default_avatar);
|
||||
const personaName = await callPopup('<h3>Enter a name for this persona:</h3>', 'input', '');
|
||||
|
||||
if (!personaName) {
|
||||
console.debug('User cancelled creating dummy persona');
|
||||
return;
|
||||
}
|
||||
|
||||
// Date + name (only ASCII) to make it unique
|
||||
const avatarId = `${Date.now()}-${personaName.replace(/[^a-zA-Z0-9]/g, '')}.png`;
|
||||
power_user.personas[avatarId] = personaName;
|
||||
power_user.persona_descriptions[avatarId] = {
|
||||
description: '',
|
||||
position: persona_description_positions.IN_PROMPT,
|
||||
};
|
||||
|
||||
await uploadUserAvatar(default_avatar, avatarId);
|
||||
saveSettingsDebounced();
|
||||
}
|
||||
|
||||
export async function convertCharacterToPersona(characterId = null) {
|
||||
|
|
|
@ -220,6 +220,7 @@ let power_user = {
|
|||
encode_tags: false,
|
||||
servers: [],
|
||||
bogus_folders: false,
|
||||
aux_field: 'character_version',
|
||||
};
|
||||
|
||||
let themes = [];
|
||||
|
@ -1255,6 +1256,7 @@ function loadPowerUserSettings(settings, data) {
|
|||
$(`#chat_display option[value=${power_user.chat_display}]`).attr("selected", true).trigger('change');
|
||||
$('#chat_width_slider').val(power_user.chat_width);
|
||||
$("#token_padding").val(power_user.token_padding);
|
||||
$("#aux_field").val(power_user.aux_field);
|
||||
|
||||
$("#font_scale").val(power_user.font_scale);
|
||||
$("#font_scale_counter").val(power_user.font_scale);
|
||||
|
@ -2832,6 +2834,13 @@ $(document).ready(() => {
|
|||
printCharacters(true);
|
||||
});
|
||||
|
||||
$('#aux_field').on('change', function() {
|
||||
const value = $(this).find(':selected').val();
|
||||
power_user.aux_field = String(value);
|
||||
saveSettingsDebounced();
|
||||
printCharacters(false);
|
||||
});
|
||||
|
||||
$(document).on('click', '#debug_table [data-debug-function]', function () {
|
||||
const functionId = $(this).data('debug-function');
|
||||
const functionRecord = debug_functions.find(f => f.functionId === functionId);
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
System-wide Replacement Macros (in order of evaluation):
|
||||
<ul>
|
||||
<li><tt>{{original}}</tt> - global prompts defined in API settings. Only valid in Advanced Definitions prompt overrides.</li>
|
||||
<li><tt>{{input}}</tt> - the user input</li>
|
||||
<li><tt>{{description}}</tt> - the Character's Description</li>
|
||||
<li><tt>{{personality}}</tt> - the Character's Personality</li>
|
||||
<li><tt>{{scenario}}</tt> - the Character's Scenario</li>
|
||||
<li><tt>{{persona}}</tt> - your current Persona Description</li>
|
||||
<li><tt>{{mesExamples}}</tt> - the Character's Dialogue Examples</li>
|
||||
<li><tt>{{user}}</tt> - your current Persona username</li>
|
||||
<li><tt>{{char}}</tt> - the Character's name</li>
|
||||
<li><tt>{{lastMessageId}}</tt> - index # of the latest chat message. Useful for slash command batching.</li>
|
||||
<li><tt>{{// (note)}}</tt> - you can leave a note here, and the macro will be replaced with blank content. Not visible for the AI.</li>
|
||||
<li><tt>{{time}}</tt> - the current time</li>
|
||||
<li><tt>{{date}}</tt> - the current date</li>
|
||||
<li><tt>{{weekday}}</tt> - the current weekday</li>
|
||||
<li><tt>{{isotime}}</tt> - the current ISO date (YYYY-MM-DD)</li>
|
||||
<li><tt>{{isodate}}</tt> - the current ISO time (24-hour clock)</li>
|
||||
<li><tt>{{datetimeformat …}}</tt> - the current date/time in the specified format, e. g. for German date/time: <tt>{{datetimeformat DD.MM.YYYY HH:mm}}</tt></li>
|
||||
<li><tt>{{time_UTC±#}}</tt> - the current time in the specified UTC time zone offset, e.g. UTC-4 or UTC+2</li>
|
||||
<li><tt>{{idle_duration}}</tt> - the time since the last user message was sent</li>
|
||||
<li><tt>{{bias "text here"}}</tt> - sets a behavioral bias for the AI until the next user input. Quotes around the text are important.</li>
|
||||
<li><tt>{{random:(args)}}</tt> - returns a random item from the list. (ex: {{random:1,2,3,4}} will return 1 of the 4 numbers at random. Works with text lists too.</li>
|
||||
<li><tt>{{roll:(formula)}}</tt> - rolls a dice. (ex: {{roll:1d6}} will roll a 6-sided dice and return a number between 1 and 6)</li>
|
||||
<li><tt>{{banned "text here"}}</tt> - dynamically add text in the quotes to banned words sequences, if Text Generation WebUI backend used. Do nothing for others backends. Can be used anywhere (Character description, WI, AN, etc.) Quotes around the text are important.</li>
|
||||
<li><tt>{{original}}</tt> – global prompts defined in API settings. Only valid in Advanced Definitions prompt overrides.</li>
|
||||
<li><tt>{{input}}</tt> – the user input</li>
|
||||
<li><tt>{{description}}</tt> – the Character's Description</li>
|
||||
<li><tt>{{personality}}</tt> – the Character's Personality</li>
|
||||
<li><tt>{{scenario}}</tt> – the Character's Scenario</li>
|
||||
<li><tt>{{persona}}</tt> – your current Persona Description</li>
|
||||
<li><tt>{{mesExamples}}</tt> – the Character's Dialogue Examples</li>
|
||||
<li><tt>{{user}}</tt> – your current Persona username</li>
|
||||
<li><tt>{{char}}</tt> – the Character's name</li>
|
||||
<li><tt>{{lastMessageId}}</tt> – index # of the latest chat message. Useful for slash command batching.</li>
|
||||
<li><tt>{{// (note)}}</tt> – you can leave a note here, and the macro will be replaced with blank content. Not visible for the AI.</li>
|
||||
<li><tt>{{time}}</tt> – the current time</li>
|
||||
<li><tt>{{date}}</tt> – the current date</li>
|
||||
<li><tt>{{weekday}}</tt> – the current weekday</li>
|
||||
<li><tt>{{isotime}}</tt> – the current ISO date (YYYY-MM-DD)</li>
|
||||
<li><tt>{{isodate}}</tt> – the current ISO time (24-hour clock)</li>
|
||||
<li><tt>{{datetimeformat …}}</tt> – the current date/time in the specified format, e. g. for German date/time: <tt>{{datetimeformat DD.MM.YYYY HH:mm}}</tt></li>
|
||||
<li><tt>{{time_UTC±#}}</tt> – the current time in the specified UTC time zone offset, e.g. UTC-4 or UTC+2</li>
|
||||
<li><tt>{{idle_duration}}</tt> – the time since the last user message was sent</li>
|
||||
<li><tt>{{bias "text here"}}</tt> – sets a behavioral bias for the AI until the next user input. Quotes around the text are important.</li>
|
||||
<li><tt>{{random:(args)}}</tt> – returns a random item from the list. (ex: {{random:1,2,3,4}} will return 1 of the 4 numbers at random. Works with text lists too.</li>
|
||||
<li><tt>{{roll:(formula)}}</tt> – rolls a dice. (ex: {{roll:1d6}} will roll a 6- sided dice and return a number between 1 and 6)</li>
|
||||
<li><tt>{{banned "text here"}}</tt> – dynamically add text in the quotes to banned words sequences, if Text Generation WebUI backend used. Do nothing for others backends. Can be used anywhere (Character description, WI, AN, etc.) Quotes around the text are important.</li>
|
||||
</ul>
|
||||
|
|
|
@ -269,7 +269,15 @@ function sortEntries(data) {
|
|||
const sortRule = option.data('rule');
|
||||
const orderSign = sortOrder === 'asc' ? 1 : -1;
|
||||
|
||||
if (sortRule === 'priority') {
|
||||
if (sortRule === 'custom') {
|
||||
// First by display index, then by order, then by uid
|
||||
data.sort((a, b) => {
|
||||
const aValue = a.displayIndex;
|
||||
const bValue = b.displayIndex;
|
||||
|
||||
return (aValue - bValue || b.order - a.order || a.uid - b.uid);
|
||||
});
|
||||
} else if (sortRule === 'priority') {
|
||||
// First constant, then normal, then disabled. Then sort by order
|
||||
data.sort((a, b) => {
|
||||
const aValue = a.constant ? 0 : a.disable ? 2 : 1;
|
||||
|
@ -375,7 +383,7 @@ function displayWorldEntries(name, data, navigation = navigation_option.none) {
|
|||
nextText: '>',
|
||||
formatNavigator: PAGINATION_TEMPLATE,
|
||||
showNavigator: true,
|
||||
callback: function (page) {
|
||||
callback: function (/** @type {object[]} */ page) {
|
||||
$("#world_popup_entries_list").empty();
|
||||
const keywordHeaders = `
|
||||
<div id="WIEntryHeaderTitlesPC" class="flex-container wide100p spaceBetween justifyCenter textAlignCenter" style="padding:0 2.5em;">
|
||||
|
@ -399,6 +407,12 @@ function displayWorldEntries(name, data, navigation = navigation_option.none) {
|
|||
</small>
|
||||
</div>`
|
||||
const blocks = page.map(entry => getWorldEntry(name, data, entry)).filter(x => x);
|
||||
const isCustomOrder = $('#world_info_sort_order').find(':selected').data('rule') === 'custom';
|
||||
if (!isCustomOrder) {
|
||||
blocks.forEach(block => {
|
||||
block.find('.drag-handle').remove();
|
||||
});
|
||||
}
|
||||
$("#world_popup_entries_list").append(keywordHeaders);
|
||||
$("#world_popup_entries_list").append(blocks);
|
||||
},
|
||||
|
@ -500,6 +514,8 @@ function displayWorldEntries(name, data, navigation = navigation_option.none) {
|
|||
delay: getSortableDelay(),
|
||||
handle: ".drag-handle",
|
||||
stop: async function (event, ui) {
|
||||
const firstEntryUid = $('#world_popup_entries_list .world_entry').first().data('uid');
|
||||
const minDisplayIndex = data?.entries[firstEntryUid]?.displayIndex ?? 0;
|
||||
$('#world_popup_entries_list .world_entry').each(function (index) {
|
||||
const uid = $(this).data('uid');
|
||||
|
||||
|
@ -511,8 +527,8 @@ function displayWorldEntries(name, data, navigation = navigation_option.none) {
|
|||
return;
|
||||
}
|
||||
|
||||
item.displayIndex = index;
|
||||
setOriginalDataValue(data, uid, 'extensions.display_index', index);
|
||||
item.displayIndex = minDisplayIndex + index;
|
||||
setOriginalDataValue(data, uid, 'extensions.display_index', item.displayIndex);
|
||||
});
|
||||
|
||||
console.table(Object.keys(data.entries).map(uid => data.entries[uid]).map(x => ({ uid: x.uid, key: x.key.join(','), displayIndex: x.displayIndex })));
|
||||
|
@ -1582,9 +1598,7 @@ async function checkWorldInfo(chat, maxContext) {
|
|||
over_max = (
|
||||
world_info_min_activations_depth_max > 0 &&
|
||||
minActivationMsgIndex > world_info_min_activations_depth_max
|
||||
) || (
|
||||
minActivationMsgIndex >= chat.length
|
||||
)
|
||||
) || (minActivationMsgIndex >= chat.length)
|
||||
if (!over_max) {
|
||||
needsToScan = true
|
||||
textToScan = transformString(chat.slice(minActivationMsgIndex, minActivationMsgIndex + 1).join(""));
|
||||
|
@ -2167,11 +2181,9 @@ jQuery(() => {
|
|||
updateEditor(navigation_option.previous);
|
||||
});
|
||||
|
||||
$('#world_info_sort_order').on('change', function (e) {
|
||||
if (e.target instanceof HTMLOptionElement) {
|
||||
localStorage.setItem(SORT_ORDER_KEY, e.target.value);
|
||||
}
|
||||
|
||||
$('#world_info_sort_order').on('change', function () {
|
||||
const value = String($(this).find(":selected").val());
|
||||
localStorage.setItem(SORT_ORDER_KEY, value);
|
||||
updateEditor(navigation_option.none);
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue