Infer model settings from Window extension settings

This commit is contained in:
Cohee
2023-06-30 00:36:39 +03:00
parent f532192726
commit e2bbc7fbcf

View File

@ -1571,8 +1571,8 @@ function onSettingsPresetChange() {
saveSettingsDebounced(); saveSettingsDebounced();
} }
function onModelChange() { async function onModelChange() {
const value = $(this).val(); let value = $(this).val();
if ($(this).is('#model_claude_select')) { if ($(this).is('#model_claude_select')) {
console.log('Claude model changed to', value); console.log('Claude model changed to', value);
@ -1610,6 +1610,10 @@ function onModelChange() {
} }
if (oai_settings.chat_completion_source == chat_completion_sources.WINDOWAI) { if (oai_settings.chat_completion_source == chat_completion_sources.WINDOWAI) {
if (value == '' && 'ai' in window) {
value = await window.ai.getCurrentModel();
}
if (oai_settings.max_context_unlocked) { if (oai_settings.max_context_unlocked) {
$('#openai_max_context').attr('max', unlocked_max); $('#openai_max_context').attr('max', unlocked_max);
} }