Merge OpenAI init functions

94977e71ff0498b5de9ebab8504b1b1b4d67ac2f

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

2 files changed, +4 -6Ignore whitespace
public/script.js+2 -2
@@ -100,7 +100,7 @@ import {
100100 proxies,
101101 loadProxyPresets,
102102 selected_proxy,
103103 initOpenaiinitOpenAI,
104104} from './scripts/openai.js';
105105
106106import {
@@ -932,6 +932,7 @@ async function firstLoadInit() {
932932 await initLocales();
933933 initDefaultSlashCommands();
934934 initTextGenModels();
935+ initOpenAI();
935936 await getSystemMessages();
936937 sendSystemMessage(system_message_types.WELCOME);
937938 sendSystemMessage(system_message_types.WELCOME_PROMPT);
@@ -939,7 +940,6 @@ async function firstLoadInit() {
939940 initKeyboard();
940941 initDynamicStyles();
941942 initTags();
942- initOpenai();
943943 initBookmarks();
944944 await getUserAvatars(true, user_avatar);
945945 await getCharacters();
public/scripts/openai.js+2 -4
@@ -4937,7 +4937,7 @@ function runProxyCallback(_, value) {
49374937 return foundName;
49384938}
49394939
49404940export function initOpenaiinitOpenAI() {
49414941 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
49424942 name: 'proxy',
49434943 callback: runProxyCallback,
@@ -4953,9 +4953,7 @@ export function initOpenai() {
49534953 ],
49544954 helpString: 'Sets a proxy preset by name.',
49554955 }));
4956-}
49574956
4958-$(document).ready(async function () {
49594957 $('#test_api_button').on('click', testApiConnection);
49604958
49614959 $('#scale-alt').on('change', function () {
@@ -5419,4 +5417,4 @@ $(document).ready(async function () {
54195417 $('#openai_proxy_password_show').on('click', onProxyPasswordShowClick);
54205418 $('#customize_additional_parameters').on('click', onCustomizeParametersClick);
54215419 $('#openai_proxy_preset').on('change', onProxyPresetChange);
54225420});