mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 13:17:37 +00:00
feat(embedding): defer embedding workflow, use transcoded assets, and execute chunks in separate activities
This commit is contained in:
@@ -41,6 +41,9 @@ describe('Transcode Workflow', () => {
|
||||
overlayAnnotationsActivity: Object.assign(vi.fn(), {
|
||||
_activityName: 'overlayAnnotationsActivity',
|
||||
}),
|
||||
createEmbeddingTaskIfEnabledActivity: Object.assign(vi.fn(), {
|
||||
_activityName: 'createEmbeddingTaskIfEnabledActivity',
|
||||
}),
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -134,6 +137,12 @@ describe('Transcode Workflow', () => {
|
||||
status: AssetStatus.processed,
|
||||
})
|
||||
|
||||
expect(mockActivities.createEmbeddingTaskIfEnabledActivity).toHaveBeenCalledWith({
|
||||
assetId: 'asset-1',
|
||||
teamId: 'team-1',
|
||||
projectId: 'proj-1',
|
||||
})
|
||||
|
||||
expect(mockActivities.updateTaskStatusActivity).toHaveBeenCalledWith({
|
||||
taskId: 'task-1',
|
||||
status: WorkflowTaskStatus.completed,
|
||||
@@ -205,6 +214,12 @@ describe('Transcode Workflow', () => {
|
||||
assetId: 'asset-image',
|
||||
status: AssetStatus.processed,
|
||||
})
|
||||
|
||||
expect(mockActivities.createEmbeddingTaskIfEnabledActivity).toHaveBeenCalledWith({
|
||||
assetId: 'asset-image',
|
||||
teamId: 'team-1',
|
||||
projectId: 'proj-1',
|
||||
})
|
||||
})
|
||||
|
||||
it('should handle failures and update task status with error', async () => {
|
||||
|
||||
Reference in New Issue
Block a user