mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into world_info_force_activate_expansion
This commit is contained in:
@ -2208,10 +2208,9 @@ function processReply(str) {
|
||||
|
||||
str = str.replaceAll('"', '');
|
||||
str = str.replaceAll('“', '');
|
||||
str = str.replaceAll('.', ',');
|
||||
str = str.replaceAll('\n', ', ');
|
||||
str = str.normalize('NFD');
|
||||
str = str.replace(/[^a-zA-Z0-9,:_(){}<>[\]\-']+/g, ' ');
|
||||
str = str.replace(/[^a-zA-Z0-9\.,:_(){}<>[\]\-']+/g, ' ');
|
||||
str = str.replace(/\s+/g, ' '); // Collapse multiple whitespaces into one
|
||||
str = str.trim();
|
||||
|
||||
@ -2675,8 +2674,7 @@ async function generateTogetherAIImage(prompt, negativePrompt, signal) {
|
||||
});
|
||||
|
||||
if (result.ok) {
|
||||
const data = await result.json();
|
||||
return { format: 'jpg', data: data?.output?.choices?.[0]?.image_base64 };
|
||||
return await result.json();
|
||||
} else {
|
||||
const text = await result.text();
|
||||
throw new Error(text);
|
||||
|
@ -514,7 +514,8 @@ export function parseBooleanOperands(args) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const operandNumber = Number(operand);
|
||||
// parseFloat will return NaN for spaces.
|
||||
const operandNumber = parseFloat(operand);
|
||||
|
||||
if (!isNaN(operandNumber)) {
|
||||
return operandNumber;
|
||||
|
@ -1686,8 +1686,8 @@ export function sortWorldInfoEntries(data, { customSort = null } = {}) {
|
||||
} else if (sortRule === 'priority') {
|
||||
// First constant, then normal, then disabled.
|
||||
primarySort = (a, b) => {
|
||||
const aValue = a.constant ? 0 : a.disable ? 2 : 1;
|
||||
const bValue = b.constant ? 0 : b.disable ? 2 : 1;
|
||||
const aValue = a.disable ? 2 : a.constant ? 0 : 1;
|
||||
const bValue = b.disable ? 2 : b.constant ? 0 : 1;
|
||||
return aValue - bValue;
|
||||
};
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user