@absolutejs/rag 0.6.0 → 0.6.2
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 +14 -6
- package/dist/index.js.map +3 -3
- package/dist/src/retrieval/corpus.d.ts +14 -12
- package/package.json +2 -2
|
@@ -46,8 +46,20 @@ export declare const corpusTextHash: (text: string) => Promise<string>;
|
|
|
46
46
|
*/
|
|
47
47
|
export declare const planRAGCorpus: <Owner = string>(store: RAGCorpusStore<Owner>, owner: Owner, desired: RAGCorpusDocument[]) => Promise<RAGCorpusPlan>;
|
|
48
48
|
export type RAGCorpusApply<Owner = string> = {
|
|
49
|
-
/**
|
|
50
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Embed + upsert these chunks.
|
|
51
|
+
*
|
|
52
|
+
* Return a COUNT only when the whole plan was written — the count is then
|
|
53
|
+
* taken at its word and every planned chunk is recorded as embedded. If the
|
|
54
|
+
* pass can stop early (a budget ceiling, an abort signal, a partial failure
|
|
55
|
+
* it chooses to swallow), return the chunk ids actually written instead.
|
|
56
|
+
*
|
|
57
|
+
* Getting this wrong is silent and permanent: a chunk recorded as embedded
|
|
58
|
+
* that was not will match `unchanged` on every later pass, so it is never
|
|
59
|
+
* embedded again until its source text happens to change. Reporting ids is
|
|
60
|
+
* always safe; reporting a count is a promise the caller cannot verify.
|
|
61
|
+
*/
|
|
62
|
+
embed: (docs: RAGCorpusDocument[], owner: Owner) => Promise<number | readonly string[]> | number | readonly string[];
|
|
51
63
|
/** Delete these chunk ids from the vector store. */
|
|
52
64
|
remove: (chunkIds: string[], owner: Owner) => Promise<void> | void;
|
|
53
65
|
};
|
|
@@ -56,14 +68,4 @@ export type RAGCorpusResult = {
|
|
|
56
68
|
removed: number;
|
|
57
69
|
unchanged: number;
|
|
58
70
|
};
|
|
59
|
-
/**
|
|
60
|
-
* Bring an owner's embedded corpus in line with what they should have.
|
|
61
|
-
*
|
|
62
|
-
* Ordering is deliberate. Deletions run FIRST and their records are forgotten
|
|
63
|
-
* only after the vectors are gone: a crash mid-pass then leaves a record whose
|
|
64
|
-
* vector may already be deleted, which a later pass simply deletes again
|
|
65
|
-
* (harmless), rather than a vector whose record is gone — which nothing could
|
|
66
|
-
* ever find. Embedding records its digests after the write for the same reason,
|
|
67
|
-
* so an interrupted run never claims to have embedded something it did not.
|
|
68
|
-
*/
|
|
69
71
|
export declare const reconcileRAGCorpus: <Owner = string>(store: RAGCorpusStore<Owner>, owner: Owner, desired: RAGCorpusDocument[], apply: RAGCorpusApply<Owner>) => Promise<RAGCorpusResult>;
|
package/package.json
CHANGED