mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 22:14:50 +00:00
feat(video): generate transcripts with the local embedding server
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
-- AlterEnum
|
||||
ALTER TYPE "WorkflowTaskType" ADD VALUE 'ai_transcription';
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "asset_transcripts" (
|
||||
"id" TEXT NOT NULL,
|
||||
"asset_id" TEXT NOT NULL,
|
||||
"language" TEXT NOT NULL,
|
||||
"model" TEXT NOT NULL,
|
||||
"workflow_task_id" TEXT NOT NULL,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "asset_transcripts_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "asset_transcript_segments" (
|
||||
"id" TEXT NOT NULL,
|
||||
"transcript_id" TEXT NOT NULL,
|
||||
"position" INTEGER NOT NULL,
|
||||
"start_ms" INTEGER NOT NULL,
|
||||
"end_ms" INTEGER NOT NULL,
|
||||
"text" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "asset_transcript_segments_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "asset_transcripts_asset_id_language_key" ON "asset_transcripts"("asset_id", "language");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "asset_transcript_segments_transcript_id_position_key" ON "asset_transcript_segments"("transcript_id", "position");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "asset_transcripts" ADD CONSTRAINT "asset_transcripts_asset_id_fkey" FOREIGN KEY ("asset_id") REFERENCES "assets"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "asset_transcript_segments" ADD CONSTRAINT "asset_transcript_segments_transcript_id_fkey" FOREIGN KEY ("transcript_id") REFERENCES "asset_transcripts"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -129,6 +129,7 @@ enum WorkflowTaskType {
|
||||
ai_metadata_autofill
|
||||
chat
|
||||
ai_embedding
|
||||
ai_transcription
|
||||
query_embedding_for_search
|
||||
agent_tool_call // @deprecated: Agent tools now execute directly in-process via Core services
|
||||
kanban_agent_run
|
||||
@@ -619,6 +620,7 @@ model Asset {
|
||||
commentAttachments AssetCommentAttachment[] @relation("AssetToCommentAttachment")
|
||||
notifications Notification[] @relation("AssetToNotification")
|
||||
embeddings AssetEmbedding[] @relation("AssetToEmbedding")
|
||||
transcripts AssetTranscript[]
|
||||
|
||||
teamRootFolder Team? @relation("TeamToRootFolder")
|
||||
projectRootFolder Project? @relation("ProjectToRootFolder")
|
||||
@@ -775,6 +777,34 @@ model AssetEmbedding {
|
||||
@@map("asset_embeddings")
|
||||
}
|
||||
|
||||
model AssetTranscript {
|
||||
id String @id @default(ulid())
|
||||
assetId String @map("asset_id")
|
||||
asset Asset @relation(fields: [assetId], references: [id], onDelete: Cascade)
|
||||
language String
|
||||
model String
|
||||
workflowTaskId String @map("workflow_task_id")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
segments AssetTranscriptSegment[]
|
||||
|
||||
@@unique([assetId, language], name: "assetIdLanguage")
|
||||
@@map("asset_transcripts")
|
||||
}
|
||||
|
||||
model AssetTranscriptSegment {
|
||||
id String @id @default(ulid())
|
||||
transcriptId String @map("transcript_id")
|
||||
transcript AssetTranscript @relation(fields: [transcriptId], references: [id], onDelete: Cascade)
|
||||
position Int
|
||||
startMs Int @map("start_ms")
|
||||
endMs Int @map("end_ms")
|
||||
text String @db.Text
|
||||
|
||||
@@unique([transcriptId, position], name: "transcriptIdPosition")
|
||||
@@map("asset_transcript_segments")
|
||||
}
|
||||
|
||||
model Invite {
|
||||
id String @id @default(ulid())
|
||||
code String @unique
|
||||
|
||||
Reference in New Issue
Block a user