@absolutejs/rag 0.6.0 → 0.6.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/index.js +10 -6
- package/dist/index.js.map +3 -3
- package/dist/src/retrieval/corpus.d.ts +14 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -36134,11 +36134,15 @@ var reconcileRAGCorpus = async (store, owner, desired, apply) => {
|
|
|
36134
36134
|
}
|
|
36135
36135
|
let embedded = 0;
|
|
36136
36136
|
if (plan.embed.length > 0) {
|
|
36137
|
-
|
|
36138
|
-
|
|
36139
|
-
|
|
36140
|
-
|
|
36141
|
-
|
|
36137
|
+
const outcome = await apply.embed(plan.embed, owner);
|
|
36138
|
+
const written = typeof outcome === "number" ? plan.embed.slice(0, Math.max(0, Math.min(outcome, plan.embed.length))) : plan.embed.filter((doc) => new Set(outcome).has(doc.chunkId));
|
|
36139
|
+
embedded = written.length;
|
|
36140
|
+
if (written.length > 0) {
|
|
36141
|
+
await store.remember(owner, await Promise.all(written.map(async (doc) => ({
|
|
36142
|
+
chunkId: doc.chunkId,
|
|
36143
|
+
textHash: await corpusTextHash(doc.text)
|
|
36144
|
+
}))));
|
|
36145
|
+
}
|
|
36142
36146
|
}
|
|
36143
36147
|
return { embedded, removed: plan.remove.length, unchanged: plan.unchanged };
|
|
36144
36148
|
};
|
|
@@ -36442,5 +36446,5 @@ export {
|
|
|
36442
36446
|
addRAGEvaluationSuiteCase
|
|
36443
36447
|
};
|
|
36444
36448
|
|
|
36445
|
-
//# debugId=
|
|
36449
|
+
//# debugId=6D0F2872DF78972C64756E2164756E21
|
|
36446
36450
|
//# sourceMappingURL=index.js.map
|