Legacy ooba API compatibility shim

This commit is contained in:
Cohee
2023-11-08 10:13:28 +02:00
parent a98c275445
commit e76c18c104
6 changed files with 75 additions and 36 deletions

View File

@@ -886,6 +886,7 @@ async function getStatus() {
use_mancer: main_api == "textgenerationwebui" ? isMancer() : false,
use_aphrodite: main_api == "textgenerationwebui" ? isAphrodite() : false,
use_ooba: main_api == "textgenerationwebui" ? isOoba() : false,
legacy_api: main_api == "textgenerationwebui" ? textgenerationwebui_settings.legacy_api : false,
}),
signal: abortStatusCheck.signal,
});
@@ -2548,6 +2549,12 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
return;
}
if (main_api === 'textgenerationwebui' && textgenerationwebui_settings.streaming && textgenerationwebui_settings.legacy_api) {
toastr.error('Streaming is not supported for the legacy API schema. Update TextGen WebUI and use --extension openai to enable streaming.', undefined, { timeOut: 10000, preventDuplicates: true, });
unblockGeneration();
return;
}
if (isHordeGenerationNotAllowed()) {
unblockGeneration();
return;