Update openai.js added /proxy command.
Added "proxy" slash command to openai.js to change between proxy presets in ST script.
This commit is contained in:
parent
58c3d3eb7f
commit
b2eb361028
|
@ -31,6 +31,7 @@ import {
|
|||
this_chid,
|
||||
} from '../script.js';
|
||||
import { groups, selected_group } from './group-chats.js';
|
||||
import { registerSlashCommand } from './slash-commands.js';
|
||||
|
||||
import {
|
||||
chatCompletionDefaultPrompts,
|
||||
|
@ -4321,3 +4322,12 @@ $(document).ready(async function () {
|
|||
$('#customize_additional_parameters').on('click', onCustomizeParametersClick);
|
||||
$('#openai_proxy_preset').on('change', onProxyPresetChange);
|
||||
});
|
||||
function runProxyCallback(args,value) {
|
||||
if ($('#openai_proxy_preset:contains("'+value+'")').length>=1) {
|
||||
$('#openai_proxy_preset').val(value);
|
||||
onProxyPresetChange();
|
||||
} else {
|
||||
toastr.warning("The selected preset does not exist");
|
||||
}
|
||||
}
|
||||
registerSlashCommand('proxy',runProxyCallback,[],"(name) - Sets a proxy preset by name");
|
||||
|
|
Loading…
Reference in New Issue