feat(tools): converge two-tier Quick/Pro selector onto .no fork
Port the dobetterlegal-tools two-tier quality stack to dobetternorge.no: QUALITY_TIERS registry + resolveTier (ToolModels), dbnToolsResolveToolRun (bootstrap), tier read+charge in the 6 analytical endpoints, Quick/Pro UI + payload.tier on the 6 tool pages/JS, and the bounded corpusContextForSummarize RAG fix (per-passage trim + total budget + reranker_enabled). Back-compat: requests without `tier` keep legacy engine behavior. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
roleCustom: document.getElementById('bvjRoleCustom'),
|
||||
slices: Array.from(document.querySelectorAll('.adv-slice')),
|
||||
langButtons: Array.from(document.querySelectorAll('#bvjLangSwitcher .lang-btn')),
|
||||
engineRadios: Array.from(document.querySelectorAll('input[name="bvjEngine"]')),
|
||||
tierRadios: Array.from(document.querySelectorAll('input[name="bvjTier"]')),
|
||||
subQ: document.getElementById('bvjSubQ'),
|
||||
subQVal: document.getElementById('bvjSubQValue'),
|
||||
chunkLimit: document.getElementById('bvjChunkLimit'),
|
||||
@@ -186,9 +186,9 @@
|
||||
};
|
||||
}
|
||||
|
||||
function getEngine() {
|
||||
const checked = els.engineRadios.find((r) => r.checked);
|
||||
return checked ? checked.value : 'azure_mini';
|
||||
function getTier() {
|
||||
const checked = els.tierRadios.find((r) => r.checked);
|
||||
return checked ? checked.value : 'quick';
|
||||
}
|
||||
|
||||
// ── File upload ────────────────────────────────────────────────────────────
|
||||
@@ -385,13 +385,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const engine = getEngine();
|
||||
const tier = getTier();
|
||||
const additionalNotes = (els.notes ? els.notes.value : '').trim();
|
||||
const expectedDuration = engine === 'azure_full'
|
||||
? '90–180 seconds with Azure gpt-4o'
|
||||
: (engine === 'gpu' ? '45–90 seconds on GPU'
|
||||
: (engine === 'dbn_legal' ? '60–120 seconds with Norwegian specialist'
|
||||
: '30–60 seconds with Azure gpt-4o-mini'));
|
||||
const expectedDuration = tier === 'pro'
|
||||
? '90–180 seconds with Claude Sonnet'
|
||||
: '30–60 seconds with Claude Haiku';
|
||||
|
||||
setStatus(`Analysing document for ${advocateRole}… (${expectedDuration})`, 'busy');
|
||||
els.runButton.disabled = true;
|
||||
@@ -403,7 +401,7 @@
|
||||
|
||||
const payload = {
|
||||
advocate_role: advocateRole,
|
||||
engine,
|
||||
tier,
|
||||
language: lang,
|
||||
slices,
|
||||
controls: getControls(),
|
||||
|
||||
Reference in New Issue
Block a user