#713 Random sorting order

This commit is contained in:
Cohee
2023-07-14 23:22:05 +03:00
parent 40dd845e51
commit 46bf29e86d
3 changed files with 6 additions and 0 deletions

View File

@@ -906,6 +906,10 @@ export function formatInstructModePrompt(name, isImpersonate, promptBias, name1,
const sortFunc = (a, b) => power_user.sort_order == 'asc' ? compareFunc(a, b) : compareFunc(b, a);
const compareFunc = (first, second) => {
if (power_user.sort_order == 'random') {
return Math.random() > 0.5 ? 1 : -1;
}
switch (power_user.sort_rule) {
case 'boolean':
const a = first[power_user.sort_field];