diff --git a/public/script.js b/public/script.js index e480561c5..103881df0 100644 --- a/public/script.js +++ b/public/script.js @@ -100,7 +100,7 @@ import { proxies, loadProxyPresets, selected_proxy, - initOpenai, + initOpenAI, } from './scripts/openai.js'; import { @@ -932,6 +932,7 @@ async function firstLoadInit() { await initLocales(); initDefaultSlashCommands(); initTextGenModels(); + initOpenAI(); await getSystemMessages(); sendSystemMessage(system_message_types.WELCOME); sendSystemMessage(system_message_types.WELCOME_PROMPT); @@ -939,7 +940,6 @@ async function firstLoadInit() { initKeyboard(); initDynamicStyles(); initTags(); - initOpenai(); initBookmarks(); await getUserAvatars(true, user_avatar); await getCharacters(); diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 0cafa379a..057ceaa0e 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -4937,7 +4937,7 @@ function runProxyCallback(_, value) { return foundName; } -export function initOpenai() { +export function initOpenAI() { SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'proxy', callback: runProxyCallback, @@ -4953,9 +4953,7 @@ export function initOpenai() { ], helpString: 'Sets a proxy preset by name.', })); -} -$(document).ready(async function () { $('#test_api_button').on('click', testApiConnection); $('#scale-alt').on('change', function () { @@ -5419,4 +5417,4 @@ $(document).ready(async function () { $('#openai_proxy_password_show').on('click', onProxyPasswordShowClick); $('#customize_additional_parameters').on('click', onCustomizeParametersClick); $('#openai_proxy_preset').on('change', onProxyPresetChange); -}); +}