mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-13 18:40:11 +01:00
Allowing the presetManager to return presets for chat completion
This commit is contained in:
parent
75aec77271
commit
7eff895e88
@ -393,8 +393,8 @@ export let proxies = [
|
||||
];
|
||||
export let selected_proxy = proxies[0];
|
||||
|
||||
let openai_setting_names;
|
||||
let openai_settings;
|
||||
export let openai_setting_names;
|
||||
export let openai_settings;
|
||||
|
||||
/** @type {import('./PromptManager.js').PromptManager} */
|
||||
export let promptManager = null;
|
||||
|
@ -21,6 +21,7 @@ import { groups, selected_group } from './group-chats.js';
|
||||
import { instruct_presets } from './instruct-mode.js';
|
||||
import { kai_settings } from './kai-settings.js';
|
||||
import { convertNovelPreset } from './nai-settings.js';
|
||||
import { openai_settings, openai_setting_names, oai_settings } from './openai.js';
|
||||
import { Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js';
|
||||
import { context_presets, getContextSettings, power_user } from './power-user.js';
|
||||
import { SlashCommand } from './slash-commands/SlashCommand.js';
|
||||
@ -349,7 +350,11 @@ class PresetManager {
|
||||
* @returns {string} Selected preset name
|
||||
*/
|
||||
getSelectedPresetName() {
|
||||
return $(this.select).find('option:selected').text();
|
||||
if (this.apiId === 'openai') {
|
||||
return oai_settings.preset_settings_openai
|
||||
} else {
|
||||
return $(this.select).find('option:selected').text();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -456,6 +461,10 @@ class PresetManager {
|
||||
presets = textgenerationwebui_presets;
|
||||
preset_names = textgenerationwebui_preset_names;
|
||||
break;
|
||||
case 'openai':
|
||||
presets = openai_settings;
|
||||
preset_names = openai_setting_names;
|
||||
break;
|
||||
case 'context':
|
||||
presets = context_presets;
|
||||
preset_names = context_presets.map(x => x.name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user