@mastra/rag 1.2.7 → 1.3.0-alpha.0
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 +11 -0
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @mastra/rag
|
|
2
2
|
|
|
3
|
+
## 1.3.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Breaking change to move the agent.streamVNext/generateVNext implementation to the default stream/generate. The old stream/generate have now been moved to streamLegacy and generateLegacy ([#8097](https://github.com/mastra-ai/mastra/pull/8097))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`00cb6bd`](https://github.com/mastra-ai/mastra/commit/00cb6bdf78737c0fac14a5a0c7b532a11e38558a), [`869ba22`](https://github.com/mastra-ai/mastra/commit/869ba222e1d6b58fc1b65e7c9fd55ca4e01b8c2f), [`1b73665`](https://github.com/mastra-ai/mastra/commit/1b73665e8e23f5c09d49fcf3e7d709c75259259e), [`f7d7475`](https://github.com/mastra-ai/mastra/commit/f7d747507341aef60ed39e4b49318db1f86034a6), [`084b77b`](https://github.com/mastra-ai/mastra/commit/084b77b2955960e0190af8db3f77138aa83ed65c), [`a93ff84`](https://github.com/mastra-ai/mastra/commit/a93ff84b5e1af07ee236ac8873dac9b49aa5d501), [`bc5aacb`](https://github.com/mastra-ai/mastra/commit/bc5aacb646d468d325327e36117129f28cd13bf6), [`6b5af12`](https://github.com/mastra-ai/mastra/commit/6b5af12ce9e09066e0c32e821c203a6954498bea), [`bf60e4a`](https://github.com/mastra-ai/mastra/commit/bf60e4a89c515afd9570b7b79f33b95e7d07c397), [`d41aee5`](https://github.com/mastra-ai/mastra/commit/d41aee526d124e35f42720a08e64043229193679), [`e8fe13c`](https://github.com/mastra-ai/mastra/commit/e8fe13c4b4c255a42520127797ec394310f7c919), [`3ca833d`](https://github.com/mastra-ai/mastra/commit/3ca833dc994c38e3c9b4f9b4478a61cd8e07b32a), [`1edb8d1`](https://github.com/mastra-ai/mastra/commit/1edb8d1cfb963e72a12412990fb9170936c9904c), [`fbf6e32`](https://github.com/mastra-ai/mastra/commit/fbf6e324946332d0f5ed8930bf9d4d4479cefd7a), [`4753027`](https://github.com/mastra-ai/mastra/commit/4753027ee889288775c6958bdfeda03ff909af67)]:
|
|
12
|
+
- @mastra/core@0.20.0-alpha.0
|
|
13
|
+
|
|
3
14
|
## 1.2.7
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -4147,7 +4147,7 @@ var TitleExtractor = class extends BaseExtractor {
|
|
|
4147
4147
|
name: "title-extractor",
|
|
4148
4148
|
instructions: "You are a title extractor. You are given a list of nodes and you need to extract the title from the nodes."
|
|
4149
4149
|
});
|
|
4150
|
-
const result = await miniAgent.
|
|
4150
|
+
const result = await miniAgent.generate(
|
|
4151
4151
|
[{ role: "user", content: this.combineTemplate.format({ context: combinedTitles }) }],
|
|
4152
4152
|
{ format: "mastra" }
|
|
4153
4153
|
);
|
|
@@ -4158,7 +4158,7 @@ var TitleExtractor = class extends BaseExtractor {
|
|
|
4158
4158
|
name: "title-extractor",
|
|
4159
4159
|
instructions: "You are a title extractor. You are given a list of nodes and you need to extract the title from the nodes."
|
|
4160
4160
|
});
|
|
4161
|
-
const result = await miniAgent.
|
|
4161
|
+
const result = await miniAgent.generateLegacy([
|
|
4162
4162
|
{ role: "user", content: this.combineTemplate.format({ context: combinedTitles }) }
|
|
4163
4163
|
]);
|
|
4164
4164
|
title = result.text;
|
|
@@ -4179,13 +4179,13 @@ var TitleExtractor = class extends BaseExtractor {
|
|
|
4179
4179
|
const titleJobs = nodes.map(async (node) => {
|
|
4180
4180
|
let completion;
|
|
4181
4181
|
if (this.llm.specificationVersion === "v2") {
|
|
4182
|
-
const result = await miniAgent.
|
|
4182
|
+
const result = await miniAgent.generate(
|
|
4183
4183
|
[{ role: "user", content: this.nodeTemplate.format({ context: node.getContent() }) }],
|
|
4184
4184
|
{ format: "mastra" }
|
|
4185
4185
|
);
|
|
4186
4186
|
completion = result.text;
|
|
4187
4187
|
} else {
|
|
4188
|
-
const result = await miniAgent.
|
|
4188
|
+
const result = await miniAgent.generateLegacy([
|
|
4189
4189
|
{ role: "user", content: this.nodeTemplate.format({ context: node.getContent() }) }
|
|
4190
4190
|
]);
|
|
4191
4191
|
completion = result.text;
|
|
@@ -4245,10 +4245,10 @@ var SummaryExtractor = class extends BaseExtractor {
|
|
|
4245
4245
|
});
|
|
4246
4246
|
let summary = "";
|
|
4247
4247
|
if (this.llm.specificationVersion === "v2") {
|
|
4248
|
-
const result = await miniAgent.
|
|
4248
|
+
const result = await miniAgent.generate([{ role: "user", content: prompt }], { format: "mastra" });
|
|
4249
4249
|
summary = result.text;
|
|
4250
4250
|
} else {
|
|
4251
|
-
const result = await miniAgent.
|
|
4251
|
+
const result = await miniAgent.generateLegacy([{ role: "user", content: prompt }]);
|
|
4252
4252
|
summary = result.text;
|
|
4253
4253
|
}
|
|
4254
4254
|
if (!summary) {
|
|
@@ -4330,10 +4330,10 @@ var QuestionsAnsweredExtractor = class extends BaseExtractor {
|
|
|
4330
4330
|
});
|
|
4331
4331
|
let questionsText = "";
|
|
4332
4332
|
if (this.llm.specificationVersion === "v2") {
|
|
4333
|
-
const result2 = await miniAgent.
|
|
4333
|
+
const result2 = await miniAgent.generate([{ role: "user", content: prompt }], { format: "mastra" });
|
|
4334
4334
|
questionsText = result2.text;
|
|
4335
4335
|
} else {
|
|
4336
|
-
const result2 = await miniAgent.
|
|
4336
|
+
const result2 = await miniAgent.generateLegacy([{ role: "user", content: prompt }]);
|
|
4337
4337
|
questionsText = result2.text;
|
|
4338
4338
|
}
|
|
4339
4339
|
if (!questionsText) {
|
|
@@ -4401,7 +4401,7 @@ var KeywordExtractor = class extends BaseExtractor {
|
|
|
4401
4401
|
instructions: "You are a keyword extractor. You are given a node and you need to extract the keywords from the node."
|
|
4402
4402
|
});
|
|
4403
4403
|
if (this.llm.specificationVersion === "v2") {
|
|
4404
|
-
const result = await miniAgent.
|
|
4404
|
+
const result = await miniAgent.generate(
|
|
4405
4405
|
[
|
|
4406
4406
|
{
|
|
4407
4407
|
role: "user",
|
|
@@ -4415,7 +4415,7 @@ var KeywordExtractor = class extends BaseExtractor {
|
|
|
4415
4415
|
);
|
|
4416
4416
|
keywords = result.text;
|
|
4417
4417
|
} else {
|
|
4418
|
-
const result = await miniAgent.
|
|
4418
|
+
const result = await miniAgent.generateLegacy([
|
|
4419
4419
|
{
|
|
4420
4420
|
role: "user",
|
|
4421
4421
|
content: this.promptTemplate.format({ context: node.getContent(), maxKeywords: this.keywords.toString() })
|
|
@@ -6557,9 +6557,9 @@ Always return just the number, no explanation.`,
|
|
|
6557
6557
|
const model = await this.agent.getModel();
|
|
6558
6558
|
let response;
|
|
6559
6559
|
if (model.specificationVersion === "v2") {
|
|
6560
|
-
response = await this.agent.generateVNext(prompt);
|
|
6561
|
-
} else {
|
|
6562
6560
|
response = await this.agent.generate(prompt);
|
|
6561
|
+
} else {
|
|
6562
|
+
response = await this.agent.generateLegacy(prompt);
|
|
6563
6563
|
}
|
|
6564
6564
|
return parseFloat(response.text);
|
|
6565
6565
|
}
|