Merge pull request #3592 from qvink/specify_api_for_preset_list Allow specifying API in presetManager.getPresetList()

64e1fd5f71f08cbac3f35f60a13ad2d6716d91b8

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +8 -3Showing whitespace changes
public/scripts/preset-manager.js+8 -3
@@ -439,11 +439,16 @@ class PresetManager {
439439
440440 }
441441
442442 getPresetList(api) {
443443 let presets = [];
444444 let preset_names = {};
445445
446- switch (this.apiId) {
446+ // If no API specified, use the current API
447+ if (api === undefined) {
448+ api = this.apiId;
449+ }
450+
451+ switch (api) {
447452 case 'koboldhorde':
448453 case 'kobold':
449454 presets = koboldai_settings;
@@ -474,7 +479,7 @@ class PresetManager {
474479 preset_names = system_prompts.map(x => x.name);
475480 break;
476481 default:
477482 console.warn(`Unknown API ID ${this.apiIdapi}`);
478483 }
479484
480485 return { presets, preset_names };