sillytavern 1.9.5 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/script.js +2 -2
- package/public/scripts/textgen-settings.js +8 -2
- package/server.js +2 -2
package/package.json
CHANGED
package/public/script.js
CHANGED
|
@@ -7780,9 +7780,9 @@ $(document).ready(function () {
|
|
|
7780
7780
|
$("#api_button_textgenerationwebui").click(async function (e) {
|
|
7781
7781
|
e.stopPropagation();
|
|
7782
7782
|
if ($("#textgenerationwebui_api_url_text").val() != "") {
|
|
7783
|
-
let value = formatTextGenURL($("#textgenerationwebui_api_url_text").val().trim())
|
|
7783
|
+
let value = formatTextGenURL($("#textgenerationwebui_api_url_text").val().trim(), api_use_mancer_webui);
|
|
7784
7784
|
if (!value) {
|
|
7785
|
-
callPopup(
|
|
7785
|
+
callPopup("Please enter a valid URL.<br/>WebUI URLs should end with <tt>/api</tt><br/>Enable 'Relaxed API URLs' to allow other paths.", 'text');
|
|
7786
7786
|
return;
|
|
7787
7787
|
}
|
|
7788
7788
|
|
|
@@ -99,11 +99,17 @@ function selectPreset(name) {
|
|
|
99
99
|
saveSettingsDebounced();
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
function formatTextGenURL(value) {
|
|
102
|
+
function formatTextGenURL(value, use_mancer) {
|
|
103
103
|
try {
|
|
104
104
|
const url = new URL(value);
|
|
105
105
|
if (!power_user.relaxed_api_urls) {
|
|
106
|
-
|
|
106
|
+
if (use_mancer) { // If Mancer is in use, only require the URL to *end* with `/api`.
|
|
107
|
+
if (!url.pathname.endsWith('/api')) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
url.pathname = '/api';
|
|
112
|
+
}
|
|
107
113
|
}
|
|
108
114
|
return url.toString();
|
|
109
115
|
} catch { } // Just using URL as a validation check
|
package/server.js
CHANGED
|
@@ -3327,7 +3327,7 @@ app.post("/generate_openai", jsonParser, function (request, response_generate_op
|
|
|
3327
3327
|
makeRequest(config, response_generate_openai, request, retries - 1);
|
|
3328
3328
|
}, timeout);
|
|
3329
3329
|
} else {
|
|
3330
|
-
let errorData = error
|
|
3330
|
+
let errorData = error?.response?.data;
|
|
3331
3331
|
|
|
3332
3332
|
if (request.body.stream) {
|
|
3333
3333
|
try {
|
|
@@ -3355,7 +3355,7 @@ app.post("/generate_openai", jsonParser, function (request, response_generate_op
|
|
|
3355
3355
|
}
|
|
3356
3356
|
|
|
3357
3357
|
function handleError(error, response_generate_openai, errorData) {
|
|
3358
|
-
console.error('Error:', error
|
|
3358
|
+
console.error('Error:', error?.message);
|
|
3359
3359
|
|
|
3360
3360
|
let message = error?.response?.statusText;
|
|
3361
3361
|
|