mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
make KAI url-fixing as flexible as webUI's
This commit is contained in:
@ -35,13 +35,12 @@ const MIN_STREAMING_KCPPVERSION = '1.30';
|
|||||||
function formatKoboldUrl(value) {
|
function formatKoboldUrl(value) {
|
||||||
try {
|
try {
|
||||||
const url = new URL(value);
|
const url = new URL(value);
|
||||||
url.pathname = '/api';
|
if (url.pathname.endsWith('/api')) {
|
||||||
return url.toString();
|
return url.toString();
|
||||||
}
|
}
|
||||||
catch {
|
} catch { } // Try and Catch both fall through to the same return.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function loadKoboldSettings(preset) {
|
function loadKoboldSettings(preset) {
|
||||||
for (const name of Object.keys(kai_settings)) {
|
for (const name of Object.keys(kai_settings)) {
|
||||||
|
Reference in New Issue
Block a user