Emit events on changing chatcompletion source or model

This commit is contained in:
maver 2023-08-05 18:23:28 +02:00
parent 1281417a97
commit 2805a684a8
2 changed files with 5 additions and 0 deletions

View File

@ -257,6 +257,8 @@ export const event_types = {
MOVABLE_PANELS_RESET: 'movable_panels_reset',
SETTINGS_LOADED_BEFORE: 'settings_loaded_before',
SETTINGS_LOADED_AFTER: 'settings_loaded_after',
CHATCOMPLETION_SOURCE_CHANGED: 'chatcompletion_source_changed',
CHATCOMPLETION_MODEL_CHANGED: 'chatcompletion_model_changed',
OAI_BEFORE_CHATCOMPLETION: 'oai_before_chatcompletion',
OAI_PRESET_CHANGED: 'oai_preset_changed',
WORLDINFO_SETTINGS_UPDATED: 'worldinfo_settings_updated',

View File

@ -2585,6 +2585,7 @@ async function onModelChange() {
}
saveSettingsDebounced();
eventSource.emit(event_types.CHATCOMPLETION_MODEL_CHANGED, value);
}
async function onNewPresetClick() {
@ -2918,6 +2919,8 @@ $(document).ready(function () {
if (main_api == 'openai') {
reconnectOpenAi();
}
eventSource.emit(event_types.CHATCOMPLETION_SOURCE_CHANGED, oai_settings.chat_completion_source);
});
$('#oai_max_context_unlocked').on('input', function () {