From ede9f242af87c3fa0d155497dbc94cc4d98c7518 Mon Sep 17 00:00:00 2001 From: qvink Date: Sat, 1 Mar 2025 15:54:18 -0700 Subject: [PATCH] Allow specifying API in presetManager.getPresetList() --- public/scripts/preset-manager.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/public/scripts/preset-manager.js b/public/scripts/preset-manager.js index 8b5ace6ed..c582497fa 100644 --- a/public/scripts/preset-manager.js +++ b/public/scripts/preset-manager.js @@ -439,11 +439,16 @@ class PresetManager { } - getPresetList() { + getPresetList(api) { let presets = []; let preset_names = {}; - switch (this.apiId) { + // If no API specified, use the current API + if (api === undefined) { + api = this.apiId; + } + + switch (api) { case 'koboldhorde': case 'kobold': presets = koboldai_settings; @@ -474,7 +479,7 @@ class PresetManager { preset_names = system_prompts.map(x => x.name); break; default: - console.warn(`Unknown API ID ${this.apiId}`); + console.warn(`Unknown API ID ${api}`); } return { presets, preset_names };