Merge OpenAI init functions
| @@ -100,7 +100,7 @@ import { | ||
| 100 | 100 | proxies, |
| 101 | 101 | loadProxyPresets, |
| 102 | 102 | selected_proxy, |
| 103 | 103 | initOpenaiinitOpenAI, |
| 104 | 104 | } from './scripts/openai.js'; |
| 105 | 105 | |
| 106 | 106 | import { |
| @@ -932,6 +932,7 @@ async function firstLoadInit() { | ||
| 932 | 932 | await initLocales(); |
| 933 | 933 | initDefaultSlashCommands(); |
| 934 | 934 | initTextGenModels(); |
| 935 | + initOpenAI(); | |
| 935 | 936 | await getSystemMessages(); |
| 936 | 937 | sendSystemMessage(system_message_types.WELCOME); |
| 937 | 938 | sendSystemMessage(system_message_types.WELCOME_PROMPT); |
| @@ -939,7 +940,6 @@ async function firstLoadInit() { | ||
| 939 | 940 | initKeyboard(); |
| 940 | 941 | initDynamicStyles(); |
| 941 | 942 | initTags(); |
| 942 | - initOpenai(); | |
| 943 | 943 | initBookmarks(); |
| 944 | 944 | await getUserAvatars(true, user_avatar); |
| 945 | 945 | await getCharacters(); |
| @@ -4937,7 +4937,7 @@ function runProxyCallback(_, value) { | ||
| 4937 | 4937 | return foundName; |
| 4938 | 4938 | } |
| 4939 | 4939 | |
| 4940 | 4940 | export function initOpenaiinitOpenAI() { |
| 4941 | 4941 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 4942 | 4942 | name: 'proxy', |
| 4943 | 4943 | callback: runProxyCallback, |
| @@ -4953,9 +4953,7 @@ export function initOpenai() { | ||
| 4953 | 4953 | ], |
| 4954 | 4954 | helpString: 'Sets a proxy preset by name.', |
| 4955 | 4955 | })); |
| 4956 | -} | |
| 4957 | 4956 | |
| 4958 | -$(document).ready(async function () { | |
| 4959 | 4957 | $('#test_api_button').on('click', testApiConnection); |
| 4960 | 4958 | |
| 4961 | 4959 | $('#scale-alt').on('change', function () { |
| @@ -5419,4 +5417,4 @@ $(document).ready(async function () { | ||
| 5419 | 5417 | $('#openai_proxy_password_show').on('click', onProxyPasswordShowClick); |
| 5420 | 5418 | $('#customize_additional_parameters').on('click', onCustomizeParametersClick); |
| 5421 | 5419 | $('#openai_proxy_preset').on('change', onProxyPresetChange); |
| 5422 | 5420 | }); |