mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-05 13:36:47 +01:00
Fix group wrapper not resolving to a valid text
This commit is contained in:
parent
0fcf8fd491
commit
e96fb0c1b5
@ -1781,6 +1781,12 @@ async function generateMultimodalPrompt(generationType, quietPrompt) {
|
||||
*/
|
||||
async function generatePrompt(quietPrompt) {
|
||||
const reply = await generateQuietPrompt(quietPrompt, false, false);
|
||||
|
||||
if (!reply) {
|
||||
toastr.error('Prompt generation produced no text. Make sure you\'re using a valid instruct template and try again', 'Image Generation');
|
||||
throw new Error('Prompt generation failed.');
|
||||
}
|
||||
|
||||
return processReply(reply);
|
||||
}
|
||||
|
||||
|
@ -627,6 +627,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
||||
|
||||
const group = groups.find((x) => x.id === selected_group);
|
||||
let typingIndicator = $('#chat .typing_indicator');
|
||||
let textResult = '';
|
||||
|
||||
if (!group || !Array.isArray(group.members) || !group.members.length) {
|
||||
sendSystemMessage(system_message_types.EMPTY, '', { isSmallSys: true });
|
||||
@ -726,7 +727,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
||||
|
||||
// Wait for generation to finish
|
||||
const generateFinished = await Generate(generateType, { automatic_trigger: by_auto_mode, ...(params || {}) });
|
||||
await generateFinished;
|
||||
textResult = await generateFinished;
|
||||
}
|
||||
} finally {
|
||||
typingIndicator.hide();
|
||||
@ -740,7 +741,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) {
|
||||
showSwipeButtons();
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
return Promise.resolve(textResult);
|
||||
}
|
||||
|
||||
function getLastMessageGenerationId() {
|
||||
|
Loading…
Reference in New Issue
Block a user