mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Extract dryRun early return from finishGenerating
This means we only have to handle it in one place rather than two.
This commit is contained in:
@@ -3771,9 +3771,12 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function finishGenerating() {
|
if (dryRun) {
|
||||||
if (dryRun) return { error: 'dryRun' };
|
generatedPromptCache = '';
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function finishGenerating() {
|
||||||
if (power_user.console_log_prompts) {
|
if (power_user.console_log_prompts) {
|
||||||
console.log(generate_data.prompt);
|
console.log(generate_data.prompt);
|
||||||
}
|
}
|
||||||
@@ -3858,11 +3861,6 @@ async function Generate(type, { automatic_trigger, force_name2, quiet_prompt, qu
|
|||||||
if (!data) return;
|
if (!data) return;
|
||||||
let messageChunk = '';
|
let messageChunk = '';
|
||||||
|
|
||||||
if (data.error == 'dryRun') {
|
|
||||||
generatedPromptCache = '';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!data.error) {
|
if (!data.error) {
|
||||||
//const getData = await response.json();
|
//const getData = await response.json();
|
||||||
let getMessage = extractMessageFromData(data);
|
let getMessage = extractMessageFromData(data);
|
||||||
|
Reference in New Issue
Block a user