Allow /gen with empty prompts

This commit is contained in:
Cohee 2024-08-24 15:22:50 +03:00
parent 1e3a97a3aa
commit 2a598fb706
1 changed files with 6 additions and 5 deletions

View File

@ -2147,12 +2147,13 @@ async function generateRawCallback(args, value) {
} }
} }
/**
* Callback for the /gen command
* @param {object} args Named arguments
* @param {string} value Unnamed argument
* @returns {Promise<string>} The generated text
*/
async function generateCallback(args, value) { async function generateCallback(args, value) {
if (!value) {
console.warn('WARN: No argument provided for /gen command');
return;
}
// Prevent generate recursion // Prevent generate recursion
$('#send_textarea').val('')[0].dispatchEvent(new Event('input', { bubbles: true })); $('#send_textarea').val('')[0].dispatchEvent(new Event('input', { bubbles: true }));
const lock = isTrueBoolean(args?.lock); const lock = isTrueBoolean(args?.lock);