@mastra/rag 1.2.4 → 1.2.5-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/CHANGELOG.md +23 -0
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/rerank/relevance/mastra-agent/index.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -6548,7 +6548,13 @@ Always return just the number, no explanation.`,
|
|
|
6548
6548
|
}
|
|
6549
6549
|
async getRelevanceScore(query, text) {
|
|
6550
6550
|
const prompt = createSimilarityPrompt(query, text);
|
|
6551
|
-
const
|
|
6551
|
+
const model = await this.agent.getModel();
|
|
6552
|
+
let response;
|
|
6553
|
+
if (model.specificationVersion === "v2") {
|
|
6554
|
+
response = await this.agent.generateVNext(prompt);
|
|
6555
|
+
} else {
|
|
6556
|
+
response = await this.agent.generate(prompt);
|
|
6557
|
+
}
|
|
6552
6558
|
return parseFloat(response.text);
|
|
6553
6559
|
}
|
|
6554
6560
|
};
|