diff --git a/public/index.html b/public/index.html index 2a7205348..d80059dc0 100644 --- a/public/index.html +++ b/public/index.html @@ -2545,6 +2545,9 @@ +
diff --git a/public/scripts/kai-settings.js b/public/scripts/kai-settings.js index 8365487ae..07bb1b0d1 100644 --- a/public/scripts/kai-settings.js +++ b/public/scripts/kai-settings.js @@ -4,6 +4,10 @@ import { getStoppingStrings, } from "../script.js"; +import { + power_user, +} from "./power-user.js"; + export { kai_settings, loadKoboldSettings, @@ -35,12 +39,12 @@ const MIN_STREAMING_KCPPVERSION = '1.30'; function formatKoboldUrl(value) { try { const url = new URL(value); - url.pathname = '/api'; + if (!power_user.relaxed_api_urls) { + url.pathname = '/api'; + } return url.toString(); - } - catch { - return null; - } + } catch { } // Just using URL as a validation check + return null; } function loadKoboldSettings(preset) { diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index d9e1b500a..7f6db49da 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -164,6 +164,7 @@ let power_user = { prefer_character_jailbreak: true, continue_on_send: false, trim_spaces: true, + relaxed_api_urls: false, instruct: { enabled: false, @@ -673,6 +674,7 @@ function loadPowerUserSettings(settings, data) { power_user.chat_width = 50; } + $('#relaxed_api_urls').prop("checked", power_user.relaxed_api_urls); $('#trim_spaces').prop("checked", power_user.trim_spaces); $('#continue_on_send').prop("checked", power_user.continue_on_send); $('#auto_swipe').prop("checked", power_user.auto_swipe); @@ -1982,6 +1984,12 @@ $(document).ready(() => { saveSettingsDebounced(); }); + $("#relaxed_api_urls").on("input", function () { + const value = !!$(this).prop('checked'); + power_user.relaxed_api_urls = value; + saveSettingsDebounced(); + }); + $('#spoiler_free_mode').on('input', function () { power_user.spoiler_free_mode = !!$(this).prop('checked'); switchSpoilerMode(); diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js index cc984e361..bb8ebdc48 100644 --- a/public/scripts/textgen-settings.js +++ b/public/scripts/textgen-settings.js @@ -6,6 +6,10 @@ import { setGenerationParamsFromPreset, } from "../script.js"; +import { + power_user, +} from "./power-user.js"; + export { textgenerationwebui_settings, loadTextGenSettings, @@ -98,10 +102,11 @@ function selectPreset(name) { function formatTextGenURL(value) { try { const url = new URL(value); - if (url.pathname.endsWith('/api')) { - return url.toString(); + if (!power_user.relaxed_api_urls) { + url.pathname = '/api'; } - } catch { } // Try and Catch both fall through to the same return. + return url.toString(); + } catch { } // Just using URL as a validation check return null; }