Changeset 0.10.4 (#60)

This commit is contained in:
2026-02-24 22:01:20 +00:00
parent ba2cd42428
commit e5ee78c498
18 changed files with 152 additions and 31 deletions

View File

@@ -220,9 +220,13 @@ async function userRoleProviderChanged(role) {
modelSel.innerHTML = '<option value="">— select model —</option>';
if (!providerId) return;
// Load models for the selected provider (App.models uses configId, not provider_config_id)
// Filter by provider AND model type matching the role
const typeForRole = role === 'embedding' ? 'embedding' : 'chat';
const allModels = App.models || [];
const provModels = allModels.filter(m => m.configId === providerId);
const provModels = allModels.filter(m =>
m.configId === providerId &&
(m.model_type || 'chat') === typeForRole
);
provModels.forEach(m => {
modelSel.innerHTML += `<option value="${m.baseModelId}">${esc(m.name || m.baseModelId)}</option>`;
});