#442 Auto-classify backgrounds based on chat context. Add string fuzzy matching library.

This commit is contained in:
Cohee
2023-06-06 15:06:21 +03:00
parent d7e9fd98ea
commit 645397e355
7 changed files with 2313 additions and 28 deletions

View File

@ -1399,6 +1399,20 @@ function getStoppingStrings(isImpersonate, addSpace) {
return addSpace ? result.map(x => `${x} `) : result;
}
// Background prompt generation
export async function generateQuietPrompt(quiet_prompt) {
return await new Promise(
async function promptPromise(resolve, reject) {
try {
await Generate('quiet', { resolve, reject, quiet_prompt, force_name2: true, });
}
catch {
reject();
}
});
}
function processCommands(message, type) {
if (type == "regenerate" || type == "swipe" || type == 'quiet') {
return null;