0.4.0 convex及界面修改
This commit is contained in:
@@ -132,11 +132,18 @@ export const run = internalAction({
|
||||
const title = meta.title ?? "无标题";
|
||||
const text = extractTextFromDocumentContent(contentRes?.content ?? null);
|
||||
const fileSource = `document:${documentId}`;
|
||||
const { trackId } = await lightragIngestText({ fileSource, text: `# ${title}\n\n${text}` });
|
||||
const ingest = await lightragIngestText({ fileSource, text: `# ${title}\n\n${text}` });
|
||||
if (ingest.skipped) {
|
||||
await ctx.runMutation(internal.jobs.finishSuccess, {
|
||||
id: args.id,
|
||||
result: { ok: true, kind: "document", documentId, skipped: true, reason: ingest.reason ?? "skipped" },
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await ctx.runMutation(internal.jobs.finishSuccess, {
|
||||
id: args.id,
|
||||
result: { ok: true, kind: "document", documentId, trackId },
|
||||
result: { ok: true, kind: "document", documentId, trackId: ingest.trackId },
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -165,11 +172,18 @@ export const run = internalAction({
|
||||
const title = docMeta.title ?? "无标题";
|
||||
const text = extractTextFromMindmapData(mindmapRes.data ?? null);
|
||||
const fileSource = `mindmap:${docId}:${mindmapId}`;
|
||||
const { trackId } = await lightragIngestText({ fileSource, text: `# ${title}\n\n${text}` });
|
||||
const ingest = await lightragIngestText({ fileSource, text: `# ${title}\n\n${text}` });
|
||||
if (ingest.skipped) {
|
||||
await ctx.runMutation(internal.jobs.finishSuccess, {
|
||||
id: args.id,
|
||||
result: { ok: true, kind: "mindmap", docId, mindmapId, skipped: true, reason: ingest.reason ?? "skipped" },
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await ctx.runMutation(internal.jobs.finishSuccess, {
|
||||
id: args.id,
|
||||
result: { ok: true, kind: "mindmap", docId, mindmapId, trackId },
|
||||
result: { ok: true, kind: "mindmap", docId, mindmapId, trackId: ingest.trackId },
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -191,11 +205,18 @@ export const run = internalAction({
|
||||
return;
|
||||
}
|
||||
const fileSource = `media:${assetId}`;
|
||||
const { trackId } = await lightragIngestText({ fileSource, text: `# ${title}\n\n${text}` });
|
||||
const ingest = await lightragIngestText({ fileSource, text: `# ${title}\n\n${text}` });
|
||||
if (ingest.skipped) {
|
||||
await ctx.runMutation(internal.jobs.finishSuccess, {
|
||||
id: args.id,
|
||||
result: { ok: true, kind: "media_asset", assetId, skipped: true, reason: ingest.reason ?? "skipped" },
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await ctx.runMutation(internal.jobs.finishSuccess, {
|
||||
id: args.id,
|
||||
result: { ok: true, kind: "media_asset", assetId, trackId },
|
||||
result: { ok: true, kind: "media_asset", assetId, trackId: ingest.trackId },
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user