mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-12 15:08:28 +00:00
* feat: remove trigger and run base on bullmq * fix: telemetry and trigger deploymen * feat: add Ollama container and update ingestion status for unchanged documents * feat: add logger to bullmq workers * 1. Remove chat and deep-search from trigger 2. Add ai/sdk for chat UI 3. Added a better model manager * refactor: simplify clustered graph query and add stop conditions for AI responses * fix: streaming * fix: docker docs --------- Co-authored-by: Manoj <saimanoj58@gmail.com>
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { queue, task } from "@trigger.dev/sdk";
|
|
import {
|
|
processDocumentIngestion,
|
|
type IngestDocumentPayload,
|
|
} from "~/jobs/ingest/ingest-document.logic";
|
|
import { ingestTask } from "./ingest";
|
|
|
|
const documentIngestionQueue = queue({
|
|
name: "document-ingestion-queue",
|
|
concurrencyLimit: 1,
|
|
});
|
|
|
|
// Register the Document Ingestion Trigger.dev task
|
|
export const ingestDocumentTask = task({
|
|
id: "ingest-document",
|
|
queue: documentIngestionQueue,
|
|
machine: "medium-2x",
|
|
run: async (payload: IngestDocumentPayload) => {
|
|
// Use common logic with Trigger-specific callback for episode ingestion
|
|
return await processDocumentIngestion(
|
|
payload,
|
|
// Callback for enqueueing episode ingestion for each chunk
|
|
async (episodePayload) => {
|
|
const episodeHandler = await ingestTask.trigger(episodePayload, {
|
|
queue: "ingestion-queue",
|
|
concurrencyKey: episodePayload.userId,
|
|
tags: [episodePayload.userId, episodePayload.queueId],
|
|
});
|
|
return { id: episodeHandler.id };
|
|
},
|
|
);
|
|
},
|
|
});
|