feat: remove all ai transcription related code and schema

This commit is contained in:
yiling
2026-05-28 14:23:02 +08:00
parent 721a9c13d7
commit 5173bb2a01
25 changed files with 38 additions and 281 deletions
+2 -16
View File
@@ -175,7 +175,7 @@ export async function generateEmbeddingActivity(params: GenerateEmbeddingParams)
export interface ExtractAiMetadataParams {
assetKey: string
filePath: string
type: 'autofill' | 'transcription'
type: 'autofill'
isImage: boolean
}
@@ -190,21 +190,7 @@ export async function extractAiMetadataActivity(
const tmpDir = path.dirname(params.filePath)
try {
if (params.type === 'transcription') {
const targetKey = path.join(aiDir, 'audio.mp3')
try {
await s3Service.headObject(bucket, targetKey)
return [targetKey]
} catch {
// Not found
}
const outputFile = path.join(tmpDir, 'audio.mp3')
await transcodeService.extractAudio(params.filePath, outputFile, '16k')
const buffer = fs.readFileSync(outputFile)
await s3Service.putObject(bucket, targetKey, buffer, buffer.length, 'audio/mpeg')
generatedFiles.push(targetKey)
} else if (params.type === 'autofill') {
if (params.type === 'autofill') {
const targetKey = path.join(aiDir, '1.webp')
try {
await s3Service.headObject(bucket, targetKey)
+2 -2
View File
@@ -11,7 +11,7 @@ describe('Task Activities', () => {
const task = await prisma.workflowTask.create({
data: {
assetId: 'asset-1',
type: WorkflowTaskType.ai_transcription,
type: WorkflowTaskType.ai_embedding,
status: WorkflowTaskStatus.pending,
},
})
@@ -48,7 +48,7 @@ describe('Task Activities', () => {
const task = await prisma.workflowTask.create({
data: {
assetId: 'asset-1',
type: WorkflowTaskType.ai_transcription,
type: WorkflowTaskType.ai_embedding,
status: WorkflowTaskStatus.pending,
},
})