OpenAI fixes

This commit is contained in:
SillyLossy
2023-03-22 12:29:07 +02:00
parent 34a2436a67
commit 4e2bc3e80a
3 changed files with 42 additions and 12 deletions

View File

@ -104,6 +104,7 @@ export {
nai_settings,
token,
name1,
name2,
is_send_press,
api_server_textgenerationwebui,
count_view_mes,
@ -1457,7 +1458,7 @@ async function Generate(type, automatic_trigger, force_name2) {//encode("dsfs").
if (main_api == 'openai') {
let prompt = prepareOpenAIMessages(name2, storyString, worldInfoBefore, worldInfoAfter, extension_prompt);
let prompt = prepareOpenAIMessages(name2, storyString, worldInfoBefore, worldInfoAfter, extension_prompt, promptBias);
sendOpenAIRequest(prompt).then(onSuccess).catch(onError);
}
else {
@ -3277,6 +3278,10 @@ $(document).ready(function () {
}
},
error: function (jqXHR, exception) {
if (jqXHR.status == 403) {
callPopup(`Character can't be imported due to invalid name. Please choose other name`, 'text');
}
//alert('ERROR: '+xhr.status+ ' Status Text: '+xhr.statusText+' '+xhr.responseText);
$("#create_button").removeAttr("disabled");
},
@ -3941,6 +3946,9 @@ $(document).ready(function () {
}
},
error: function (jqXHR, exception) {
if (jqXHR.status == 403) {
callPopup(`Character can't be imported due to invalid name. Please choose other name`, 'text');
}
$("#create_button").removeAttr("disabled");
},
});