@workglow/ai 0.2.15 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -15
- package/dist/browser.js +496 -1002
- package/dist/browser.js.map +11 -14
- package/dist/bun.js +496 -1002
- package/dist/bun.js.map +11 -14
- package/dist/node.js +496 -1002
- package/dist/node.js.map +11 -14
- package/dist/task/ChunkRetrievalTask.d.ts +32 -49
- package/dist/task/ChunkRetrievalTask.d.ts.map +1 -1
- package/dist/task/ChunkVectorUpsertTask.d.ts +107 -24
- package/dist/task/ChunkVectorUpsertTask.d.ts.map +1 -1
- package/dist/task/HierarchyJoinTask.d.ts +44 -42
- package/dist/task/HierarchyJoinTask.d.ts.map +1 -1
- package/dist/task/QueryExpanderTask.d.ts +5 -31
- package/dist/task/QueryExpanderTask.d.ts.map +1 -1
- package/dist/task/RerankerTask.d.ts +7 -89
- package/dist/task/RerankerTask.d.ts.map +1 -1
- package/dist/task/TextChunkerTask.d.ts +139 -37
- package/dist/task/TextChunkerTask.d.ts.map +1 -1
- package/dist/task/index.d.ts +1 -7
- package/dist/task/index.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/task/ChunkToVectorTask.d.ts +0 -210
- package/dist/task/ChunkToVectorTask.d.ts.map +0 -1
- package/dist/task/ChunkVectorHybridSearchTask.d.ts +0 -167
- package/dist/task/ChunkVectorHybridSearchTask.d.ts.map +0 -1
- package/dist/task/ChunkVectorSearchTask.d.ts +0 -139
- package/dist/task/ChunkVectorSearchTask.d.ts.map +0 -1
|
@@ -48,85 +48,11 @@ declare const inputSchema: {
|
|
|
48
48
|
};
|
|
49
49
|
readonly method: {
|
|
50
50
|
readonly type: "string";
|
|
51
|
-
readonly enum: readonly ["
|
|
51
|
+
readonly enum: readonly ["reciprocal-rank-fusion", "simple"];
|
|
52
52
|
readonly title: "Reranking Method";
|
|
53
53
|
readonly description: "Method to use for reranking";
|
|
54
54
|
readonly default: "simple";
|
|
55
55
|
};
|
|
56
|
-
readonly model: {
|
|
57
|
-
readonly oneOf: readonly [{
|
|
58
|
-
readonly title: "Model";
|
|
59
|
-
readonly description: `The model ${string}`;
|
|
60
|
-
} & {
|
|
61
|
-
title: string;
|
|
62
|
-
description: string;
|
|
63
|
-
} & {
|
|
64
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
65
|
-
readonly type: "string";
|
|
66
|
-
}, {
|
|
67
|
-
readonly type: "object";
|
|
68
|
-
readonly properties: {
|
|
69
|
-
readonly model_id: {
|
|
70
|
-
readonly type: "string";
|
|
71
|
-
};
|
|
72
|
-
readonly tasks: {
|
|
73
|
-
readonly type: "array";
|
|
74
|
-
readonly items: {
|
|
75
|
-
readonly type: "string";
|
|
76
|
-
};
|
|
77
|
-
readonly "x-ui-editor": "multiselect";
|
|
78
|
-
};
|
|
79
|
-
readonly title: {
|
|
80
|
-
readonly type: "string";
|
|
81
|
-
};
|
|
82
|
-
readonly description: {
|
|
83
|
-
readonly type: "string";
|
|
84
|
-
readonly "x-ui-editor": "textarea";
|
|
85
|
-
};
|
|
86
|
-
readonly provider: {
|
|
87
|
-
readonly type: "string";
|
|
88
|
-
};
|
|
89
|
-
readonly provider_config: {
|
|
90
|
-
readonly type: "object";
|
|
91
|
-
readonly properties: {
|
|
92
|
-
readonly credential_key: {
|
|
93
|
-
readonly type: "string";
|
|
94
|
-
readonly format: "credential";
|
|
95
|
-
readonly "x-ui-hidden": true;
|
|
96
|
-
};
|
|
97
|
-
readonly native_dimensions: {
|
|
98
|
-
readonly type: "integer";
|
|
99
|
-
readonly description: "Native output vector dimensions for embedding models";
|
|
100
|
-
};
|
|
101
|
-
readonly mrl: {
|
|
102
|
-
readonly type: "boolean";
|
|
103
|
-
readonly description: "Whether the model supports Matryoshka Representation Learning";
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
readonly additionalProperties: true;
|
|
107
|
-
readonly default: {};
|
|
108
|
-
};
|
|
109
|
-
readonly metadata: {
|
|
110
|
-
readonly type: "object";
|
|
111
|
-
readonly default: {};
|
|
112
|
-
readonly "x-ui-hidden": true;
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
readonly required: readonly ["provider", "provider_config"];
|
|
116
|
-
readonly format: "model";
|
|
117
|
-
readonly additionalProperties: true;
|
|
118
|
-
} & {
|
|
119
|
-
title: string;
|
|
120
|
-
description: string;
|
|
121
|
-
} & {
|
|
122
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
123
|
-
}];
|
|
124
|
-
} & {
|
|
125
|
-
title: string;
|
|
126
|
-
description: string;
|
|
127
|
-
} & {
|
|
128
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
129
|
-
};
|
|
130
56
|
};
|
|
131
57
|
readonly required: readonly ["query", "chunks"];
|
|
132
58
|
readonly additionalProperties: false;
|
|
@@ -181,11 +107,10 @@ export type RerankerTaskInput = FromSchema<typeof inputSchema>;
|
|
|
181
107
|
export type RerankerTaskOutput = FromSchema<typeof outputSchema>;
|
|
182
108
|
export type RerankerTaskConfig = TaskConfig<RerankerTaskInput>;
|
|
183
109
|
/**
|
|
184
|
-
*
|
|
185
|
-
* Supports
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* For now, this implements simple heuristic-based reranking.
|
|
110
|
+
* Rerank retrieved chunks to improve relevance using in-process heuristics.
|
|
111
|
+
* Supports `simple` (keyword overlap + position) and `reciprocal-rank-fusion`.
|
|
112
|
+
* Note: a `cross-encoder` method will be added when a real cross-encoder
|
|
113
|
+
* task exists; until then, use a dedicated model task upstream.
|
|
189
114
|
*/
|
|
190
115
|
export declare class RerankerTask extends Task<RerankerTaskInput, RerankerTaskOutput, RerankerTaskConfig> {
|
|
191
116
|
static type: string;
|
|
@@ -196,16 +121,9 @@ export declare class RerankerTask extends Task<RerankerTaskInput, RerankerTaskOu
|
|
|
196
121
|
static inputSchema(): DataPortSchema;
|
|
197
122
|
static outputSchema(): DataPortSchema;
|
|
198
123
|
execute(input: RerankerTaskInput, context: IExecuteContext): Promise<RerankerTaskOutput>;
|
|
199
|
-
|
|
200
|
-
private extractCrossEncoderScore;
|
|
201
|
-
/**
|
|
202
|
-
* Simple heuristic-based reranking using keyword matching and position
|
|
203
|
-
*/
|
|
124
|
+
/** Simple heuristic reranking: keyword overlap + exact match bonus - position penalty */
|
|
204
125
|
private simpleRerank;
|
|
205
|
-
/**
|
|
206
|
-
* Reciprocal Rank Fusion for combining multiple rankings
|
|
207
|
-
* Useful when you have multiple retrieval methods
|
|
208
|
-
*/
|
|
126
|
+
/** Reciprocal Rank Fusion: 1 / (k + rank) — useful when combining multiple rankings */
|
|
209
127
|
private reciprocalRankFusion;
|
|
210
128
|
}
|
|
211
129
|
export declare const reranker: (input: RerankerTaskInput, config?: RerankerTaskConfig) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RerankerTask.d.ts","sourceRoot":"","sources":["../../src/task/RerankerTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AAEvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"RerankerTask.d.ts","sourceRoot":"","sources":["../../src/task/RerankerTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AAEvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnE,QAAA,MAAM,WAAW;mBACT,QAAQ;;iBAEZ,KAAK;qBACH,IAAI,EAAE,QAAQ;qBACd,KAAK,EA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ema: {
|
|
|
21
21
|
readonly title: "Text";
|
|
22
22
|
readonly description: "The text to chunk";
|
|
23
23
|
};
|
|
24
|
+
readonly doc_id: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly title: "Document ID";
|
|
27
|
+
readonly description: "Optional document ID stamped onto each chunk. When omitted, chunks are emitted without a doc_id and the output also has no doc_id.";
|
|
28
|
+
};
|
|
24
29
|
readonly chunkSize: {
|
|
25
30
|
readonly type: "number";
|
|
26
31
|
readonly title: "Chunk Size";
|
|
@@ -49,47 +54,136 @@ declare const inputSchema: {
|
|
|
49
54
|
declare const outputSchema: {
|
|
50
55
|
readonly type: "object";
|
|
51
56
|
readonly properties: {
|
|
52
|
-
readonly
|
|
53
|
-
readonly type: "
|
|
54
|
-
readonly
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
readonly title: "Text Chunks";
|
|
58
|
-
readonly description: "The chunked text segments";
|
|
57
|
+
readonly doc_id: {
|
|
58
|
+
readonly type: "string";
|
|
59
|
+
readonly title: "Document ID";
|
|
60
|
+
readonly description: "The document ID (only emitted when provided in input)";
|
|
59
61
|
};
|
|
60
|
-
readonly
|
|
62
|
+
readonly chunks: {
|
|
61
63
|
readonly type: "array";
|
|
62
64
|
readonly items: {
|
|
63
65
|
readonly type: "object";
|
|
64
66
|
readonly properties: {
|
|
65
|
-
readonly
|
|
66
|
-
readonly type: "
|
|
67
|
+
readonly chunkId: {
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly title: "Chunk ID";
|
|
70
|
+
readonly description: "Unique identifier for this chunk";
|
|
71
|
+
};
|
|
72
|
+
readonly doc_id: {
|
|
73
|
+
readonly type: "string";
|
|
74
|
+
readonly title: "Document ID";
|
|
75
|
+
readonly description: "ID of the parent document";
|
|
76
|
+
};
|
|
77
|
+
readonly text: {
|
|
78
|
+
readonly type: "string";
|
|
79
|
+
readonly title: "Text";
|
|
80
|
+
readonly description: "Text content of the chunk";
|
|
81
|
+
};
|
|
82
|
+
readonly nodePath: {
|
|
83
|
+
readonly type: "array";
|
|
84
|
+
readonly items: {
|
|
85
|
+
readonly type: "string";
|
|
86
|
+
};
|
|
87
|
+
readonly title: "Node Path";
|
|
88
|
+
readonly description: "Node IDs from root to leaf";
|
|
67
89
|
};
|
|
68
|
-
readonly
|
|
69
|
-
readonly type: "
|
|
90
|
+
readonly depth: {
|
|
91
|
+
readonly type: "integer";
|
|
92
|
+
readonly title: "Depth";
|
|
93
|
+
readonly description: "Depth in the document tree";
|
|
70
94
|
};
|
|
71
|
-
readonly
|
|
72
|
-
readonly type: "
|
|
95
|
+
readonly leafNodeId: {
|
|
96
|
+
readonly type: "string";
|
|
97
|
+
readonly title: "Leaf Node ID";
|
|
98
|
+
readonly description: "ID of the leaf node this chunk belongs to";
|
|
73
99
|
};
|
|
74
|
-
readonly
|
|
75
|
-
readonly type: "
|
|
100
|
+
readonly summary: {
|
|
101
|
+
readonly type: "string";
|
|
102
|
+
readonly title: "Summary";
|
|
103
|
+
readonly description: "Summary of the chunk content";
|
|
104
|
+
};
|
|
105
|
+
readonly entities: {
|
|
106
|
+
readonly type: "array";
|
|
107
|
+
readonly items: {
|
|
108
|
+
readonly type: "object";
|
|
109
|
+
readonly properties: {
|
|
110
|
+
readonly text: {
|
|
111
|
+
readonly type: "string";
|
|
112
|
+
readonly title: "Text";
|
|
113
|
+
readonly description: "Entity text";
|
|
114
|
+
};
|
|
115
|
+
readonly type: {
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
readonly title: "Type";
|
|
118
|
+
readonly description: "Entity type (e.g., PERSON, ORG, LOC)";
|
|
119
|
+
};
|
|
120
|
+
readonly score: {
|
|
121
|
+
readonly type: "number";
|
|
122
|
+
readonly title: "Score";
|
|
123
|
+
readonly description: "Confidence score";
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
readonly required: readonly ["text", "type", "score"];
|
|
127
|
+
readonly additionalProperties: false;
|
|
128
|
+
};
|
|
129
|
+
readonly title: "Entities";
|
|
130
|
+
readonly description: "Named entities extracted from the chunk";
|
|
131
|
+
};
|
|
132
|
+
readonly parentSummaries: {
|
|
133
|
+
readonly type: "array";
|
|
134
|
+
readonly items: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
};
|
|
137
|
+
readonly title: "Parent Summaries";
|
|
138
|
+
readonly description: "Summaries from ancestor nodes";
|
|
139
|
+
};
|
|
140
|
+
readonly sectionTitles: {
|
|
141
|
+
readonly type: "array";
|
|
142
|
+
readonly items: {
|
|
143
|
+
readonly type: "string";
|
|
144
|
+
};
|
|
145
|
+
readonly title: "Section Titles";
|
|
146
|
+
readonly description: "Titles of ancestor section nodes";
|
|
147
|
+
};
|
|
148
|
+
readonly doc_title: {
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
readonly title: "Document Title";
|
|
151
|
+
readonly description: "Title of the parent document";
|
|
76
152
|
};
|
|
77
153
|
};
|
|
78
|
-
readonly
|
|
154
|
+
readonly required: readonly ["chunkId", "doc_id", "text", "nodePath", "depth"];
|
|
155
|
+
readonly additionalProperties: true;
|
|
156
|
+
};
|
|
157
|
+
readonly title: "Chunk Records";
|
|
158
|
+
readonly description: "Array of chunk records";
|
|
159
|
+
};
|
|
160
|
+
readonly text: {
|
|
161
|
+
readonly type: "array";
|
|
162
|
+
readonly items: {
|
|
163
|
+
readonly type: "string";
|
|
79
164
|
};
|
|
80
|
-
readonly title: "
|
|
81
|
-
readonly description: "
|
|
165
|
+
readonly title: "Texts";
|
|
166
|
+
readonly description: "Chunk texts (for TextEmbeddingTask)";
|
|
167
|
+
};
|
|
168
|
+
readonly count: {
|
|
169
|
+
readonly type: "number";
|
|
170
|
+
readonly title: "Count";
|
|
171
|
+
readonly description: "Number of chunks generated";
|
|
82
172
|
};
|
|
83
173
|
};
|
|
84
|
-
readonly required: readonly ["chunks", "
|
|
174
|
+
readonly required: readonly ["chunks", "text", "count"];
|
|
85
175
|
readonly additionalProperties: false;
|
|
86
176
|
};
|
|
87
177
|
export type TextChunkerTaskInput = FromSchema<typeof inputSchema>;
|
|
88
178
|
export type TextChunkerTaskOutput = FromSchema<typeof outputSchema>;
|
|
89
179
|
export type TextChunkerTaskConfig = TaskConfig<TextChunkerTaskInput>;
|
|
90
180
|
/**
|
|
91
|
-
* Task for chunking text into smaller segments with configurable strategies.
|
|
92
|
-
*
|
|
181
|
+
* Task for chunking plain text into smaller segments with configurable strategies.
|
|
182
|
+
* Emits `ChunkRecord[]` so the output is interchangeable with HierarchicalChunkerTask
|
|
183
|
+
* and can feed directly into TextEmbeddingTask → ChunkVectorUpsertTask.
|
|
184
|
+
*
|
|
185
|
+
* Deterministic: identical inputs produce identical `chunkId`s (no random UUIDs),
|
|
186
|
+
* so this task is safe to mark cacheable.
|
|
93
187
|
*/
|
|
94
188
|
export declare class TextChunkerTask extends Task<TextChunkerTaskInput, TextChunkerTaskOutput, TextChunkerTaskConfig> {
|
|
95
189
|
static type: string;
|
|
@@ -100,27 +194,35 @@ export declare class TextChunkerTask extends Task<TextChunkerTaskInput, TextChun
|
|
|
100
194
|
static inputSchema(): DataPortSchema;
|
|
101
195
|
static outputSchema(): DataPortSchema;
|
|
102
196
|
execute(input: TextChunkerTaskInput, context: IExecuteContext): Promise<TextChunkerTaskOutput>;
|
|
103
|
-
/**
|
|
104
|
-
* Fixed-size chunking with overlap
|
|
105
|
-
*/
|
|
197
|
+
/** Fixed-size chunking with overlap */
|
|
106
198
|
private chunkFixed;
|
|
107
|
-
/**
|
|
108
|
-
* Sentence-based chunking that respects sentence boundaries
|
|
109
|
-
*/
|
|
199
|
+
/** Sentence-based chunking that respects sentence boundaries */
|
|
110
200
|
private chunkBySentence;
|
|
111
|
-
/**
|
|
112
|
-
* Paragraph-based chunking that respects paragraph boundaries
|
|
113
|
-
*/
|
|
201
|
+
/** Paragraph-based chunking that respects paragraph boundaries */
|
|
114
202
|
private chunkByParagraph;
|
|
115
203
|
}
|
|
116
204
|
export declare const textChunker: (input: TextChunkerTaskInput, config?: TextChunkerTaskConfig) => Promise<{
|
|
117
|
-
chunks:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
205
|
+
chunks: {
|
|
206
|
+
[x: string]: unknown;
|
|
207
|
+
chunkId: string;
|
|
208
|
+
depth: number;
|
|
209
|
+
doc_id: string;
|
|
210
|
+
doc_title?: string | undefined;
|
|
211
|
+
entities?: {
|
|
212
|
+
score: number;
|
|
213
|
+
text: string;
|
|
214
|
+
type: string;
|
|
215
|
+
}[] | undefined;
|
|
216
|
+
leafNodeId?: string | undefined;
|
|
217
|
+
nodePath: string[];
|
|
218
|
+
parentSummaries?: string[] | undefined;
|
|
219
|
+
sectionTitles?: string[] | undefined;
|
|
220
|
+
summary?: string | undefined;
|
|
221
|
+
text: string;
|
|
123
222
|
}[];
|
|
223
|
+
count: number;
|
|
224
|
+
doc_id?: string | undefined;
|
|
225
|
+
text: string[];
|
|
124
226
|
}>;
|
|
125
227
|
declare module "@workglow/task-graph" {
|
|
126
228
|
interface Workflow {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextChunkerTask.d.ts","sourceRoot":"","sources":["../../src/task/TextChunkerTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"TextChunkerTask.d.ts","sourceRoot":"","sources":["../../src/task/TextChunkerTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AAEvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnE,eAAO,MAAM,gBAAgB;aAC3B,KAAK,EAAE,OAAO;aACd,QAAQ,EAAE,UAAU;aACpB,SAAS,EAAE,WAAW;aACtB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,g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G,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAQrE;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,IAAI,CACvC,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,CACtB;IACC,OAAuB,IAAI,SAAqB;IAChD,OAAuB,QAAQ,SAAc;IAC7C,OAAuB,KAAK,SAAkB;IAC9C,OAAuB,WAAW,SACgD;IAClF,OAAuB,SAAS,UAAQ;IAExC,OAAuB,WAAW,IAAI,cAAc,CAEnD;IAED,OAAuB,YAAY,IAAI,cAAc,CAEpD;IAEc,OAAO,CACpB,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,qBAAqB,CAAC,CA+ChC;IAED,uCAAuC;IACvC,OAAO,CAAC,UAAU;IAkBlB,gEAAgE;IAChE,OAAO,CAAC,eAAe;IAgEvB,kEAAkE;IAClE,OAAO,CAAC,gBAAgB;CAoDzB;AAED,eAAO,MAAM,WAAW,UAAW,oBAAoB,WAAW,qBAAqB;;;;;;;;;;;;;;;;;;;;;;EAEtF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC,CAAC;IACrC,UAAU,QAAQ;QAChB,WAAW,EAAE,cAAc,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;KACjG;CACF"}
|
package/dist/task/index.d.ts
CHANGED
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
import { AiChatTask } from "./AiChatTask";
|
|
7
7
|
import { BackgroundRemovalTask } from "./BackgroundRemovalTask";
|
|
8
8
|
import { ChunkRetrievalTask } from "./ChunkRetrievalTask";
|
|
9
|
-
import { ChunkToVectorTask } from "./ChunkToVectorTask";
|
|
10
|
-
import { ChunkVectorHybridSearchTask } from "./ChunkVectorHybridSearchTask";
|
|
11
|
-
import { ChunkVectorSearchTask } from "./ChunkVectorSearchTask";
|
|
12
9
|
import { ChunkVectorUpsertTask } from "./ChunkVectorUpsertTask";
|
|
13
10
|
import { ContextBuilderTask } from "./ContextBuilderTask";
|
|
14
11
|
import { CountTokensTask } from "./CountTokensTask";
|
|
@@ -45,7 +42,7 @@ import { TopicSegmenterTask } from "./TopicSegmenterTask";
|
|
|
45
42
|
import { UnloadModelTask } from "./UnloadModelTask";
|
|
46
43
|
import { VectorQuantizeTask } from "./VectorQuantizeTask";
|
|
47
44
|
import { VectorSimilarityTask } from "./VectorSimilarityTask";
|
|
48
|
-
export declare const registerAiTasks: () => (typeof ToolCallingTask | typeof AiChatTask | typeof BackgroundRemovalTask | typeof TextEmbeddingTask | typeof ChunkRetrievalTask | typeof
|
|
45
|
+
export declare const registerAiTasks: () => (typeof ToolCallingTask | typeof AiChatTask | typeof BackgroundRemovalTask | typeof TextEmbeddingTask | typeof ChunkRetrievalTask | typeof ChunkVectorUpsertTask | typeof CountTokensTask | typeof ContextBuilderTask | typeof TextNamedEntityRecognitionTask | typeof TextSummaryTask | typeof DocumentEnricherTask | typeof DocumentUpsertTask | typeof FaceDetectorTask | typeof FaceLandmarkerTask | typeof HandLandmarkerTask | typeof HierarchicalChunkerTask | typeof HierarchyJoinTask | typeof KbToDocumentsTask | typeof ImageClassificationTask | typeof ImageEmbeddingTask | typeof ImageSegmentationTask | typeof ImageToTextTask | typeof ModelSearchTask | typeof ObjectDetectionTask | typeof PoseLandmarkerTask | typeof QueryExpanderTask | typeof RerankerTask | typeof StructuralParserTask | typeof StructuredGenerationTask | typeof TextChunkerTask | typeof TextClassificationTask | typeof TextFillMaskTask | typeof TextGenerationTask | typeof TextLanguageDetectionTask | typeof TextQuestionAnswerTask | typeof TopicSegmenterTask | typeof UnloadModelTask | typeof VectorQuantizeTask | typeof VectorSimilarityTask)[];
|
|
49
46
|
export * from "./AiChatTask";
|
|
50
47
|
export * from "./ChatMessage";
|
|
51
48
|
export * from "./BackgroundRemovalTask";
|
|
@@ -53,9 +50,6 @@ export * from "./base/AiTask";
|
|
|
53
50
|
export * from "./base/AiTaskSchemas";
|
|
54
51
|
export * from "./base/StreamingAiTask";
|
|
55
52
|
export * from "./ChunkRetrievalTask";
|
|
56
|
-
export * from "./ChunkToVectorTask";
|
|
57
|
-
export * from "./ChunkVectorHybridSearchTask";
|
|
58
|
-
export * from "./ChunkVectorSearchTask";
|
|
59
53
|
export * from "./ChunkVectorUpsertTask";
|
|
60
54
|
export * from "./ContextBuilderTask";
|
|
61
55
|
export * from "./CountTokensTask";
|
package/dist/task/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,gBAAg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AAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workglow/ai",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.16",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/workglow-dev/workglow.git",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@workglow/knowledge-base": "0.2.
|
|
62
|
-
"@workglow/job-queue": "0.2.
|
|
63
|
-
"@workglow/storage": "0.2.
|
|
64
|
-
"@workglow/task-graph": "0.2.
|
|
65
|
-
"@workglow/util": "0.2.
|
|
61
|
+
"@workglow/knowledge-base": "0.2.16",
|
|
62
|
+
"@workglow/job-queue": "0.2.16",
|
|
63
|
+
"@workglow/storage": "0.2.16",
|
|
64
|
+
"@workglow/task-graph": "0.2.16",
|
|
65
|
+
"@workglow/util": "0.2.16"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@workglow/knowledge-base": {
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@workglow/knowledge-base": "0.2.
|
|
86
|
-
"@workglow/job-queue": "0.2.
|
|
87
|
-
"@workglow/storage": "0.2.
|
|
88
|
-
"@workglow/task-graph": "0.2.
|
|
89
|
-
"@workglow/util": "0.2.
|
|
85
|
+
"@workglow/knowledge-base": "0.2.16",
|
|
86
|
+
"@workglow/job-queue": "0.2.16",
|
|
87
|
+
"@workglow/storage": "0.2.16",
|
|
88
|
+
"@workglow/task-graph": "0.2.16",
|
|
89
|
+
"@workglow/util": "0.2.16"
|
|
90
90
|
}
|
|
91
91
|
}
|