mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 02:38:23 +00:00
feat: remove all ai transcription related code and schema
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user