Forward section and kind to retrieval on the ask path
Both filters were parsed and honoured under `search` but never passed through under `ask`, so --section=CONFIGURATION silently retrieved from the whole index and returned a plausible answer built from the wrong chunks.
This commit is contained in:
@@ -111,9 +111,15 @@ async function cmdAsk() {
|
||||
|
||||
let r;
|
||||
try {
|
||||
// section and kind must be forwarded here too. They were not, so both filters worked
|
||||
// under `search` and were silently ignored under `ask` — the documented
|
||||
// --section=CONFIGURATION usage retrieved from the whole index and the answer looked
|
||||
// plausible, which is the worst way for a filter to fail.
|
||||
r = await search({
|
||||
dbPath: db, url, embedModel: embed, query: q,
|
||||
k: parseInt(arg('k', '6'), 10), perFile: parseInt(arg('per-file', '2'), 10),
|
||||
section: arg('section', null),
|
||||
kind: arg('kind', null),
|
||||
});
|
||||
} catch (e) {
|
||||
fail(`retrieval failed: ${e.message}`, 2);
|
||||
|
||||
Reference in New Issue
Block a user