mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix saving of groups after edits
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
<p>
|
||||
<u>Character Anchor</u> - affects the character played by the AI by motivating him to write longer messages.<br><br>
|
||||
Looks like:
|
||||
<code>[(Bot's name) talks a lot with descriptions]</code>
|
||||
<code>[Elaborate speaker]</code>
|
||||
</p>
|
||||
<p>
|
||||
<u>Style Anchor</u> - affects the entire AI model, motivating the AI to write longer messages even when it is not acting as the character.<Br><br>
|
||||
|
@ -35,10 +35,9 @@
|
||||
</p>
|
||||
<h4>2. Characters are activated by the "Talkativeness" factor.</h4>
|
||||
<p>
|
||||
Talkativeness defines how often the character speaks if it was not mentioned. Adjust this value on
|
||||
"Advanced definitions" screen in character editor.
|
||||
Slider values are on a linear scale from <b>0% / Shy</b> (character never talks unless mentioned) to
|
||||
<b>100% / Chatty</b> (character always replies).
|
||||
Talkativeness defines how often the character speaks if they were not mentioned. Adjust this value on
|
||||
"Advanced definitions" screen in character editor. Slider values are on a linear scale from
|
||||
<b>0% / Shy</b> (character never talks unless mentioned) to <b>100% / Chatty</b> (character always replies).
|
||||
Default value for new characters is 50% chance.
|
||||
</p>
|
||||
<h4>3. Random character is selected.</h4>
|
||||
|
@ -215,7 +215,6 @@ const system_messages = {
|
||||
'<li><tt>{{text}}</tt> – set the behavioral bias for the AI character</li>',
|
||||
'<li><tt>{{}}</tt> – cancel a previously set bias</li>',
|
||||
'</ol>',
|
||||
'Need more help? Visit our wiki – <a href=\"https://github.com/TavernAI/TavernAI/wiki\">TavernAI Wiki</a>!'
|
||||
].join('')
|
||||
},
|
||||
welcome:
|
||||
@ -231,8 +230,7 @@ const system_messages = {
|
||||
'<li>Create or pick a character from the list</li>',
|
||||
'</ul>',
|
||||
'Still have questions left?\n',
|
||||
'Check out built-in help by typing <tt>/?</tt> in any chat or visit our ',
|
||||
'<a target="_blank" href="https://github.com/TavernAI/TavernAI/wiki">TavernAI Wiki</a>!'
|
||||
'Check out built-in help or type <tt>/?</tt> in any chat.'
|
||||
].join('')
|
||||
},
|
||||
group: {
|
||||
|
@ -529,37 +529,12 @@ async function groupChatAutoModeWorker() {
|
||||
await generateGroupWrapper(true);
|
||||
}
|
||||
|
||||
function select_group_chats(chat_id) {
|
||||
const group = chat_id && groups.find((x) => x.id == chat_id);
|
||||
const groupName = group?.name ?? "";
|
||||
|
||||
$("#rm_group_chat_name").val(groupName);
|
||||
$("#rm_group_chat_name").off();
|
||||
$("#rm_group_chat_name").on("input", async function () {
|
||||
if (chat_id) {
|
||||
group.name = $(this).val();
|
||||
$("#rm_button_selected_ch").children("h2").text(group.name);
|
||||
await editGroup(chat_id);
|
||||
}
|
||||
});
|
||||
$("#rm_group_filter").val("").trigger("input");
|
||||
|
||||
$('input[name="rm_group_activation_strategy"]').off();
|
||||
$('input[name="rm_group_activation_strategy"]').on("input", async function(e) {
|
||||
if (chat_id) {
|
||||
group.activation_strategy = Number(e.target.value);
|
||||
await editGroup(chat_id);
|
||||
}
|
||||
});
|
||||
$(`input[name="rm_group_activation_strategy"][value="${Number(group?.activation_strategy ?? group_activation_strategy.NATURAL)}"]`).prop('checked', true);
|
||||
|
||||
selectRightMenuWithAnimation('rm_group_chats_block');
|
||||
|
||||
async function memberClickHandler(event) {
|
||||
async function memberClickHandler(event) {
|
||||
event.stopPropagation();
|
||||
const id = $(this).data("id");
|
||||
const isDelete = !!$(this).closest("#rm_group_members").length;
|
||||
const template = $(this).clone();
|
||||
let _thisGroup = groups.find((x) => x.id == selected_group);
|
||||
template.data("id", id);
|
||||
template.click(memberClickHandler);
|
||||
|
||||
@ -573,23 +548,52 @@ function select_group_chats(chat_id) {
|
||||
$("#rm_group_members").prepend(template);
|
||||
}
|
||||
|
||||
if (group) {
|
||||
if (_thisGroup) {
|
||||
if (isDelete) {
|
||||
const index = group.members.findIndex((x) => x === id);
|
||||
const index = _thisGroup.members.findIndex((x) => x === id);
|
||||
if (index !== -1) {
|
||||
group.members.splice(index, 1);
|
||||
_thisGroup.members.splice(index, 1);
|
||||
}
|
||||
} else {
|
||||
group.members.push(id);
|
||||
_thisGroup.members.push(id);
|
||||
template.css({ 'order': _thisGroup.members.length });
|
||||
}
|
||||
await editGroup(chat_id);
|
||||
updateGroupAvatar(group);
|
||||
await editGroup(selected_group);
|
||||
updateGroupAvatar(_thisGroup);
|
||||
}
|
||||
|
||||
$(this).remove();
|
||||
const groupHasMembers = !!$("#rm_group_members").children().length;
|
||||
$("#rm_group_submit").prop("disabled", !groupHasMembers);
|
||||
}
|
||||
|
||||
function select_group_chats(chat_id) {
|
||||
const group = chat_id && groups.find((x) => x.id == chat_id);
|
||||
const groupName = group?.name ?? "";
|
||||
|
||||
$("#rm_group_chat_name").val(groupName);
|
||||
$("#rm_group_chat_name").off();
|
||||
$("#rm_group_chat_name").on("input", async function () {
|
||||
if (chat_id) {
|
||||
let _thisGroup = groups.find((x) => x.id == chat_id);
|
||||
_thisGroup.name = $(this).val();
|
||||
$("#rm_button_selected_ch").children("h2").text(_thisGroup.name);
|
||||
await editGroup(chat_id);
|
||||
}
|
||||
});
|
||||
$("#rm_group_filter").val("").trigger("input");
|
||||
|
||||
$('input[name="rm_group_activation_strategy"]').off();
|
||||
$('input[name="rm_group_activation_strategy"]').on("input", async function(e) {
|
||||
if (chat_id) {
|
||||
let _thisGroup = groups.find((x) => x.id == chat_id);
|
||||
_thisGroup.activation_strategy = Number(e.target.value);
|
||||
await editGroup(chat_id);
|
||||
}
|
||||
});
|
||||
$(`input[name="rm_group_activation_strategy"][value="${Number(group?.activation_strategy ?? group_activation_strategy.NATURAL)}"]`).prop('checked', true);
|
||||
|
||||
selectRightMenuWithAnimation('rm_group_chats_block');
|
||||
|
||||
// render characters list
|
||||
$("#rm_group_add_members").empty();
|
||||
|
Reference in New Issue
Block a user