@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.
@@ -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
- /** Embed + upsert these chunks. Returns how many were written. */
50
- embed: (docs: RAGCorpusDocument[], owner: Owner) => Promise<number> | number;
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/rag",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "homepage": "https://github.com/absolutejs/rag",
5
5
  "bugs": {
6
6
  "url": "https://github.com/absolutejs/rag/issues"
@@ -236,4 +236,4 @@
236
236
  ]
237
237
  }
238
238
  }
239
- }
239
+ }