@memberjunction/actions-content-autotag 6.2.0-edge.0 → 6.2.0-edge.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.
|
@@ -45,7 +45,7 @@ export declare class AutotagAndVectorizeContentAction extends BaseAction {
|
|
|
45
45
|
*
|
|
46
46
|
* @returns true if any content items were processed (new, modified, or retried)
|
|
47
47
|
*/
|
|
48
|
-
private
|
|
48
|
+
private runAutotagProviders;
|
|
49
49
|
/**
|
|
50
50
|
* Embed all content items directly into the vector index. When a ContentProcessRunID
|
|
51
51
|
* is provided, creates ContentProcessRunDetail records per-source and links
|
|
@@ -54,21 +54,21 @@ export declare class AutotagAndVectorizeContentAction extends BaseAction {
|
|
|
54
54
|
* @param params - action run params with ContextUser
|
|
55
55
|
* @param contentProcessRunID - optional parent run ID for detail tracking
|
|
56
56
|
*/
|
|
57
|
-
private
|
|
57
|
+
private runDirectVectorization;
|
|
58
58
|
/**
|
|
59
59
|
* Run EmbedPendingChunks on the engine: embed persisted ContentItemChunk rows awaiting embedding
|
|
60
60
|
* and upsert their vectors under the chunk's identity. Bounded by maxItems so a large backlog
|
|
61
61
|
* drains over several runs. Best-effort — a failure is logged but does not fail the action, since
|
|
62
62
|
* unembedded chunks stay 'Pending' and are retried on the next run.
|
|
63
63
|
*/
|
|
64
|
-
private
|
|
64
|
+
private runEmbedPendingChunks;
|
|
65
65
|
/**
|
|
66
66
|
* Run PurgeDeletedChunks on the engine: remove soft-deleted chunks' vectors from the 3rd-party
|
|
67
67
|
* store and flip those rows to 'Deleted'. Bounded by maxItems so a large backlog drains over
|
|
68
68
|
* several runs. Best-effort — a purge failure is logged but does not fail the action, since the
|
|
69
69
|
* chunks stay 'Pending' and are retried on the next run.
|
|
70
70
|
*/
|
|
71
|
-
private
|
|
71
|
+
private runPurgeDeletedChunks;
|
|
72
72
|
/**
|
|
73
73
|
* Group content items by their ContentSourceID for per-source processing.
|
|
74
74
|
*/
|
|
@@ -130,6 +130,6 @@ export declare class AutotagAndVectorizeContentAction extends BaseAction {
|
|
|
130
130
|
* If the entity doc has already been synced and nothing changed, this is a no-op.
|
|
131
131
|
* If records were modified by tagging, the vectors get updated.
|
|
132
132
|
*/
|
|
133
|
-
private
|
|
133
|
+
private syncEntitySourceVectors;
|
|
134
134
|
}
|
|
135
135
|
//# sourceMappingURL=content-autotag-and-vectorize.action.d.ts.map
|
|
@@ -118,7 +118,7 @@ let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction ex
|
|
|
118
118
|
if (forceReprocess) {
|
|
119
119
|
LogStatus(`[AutotagAction] Force reprocess enabled — skipping checksum comparison`);
|
|
120
120
|
}
|
|
121
|
-
hasNewItems = await this.
|
|
121
|
+
hasNewItems = await this.runAutotagProviders(params, onProgress, contentSourceIDs, forceReprocess);
|
|
122
122
|
LogStatus(`[AutotagAction] Phase 1 complete — providers finished (hasNewItems=${hasNewItems})`);
|
|
123
123
|
// Clean up the bridge
|
|
124
124
|
AutotagBaseEngine.Instance.CleanupTaxonomyBridge();
|
|
@@ -132,9 +132,9 @@ let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction ex
|
|
|
132
132
|
// ingested via the Vectors dashboard.
|
|
133
133
|
if (vectorize) {
|
|
134
134
|
const tasks = [];
|
|
135
|
-
tasks.push(this.
|
|
135
|
+
tasks.push(this.runDirectVectorization(params, contentProcessRunID, contentSourceIDs, forceReprocess, maxItems));
|
|
136
136
|
if (forceReprocess) {
|
|
137
|
-
tasks.push(this.
|
|
137
|
+
tasks.push(this.syncEntitySourceVectors(params, contentSourceIDs));
|
|
138
138
|
}
|
|
139
139
|
LogStatus(`[AutotagAction] Phase 2: Running ${tasks.length} vectorization task(s)...`);
|
|
140
140
|
await Promise.all(tasks);
|
|
@@ -144,14 +144,14 @@ let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction ex
|
|
|
144
144
|
// chunk rows created without them (migration) and to retry chunks whose embed failed
|
|
145
145
|
// (recovery). Bounded by MaxItems so a large backlog drains over several runs.
|
|
146
146
|
if (embedPendingChunks) {
|
|
147
|
-
await this.
|
|
147
|
+
await this.runEmbedPendingChunks(params, maxItems);
|
|
148
148
|
}
|
|
149
149
|
// Phase 4: Purge soft-deleted chunks. Runs whenever Purge=1, independent of the other
|
|
150
150
|
// phases — a re-chunk during vectorization soft-deletes superseded chunks (rows kept,
|
|
151
151
|
// DeleteStatus='Pending'); this removes their vectors from the 3rd-party store and flips
|
|
152
152
|
// the rows to 'Deleted'. Bounded by MaxItems so a large backlog drains over several runs.
|
|
153
153
|
if (purge) {
|
|
154
|
-
await this.
|
|
154
|
+
await this.runPurgeDeletedChunks(params, maxItems);
|
|
155
155
|
}
|
|
156
156
|
LogStatus(`[AutotagAction] All tasks completed`);
|
|
157
157
|
return { Success: true, ResultCode: "SUCCESS" };
|
|
@@ -172,7 +172,7 @@ let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction ex
|
|
|
172
172
|
*
|
|
173
173
|
* @returns true if any content items were processed (new, modified, or retried)
|
|
174
174
|
*/
|
|
175
|
-
async
|
|
175
|
+
async runAutotagProviders(params, onProgress, contentSourceIDs, forceReprocess) {
|
|
176
176
|
const engine = AutotagBaseEngine.Instance;
|
|
177
177
|
const sourceTypes = engine.ContentSourceTypes;
|
|
178
178
|
// Pass forceReprocess to the engine so providers can check it
|
|
@@ -221,7 +221,7 @@ let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction ex
|
|
|
221
221
|
* @param params - action run params with ContextUser
|
|
222
222
|
* @param contentProcessRunID - optional parent run ID for detail tracking
|
|
223
223
|
*/
|
|
224
|
-
async
|
|
224
|
+
async runDirectVectorization(params, contentProcessRunID, contentSourceIDs, forceReprocess, maxItems) {
|
|
225
225
|
// Resolve the per-request provider once and thread it down the call stack so
|
|
226
226
|
// every BaseEntity / RunView operation in this action runs against the caller's
|
|
227
227
|
// connection (multi-tenant correctness; do not fall through to the global default).
|
|
@@ -290,7 +290,7 @@ let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction ex
|
|
|
290
290
|
* drains over several runs. Best-effort — a failure is logged but does not fail the action, since
|
|
291
291
|
* unembedded chunks stay 'Pending' and are retried on the next run.
|
|
292
292
|
*/
|
|
293
|
-
async
|
|
293
|
+
async runEmbedPendingChunks(params, maxItems) {
|
|
294
294
|
try {
|
|
295
295
|
LogStatus(`[AutotagAction] Phase 3: Embedding pending chunks (max ${maxItems})...`);
|
|
296
296
|
const stats = await AutotagBaseEngine.Instance.EmbedPendingChunks(params.ContextUser, { maxItems });
|
|
@@ -306,7 +306,7 @@ let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction ex
|
|
|
306
306
|
* several runs. Best-effort — a purge failure is logged but does not fail the action, since the
|
|
307
307
|
* chunks stay 'Pending' and are retried on the next run.
|
|
308
308
|
*/
|
|
309
|
-
async
|
|
309
|
+
async runPurgeDeletedChunks(params, maxItems) {
|
|
310
310
|
try {
|
|
311
311
|
LogStatus(`[AutotagAction] Phase 3: Purging soft-deleted chunks (max ${maxItems})...`);
|
|
312
312
|
const stats = await AutotagBaseEngine.Instance.PurgeDeletedChunks(params.ContextUser, { maxItems });
|
|
@@ -479,7 +479,7 @@ let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction ex
|
|
|
479
479
|
* If the entity doc has already been synced and nothing changed, this is a no-op.
|
|
480
480
|
* If records were modified by tagging, the vectors get updated.
|
|
481
481
|
*/
|
|
482
|
-
async
|
|
482
|
+
async syncEntitySourceVectors(params, contentSourceIDs) {
|
|
483
483
|
try {
|
|
484
484
|
await KnowledgeHubMetadataEngine.Instance.Config(false, params.ContextUser);
|
|
485
485
|
const engine = KnowledgeHubMetadataEngine.Instance;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/actions-content-autotag",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.0-edge.
|
|
4
|
+
"version": "6.2.0-edge.1",
|
|
5
5
|
"description": "Action classes that execute the content autotagging and vectorization actions.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"vitest": "^4.0.18"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@memberjunction/actions": "6.2.0-edge.
|
|
20
|
-
"@memberjunction/actions-base": "6.2.0-edge.
|
|
21
|
-
"@memberjunction/content-autotagging": "6.2.0-edge.
|
|
22
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
23
|
-
"@memberjunction/core-actions": "6.2.0-edge.
|
|
24
|
-
"@memberjunction/core-entities": "6.2.0-edge.
|
|
25
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
26
|
-
"@memberjunction/ai-vector-sync": "6.2.0-edge.
|
|
19
|
+
"@memberjunction/actions": "6.2.0-edge.1",
|
|
20
|
+
"@memberjunction/actions-base": "6.2.0-edge.1",
|
|
21
|
+
"@memberjunction/content-autotagging": "6.2.0-edge.1",
|
|
22
|
+
"@memberjunction/core": "6.2.0-edge.1",
|
|
23
|
+
"@memberjunction/core-actions": "6.2.0-edge.1",
|
|
24
|
+
"@memberjunction/core-entities": "6.2.0-edge.1",
|
|
25
|
+
"@memberjunction/global": "6.2.0-edge.1",
|
|
26
|
+
"@memberjunction/ai-vector-sync": "6.2.0-edge.1"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|