Skip to content

Commit caed5b0

Browse files
committed
[refactor] Update task imports
- Refactored imports in TaskUI and TaskNode components to streamline dependencies. - Expanded TODO list with new items related to chunk and node handling, model improvements, and documentation updates. - Removed unnecessary whitespace in several task files for cleaner code. - Centralized task registration in the index file to improve maintainability and reduce redundancy.
1 parent cb18634 commit caed5b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+250
-300
lines changed

TODO.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
TODO.md
22

3+
- [ ] Chunks and nodes are not the same.
4+
- [ ] We need to rename the files related to embedding.
5+
- [ ] And we may need to save the chunk's node path. Or paths?
6+
- [ ] Get a better model for question answering.
7+
- [ ] Get a better model for named entity recognition, the current one recognized everything as a token, not helpful.
8+
- [ ] Titles are not making it into the chunks.
9+
- [ ] Tests for CLI commands.
10+
311
- [ ] Add ability for queues to specify if inputs should be converted to text, binary blob, a transferable object, structured clone, or just passed as is.
412
- [ ] Add specialized versions of the task queues for hugging face transformers and tensorflow mediapipe.
513
- [ ] Audio conversion like the image conversion
6-
- [ ] Make all the workflow name start with a lower case letter and change the users of them, particularly in the docs and examples
714
- [ ] rename the registration stuff to not look ugly: registerHuggingfaceTransformers() and registerHuggingfaceTransformersUsingWorkers() and registerHuggingfaceTransformersInsideWorker()
815
- [ ] fix image transferables

examples/cli/src/components/TaskUI.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
*/
66

77
import { DownloadModelTask } from "@workglow/ai";
8-
import { ArrayTask, ITask, ITaskGraph, TaskStatus } from "@workglow/task-graph";
8+
import { ITask, ITaskGraph, TaskStatus } from "@workglow/task-graph";
9+
import { ArrayTask } from "@workglow/tasks";
910
import type { FC } from "react";
1011
import { memo, useEffect, useState } from "react";
1112
import { Box, Text } from "retuink";

examples/web/src/graph/TaskNode.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import { ArrayTask, ITask, TaskStatus } from "@workglow/task-graph";
7+
import { ITask, TaskStatus } from "@workglow/task-graph";
8+
import { ArrayTask } from "@workglow/tasks";
89
import { Node, NodeProps } from "@xyflow/react";
910
import { useEffect, useState } from "react";
1011
import { FiCloud, FiCloudLightning } from "react-icons/fi";

packages/ai/src/task/BackgroundRemovalTask.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export class BackgroundRemovalTask extends AiVisionTask<
6161
}
6262
}
6363

64-
6564
/**
6665
* Convenience function to run background removal tasks.
6766
* Creates and executes a BackgroundRemovalTask with the provided input.

packages/ai/src/task/ChunkToVectorTask.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
IExecuteContext,
1111
JobQueueTaskConfig,
1212
Task,
13-
TaskRegistry,
1413
Workflow,
1514
} from "@workglow/task-graph";
1615
import {
@@ -160,7 +159,6 @@ export class ChunkToVectorTask extends Task<
160159
}
161160
}
162161

163-
164162
export const chunkToVector = (input: ChunkToVectorTaskInput, config?: JobQueueTaskConfig) => {
165163
return new ChunkToVectorTask({} as ChunkToVectorTaskInput, config).run(input);
166164
};

packages/ai/src/task/ContextBuilderTask.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import {
8-
CreateWorkflow,
9-
JobQueueTaskConfig,
10-
Task,
11-
TaskRegistry,
12-
Workflow,
13-
} from "@workglow/task-graph";
7+
import { CreateWorkflow, JobQueueTaskConfig, Task, Workflow } from "@workglow/task-graph";
148
import { DataPortSchema, FromSchema } from "@workglow/util";
159

1610
export const ContextFormat = {
@@ -320,7 +314,6 @@ export class ContextBuilderTask extends Task<
320314
}
321315
}
322316

323-
324317
export const contextBuilder = (input: ContextBuilderTaskInput, config?: JobQueueTaskConfig) => {
325318
return new ContextBuilderTask({} as ContextBuilderTaskInput, config).run(input);
326319
};

packages/ai/src/task/DocumentEnricherTask.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
IExecuteContext,
1717
JobQueueTaskConfig,
1818
Task,
19-
TaskRegistry,
2019
Workflow,
2120
} from "@workglow/task-graph";
2221
import { DataPortSchema, FromSchema } from "@workglow/util";
@@ -398,7 +397,6 @@ export class DocumentEnricherTask extends Task<
398397
}
399398
}
400399

401-
402400
export const documentEnricher = (input: DocumentEnricherTaskInput, config?: JobQueueTaskConfig) => {
403401
return new DocumentEnricherTask({} as DocumentEnricherTaskInput, config).run(input);
404402
};

packages/ai/src/task/DocumentNodeRetrievalTask.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
IExecuteContext,
1414
JobQueueTaskConfig,
1515
Task,
16-
TaskRegistry,
1716
Workflow,
1817
} from "@workglow/task-graph";
1918
import {
@@ -231,7 +230,6 @@ export class DocumentNodeRetrievalTask extends Task<
231230
}
232231
}
233232

234-
235233
export const retrieval = (input: RetrievalTaskInput, config?: JobQueueTaskConfig) => {
236234
return new DocumentNodeRetrievalTask({} as RetrievalTaskInput, config).run(input);
237235
};

packages/ai/src/task/DocumentNodeVectorHybridSearchTask.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
IExecuteContext,
1414
JobQueueTaskConfig,
1515
Task,
16-
TaskRegistry,
1716
Workflow,
1817
} from "@workglow/task-graph";
1918
import {
@@ -217,7 +216,6 @@ export class DocumentNodeVectorHybridSearchTask extends Task<
217216
}
218217
}
219218

220-
221219
export const hybridSearch = async (
222220
input: HybridSearchTaskInput,
223221
config?: JobQueueTaskConfig

packages/ai/src/task/DocumentNodeVectorSearchTask.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
IExecuteContext,
1414
JobQueueTaskConfig,
1515
Task,
16-
TaskRegistry,
1716
Workflow,
1817
} from "@workglow/task-graph";
1918
import {
@@ -153,7 +152,6 @@ export class DocumentNodeVectorSearchTask extends Task<
153152
}
154153
}
155154

156-
157155
export const vectorStoreSearch = (
158156
input: VectorStoreSearchTaskInput,
159157
config?: JobQueueTaskConfig

0 commit comments

Comments
 (0)