#1090 Save Kobold/ooba servers history

This commit is contained in:
Cohee
2023-09-08 22:44:06 +03:00
parent 786b87952e
commit ea01247bcf
6 changed files with 104 additions and 18 deletions

View File

@@ -31,7 +31,7 @@ import {
SECRET_KEYS,
secret_state,
} from "./secrets.js";
import { debounce, delay, getStringHash, waitUntilCondition } from "./utils.js";
import { debounce, delay, getStringHash, isUrlOrAPIKey, waitUntilCondition } from "./utils.js";
import { chat_completion_sources, oai_settings } from "./openai.js";
import { getTokenCount } from "./tokenizers.js";
@@ -403,15 +403,6 @@ function RA_autoconnect(PrevApi) {
}
}
function isUrlOrAPIKey(string) {
try {
new URL(string);
return true;
} catch (_) {
// return pattern.test(string);
}
}
function OpenNavPanels() {
const deviceInfo = getDeviceInfo();
if (deviceInfo && deviceInfo.device.type === 'desktop') {