@mastra/rag 2.7.3-alpha.0 → 2.7.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/SKILL.md +1 -2
- package/dist/docs/assets/SOURCE_MAP.json +13 -13
- package/dist/docs/references/reference-rag-graph-rag.md +1 -1
- package/dist/index.cjs +10 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/rerank/index.d.ts.map +1 -1
- package/dist/utils/tool-helpers.d.ts +3 -3
- package/dist/utils/tool-helpers.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/docs/references/reference-migrations-upgrade-to-v1-rag.md +0 -46
package/dist/index.js
CHANGED
|
@@ -6217,6 +6217,14 @@ async function executeRerank({ results, query, scorer, options }) {
|
|
|
6217
6217
|
});
|
|
6218
6218
|
throw err;
|
|
6219
6219
|
}
|
|
6220
|
+
if (!Number.isInteger(topK) || topK < 0) {
|
|
6221
|
+
const err = /* @__PURE__ */ new Error(`topK must be a nonnegative integer. Got ${topK}`);
|
|
6222
|
+
rerankSpan?.error({
|
|
6223
|
+
error: err,
|
|
6224
|
+
endSpan: true
|
|
6225
|
+
});
|
|
6226
|
+
throw err;
|
|
6227
|
+
}
|
|
6220
6228
|
const resultLength = results.length;
|
|
6221
6229
|
const queryAnalysis = queryEmbedding ? analyzeQueryEmbedding(queryEmbedding) : null;
|
|
6222
6230
|
let scoredResults;
|
|
@@ -6750,15 +6758,8 @@ async function resolveVectorStore(options, context, logger) {
|
|
|
6750
6758
|
if (mastra) return mastra.getVector(vectorStoreName);
|
|
6751
6759
|
}
|
|
6752
6760
|
function coerceTopK(topK, defaultValue = 10) {
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
return defaultValue;
|
|
6756
|
-
}
|
|
6757
|
-
if (typeof topK === "string") {
|
|
6758
|
-
const parsed = Number(topK);
|
|
6759
|
-
if (Number.isFinite(parsed) && parsed > 0) return parsed;
|
|
6760
|
-
return defaultValue;
|
|
6761
|
-
}
|
|
6761
|
+
const parsed = typeof topK === "string" ? Number(topK) : topK;
|
|
6762
|
+
if (typeof parsed === "number" && Number.isFinite(parsed) && Math.floor(parsed) >= 1) return Math.floor(parsed);
|
|
6762
6763
|
return defaultValue;
|
|
6763
6764
|
}
|
|
6764
6765
|
function parseFilterValue(filter, logger) {
|