fix learning hub model selector
This commit is contained in:
parent
9167532a14
commit
27c3e07d98
2 changed files with 11 additions and 6 deletions
|
|
@ -695,11 +695,9 @@
|
|||
function populateAiModelSelect() {
|
||||
var sel = document.getElementById('lh-ai-model');
|
||||
if (!sel || sel.options.length > 1) return;
|
||||
// Copy options from global model select
|
||||
var globalSel = document.getElementById('global-model-select');
|
||||
if (!globalSel) return;
|
||||
sel.innerHTML = globalSel.innerHTML;
|
||||
sel.value = globalSel.value;
|
||||
if (typeof window._buildModelOptions === 'function') {
|
||||
window._buildModelOptions(sel);
|
||||
}
|
||||
}
|
||||
|
||||
function switchAiTab(tabName) {
|
||||
|
|
@ -810,7 +808,7 @@
|
|||
var slideCount = document.getElementById('lh-ai-slide-count') ? document.getElementById('lh-ai-slide-count').value : '';
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('model', model);
|
||||
if (model) formData.append('model', model);
|
||||
formData.append('questionCount', questionCount);
|
||||
formData.append('contentType', contentType);
|
||||
if (refinement) formData.append('refinement', refinement);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,13 @@ test('top bar model selector is removed and omitted selections use backend defau
|
|||
assert.match(selector, /return undefined/);
|
||||
});
|
||||
|
||||
test('learning hub model selector uses shared tab model options', () => {
|
||||
const learningHub = read('public/js/learningHub.js');
|
||||
assert.match(learningHub, /window\._buildModelOptions\(sel\)/);
|
||||
assert.doesNotMatch(learningHub, /global-model-select|globalSel\.innerHTML/);
|
||||
assert.match(learningHub, /if \(model\) formData\.append\('model', model\)/);
|
||||
});
|
||||
|
||||
test('backend AI calls use admin default when request omits model', () => {
|
||||
const ai = read('src/utils/ai.js');
|
||||
assert.match(ai, /async function resolveModel\(requestedModel\)/);
|
||||
|
|
|
|||
Loading…
Reference in a new issue