feat: several models for the assistant, each with its own name, kind, address and key; a model menu in the chat when there are several (or always, from Аккаунт › Вид), the choice kept for the user

This commit is contained in:
redtea committed 2026-10-17 14:41:34 +03:00
1 parent ded86e1c3f
commit 983809714b
12 files changed
+411 -44

No files matched your search

+14
View File
@@ -23,6 +23,20 @@
}, e => alert('Не скопировалось: ' + e.message));
});
if (window.UsersTable) window.UsersTable.mount(root);
// ИИ-ассистент: a card per model, added from the blank one and taken
// away by its «Удалить» (the last one stays).
const list = root.querySelector('.ai-models'), blank = root.querySelector('template.ai-model-new');
if (list && blank) {
root.querySelector('.ai-model-add').onclick = () => {
const card = blank.content.firstElementChild.cloneNode(true);
list.appendChild(card);
card.querySelector('[name=m_name]').focus();
};
list.addEventListener('click', ev => {
const del = ev.target.closest('.ai-model-del');
if (del && list.children.length > 1) del.closest('.ai-model').remove();
});
}
}
});