@workglow/ai 0.0.85 → 0.0.86
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 +165 -34
- package/dist/browser.js +3947 -1449
- package/dist/browser.js.map +49 -38
- package/dist/bun.js +3947 -1449
- package/dist/bun.js.map +49 -38
- package/dist/common.d.ts +0 -3
- package/dist/common.d.ts.map +1 -1
- package/dist/model/ModelRegistry.d.ts +2 -2
- package/dist/model/ModelRegistry.d.ts.map +1 -1
- package/dist/model/ModelRepository.d.ts +3 -3
- package/dist/model/ModelRepository.d.ts.map +1 -1
- package/dist/node.js +3947 -1449
- package/dist/node.js.map +49 -38
- package/dist/task/BackgroundRemovalTask.d.ts +121 -289
- package/dist/task/BackgroundRemovalTask.d.ts.map +1 -1
- package/dist/task/ChunkRetrievalTask.d.ts +243 -0
- package/dist/task/ChunkRetrievalTask.d.ts.map +1 -0
- package/dist/task/ChunkToVectorTask.d.ts +183 -0
- package/dist/task/ChunkToVectorTask.d.ts.map +1 -0
- package/dist/task/ChunkVectorHybridSearchTask.d.ts +160 -0
- package/dist/task/ChunkVectorHybridSearchTask.d.ts.map +1 -0
- package/dist/task/ChunkVectorSearchTask.d.ts +137 -0
- package/dist/task/ChunkVectorSearchTask.d.ts.map +1 -0
- package/dist/task/ChunkVectorUpsertTask.d.ts +120 -0
- package/dist/task/ChunkVectorUpsertTask.d.ts.map +1 -0
- package/dist/task/ContextBuilderTask.d.ts +131 -0
- package/dist/task/ContextBuilderTask.d.ts.map +1 -0
- package/dist/task/DocumentEnricherTask.d.ts +232 -0
- package/dist/task/DocumentEnricherTask.d.ts.map +1 -0
- package/dist/task/DownloadModelTask.d.ts +79 -208
- package/dist/task/DownloadModelTask.d.ts.map +1 -1
- package/dist/task/FaceDetectorTask.d.ts +117 -272
- package/dist/task/FaceDetectorTask.d.ts.map +1 -1
- package/dist/task/FaceLandmarkerTask.d.ts +117 -272
- package/dist/task/FaceLandmarkerTask.d.ts.map +1 -1
- package/dist/task/GestureRecognizerTask.d.ts +129 -284
- package/dist/task/GestureRecognizerTask.d.ts.map +1 -1
- package/dist/task/HandLandmarkerTask.d.ts +125 -280
- package/dist/task/HandLandmarkerTask.d.ts.map +1 -1
- package/dist/task/HierarchicalChunkerTask.d.ts +212 -0
- package/dist/task/HierarchicalChunkerTask.d.ts.map +1 -0
- package/dist/task/HierarchyJoinTask.d.ts +318 -0
- package/dist/task/HierarchyJoinTask.d.ts.map +1 -0
- package/dist/task/ImageClassificationTask.d.ts +117 -272
- package/dist/task/ImageClassificationTask.d.ts.map +1 -1
- package/dist/task/ImageEmbeddingTask.d.ts +125 -446
- package/dist/task/ImageEmbeddingTask.d.ts.map +1 -1
- package/dist/task/ImageSegmentationTask.d.ts +117 -272
- package/dist/task/ImageSegmentationTask.d.ts.map +1 -1
- package/dist/task/ImageToTextTask.d.ts +117 -272
- package/dist/task/ImageToTextTask.d.ts.map +1 -1
- package/dist/task/ObjectDetectionTask.d.ts +119 -274
- package/dist/task/ObjectDetectionTask.d.ts.map +1 -1
- package/dist/task/PoseLandmarkerTask.d.ts +117 -272
- package/dist/task/PoseLandmarkerTask.d.ts.map +1 -1
- package/dist/task/QueryExpanderTask.d.ts +129 -0
- package/dist/task/QueryExpanderTask.d.ts.map +1 -0
- package/dist/task/RerankerTask.d.ts +209 -0
- package/dist/task/RerankerTask.d.ts.map +1 -0
- package/dist/task/StructuralParserTask.d.ts +91 -0
- package/dist/task/StructuralParserTask.d.ts.map +1 -0
- package/dist/task/TextChunkerTask.d.ts +129 -0
- package/dist/task/TextChunkerTask.d.ts.map +1 -0
- package/dist/task/TextClassificationTask.d.ts +42 -115
- package/dist/task/TextClassificationTask.d.ts.map +1 -1
- package/dist/task/TextEmbeddingTask.d.ts +55 -277
- package/dist/task/TextEmbeddingTask.d.ts.map +1 -1
- package/dist/task/TextFillMaskTask.d.ts +42 -115
- package/dist/task/TextFillMaskTask.d.ts.map +1 -1
- package/dist/task/TextGenerationTask.d.ts +44 -128
- package/dist/task/TextGenerationTask.d.ts.map +1 -1
- package/dist/task/TextLanguageDetectionTask.d.ts +42 -115
- package/dist/task/TextLanguageDetectionTask.d.ts.map +1 -1
- package/dist/task/TextNamedEntityRecognitionTask.d.ts +42 -115
- package/dist/task/TextNamedEntityRecognitionTask.d.ts.map +1 -1
- package/dist/task/TextQuestionAnswerTask.d.ts +47 -144
- package/dist/task/TextQuestionAnswerTask.d.ts.map +1 -1
- package/dist/task/TextRewriterTask.d.ts +45 -131
- package/dist/task/TextRewriterTask.d.ts.map +1 -1
- package/dist/task/TextSummaryTask.d.ts +42 -115
- package/dist/task/TextSummaryTask.d.ts.map +1 -1
- package/dist/task/TextTranslationTask.d.ts +54 -168
- package/dist/task/TextTranslationTask.d.ts.map +1 -1
- package/dist/task/TopicSegmenterTask.d.ts +148 -0
- package/dist/task/TopicSegmenterTask.d.ts.map +1 -0
- package/dist/task/UnloadModelTask.d.ts +79 -208
- package/dist/task/UnloadModelTask.d.ts.map +1 -1
- package/dist/task/VectorQuantizeTask.d.ts +120 -0
- package/dist/task/VectorQuantizeTask.d.ts.map +1 -0
- package/dist/task/VectorSimilarityTask.d.ts +18 -253
- package/dist/task/VectorSimilarityTask.d.ts.map +1 -1
- package/dist/task/base/AiTask.d.ts +24 -22
- package/dist/task/base/AiTask.d.ts.map +1 -1
- package/dist/task/base/AiTaskSchemas.d.ts +3 -127
- package/dist/task/base/AiTaskSchemas.d.ts.map +1 -1
- package/dist/task/base/AiVisionTask.d.ts +1 -4
- package/dist/task/base/AiVisionTask.d.ts.map +1 -1
- package/dist/task/index.d.ts +54 -1
- package/dist/task/index.d.ts.map +1 -1
- package/package.json +14 -9
- package/dist/source/Document.d.ts +0 -56
- package/dist/source/Document.d.ts.map +0 -1
- package/dist/source/DocumentConverter.d.ts +0 -15
- package/dist/source/DocumentConverter.d.ts.map +0 -1
- package/dist/source/DocumentConverterMarkdown.d.ts +0 -13
- package/dist/source/DocumentConverterMarkdown.d.ts.map +0 -1
- package/dist/source/DocumentConverterText.d.ts +0 -13
- package/dist/source/DocumentConverterText.d.ts.map +0 -1
- package/dist/source/MasterDocument.d.ts +0 -27
- package/dist/source/MasterDocument.d.ts.map +0 -1
- package/dist/source/index.d.ts +0 -10
- package/dist/source/index.d.ts.map +0 -1
- package/dist/task/DocumentSplitterTask.d.ts +0 -58
- package/dist/task/DocumentSplitterTask.d.ts.map +0 -1
|
@@ -6,115 +6,57 @@
|
|
|
6
6
|
import { CreateWorkflow, JobQueueTaskConfig } from "@workglow/task-graph";
|
|
7
7
|
import { DataPortSchema, FromSchema } from "@workglow/util";
|
|
8
8
|
import { AiTask } from "./base/AiTask";
|
|
9
|
-
import { DeReplicateFromSchema } from "./base/AiTaskSchemas";
|
|
10
9
|
declare const UnloadModelInputSchema: {
|
|
11
10
|
readonly type: "object";
|
|
12
11
|
readonly properties: {
|
|
13
12
|
readonly model: {
|
|
14
|
-
readonly "x-replicate": true;
|
|
15
|
-
readonly format?: string | undefined;
|
|
16
13
|
readonly oneOf: readonly [{
|
|
17
|
-
readonly
|
|
18
|
-
|
|
19
|
-
readonly description: `The model ${string}`;
|
|
20
|
-
} & {
|
|
21
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
22
|
-
readonly type: "string";
|
|
23
|
-
}, {
|
|
24
|
-
readonly type: "object";
|
|
25
|
-
readonly properties: {
|
|
26
|
-
readonly model_id: {
|
|
27
|
-
readonly type: "string";
|
|
28
|
-
};
|
|
29
|
-
readonly tasks: {
|
|
30
|
-
readonly type: "array";
|
|
31
|
-
readonly items: {
|
|
32
|
-
readonly type: "string";
|
|
33
|
-
};
|
|
34
|
-
readonly "x-ui-editor": "multiselect";
|
|
35
|
-
};
|
|
36
|
-
readonly title: {
|
|
37
|
-
readonly type: "string";
|
|
38
|
-
};
|
|
39
|
-
readonly description: {
|
|
40
|
-
readonly type: "string";
|
|
41
|
-
readonly "x-ui-editor": "textarea";
|
|
42
|
-
};
|
|
43
|
-
readonly provider: {
|
|
44
|
-
readonly type: "string";
|
|
45
|
-
};
|
|
46
|
-
readonly provider_config: {
|
|
47
|
-
readonly type: "object";
|
|
48
|
-
readonly default: {};
|
|
49
|
-
};
|
|
50
|
-
readonly metadata: {
|
|
51
|
-
readonly type: "object";
|
|
52
|
-
readonly default: {};
|
|
53
|
-
readonly "x-ui-hidden": true;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
readonly required: readonly ["provider", "provider_config"];
|
|
57
|
-
readonly format: "model";
|
|
58
|
-
readonly additionalProperties: false;
|
|
59
|
-
} & {
|
|
60
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
61
|
-
}];
|
|
14
|
+
readonly title: "Model";
|
|
15
|
+
readonly description: `The model ${string}`;
|
|
62
16
|
} & {
|
|
63
17
|
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
18
|
+
readonly type: "string";
|
|
64
19
|
}, {
|
|
65
|
-
readonly type: "
|
|
66
|
-
readonly
|
|
67
|
-
readonly
|
|
68
|
-
readonly title: "Model";
|
|
69
|
-
readonly description: `The model ${string}`;
|
|
70
|
-
} & {
|
|
71
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
20
|
+
readonly type: "object";
|
|
21
|
+
readonly properties: {
|
|
22
|
+
readonly model_id: {
|
|
72
23
|
readonly type: "string";
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
readonly
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
readonly tasks: {
|
|
80
|
-
readonly type: "array";
|
|
81
|
-
readonly items: {
|
|
82
|
-
readonly type: "string";
|
|
83
|
-
};
|
|
84
|
-
readonly "x-ui-editor": "multiselect";
|
|
85
|
-
};
|
|
86
|
-
readonly title: {
|
|
87
|
-
readonly type: "string";
|
|
88
|
-
};
|
|
89
|
-
readonly description: {
|
|
90
|
-
readonly type: "string";
|
|
91
|
-
readonly "x-ui-editor": "textarea";
|
|
92
|
-
};
|
|
93
|
-
readonly provider: {
|
|
94
|
-
readonly type: "string";
|
|
95
|
-
};
|
|
96
|
-
readonly provider_config: {
|
|
97
|
-
readonly type: "object";
|
|
98
|
-
readonly default: {};
|
|
99
|
-
};
|
|
100
|
-
readonly metadata: {
|
|
101
|
-
readonly type: "object";
|
|
102
|
-
readonly default: {};
|
|
103
|
-
readonly "x-ui-hidden": true;
|
|
104
|
-
};
|
|
24
|
+
};
|
|
25
|
+
readonly tasks: {
|
|
26
|
+
readonly type: "array";
|
|
27
|
+
readonly items: {
|
|
28
|
+
readonly type: "string";
|
|
105
29
|
};
|
|
106
|
-
readonly
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
30
|
+
readonly "x-ui-editor": "multiselect";
|
|
31
|
+
};
|
|
32
|
+
readonly title: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
};
|
|
35
|
+
readonly description: {
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
readonly "x-ui-editor": "textarea";
|
|
38
|
+
};
|
|
39
|
+
readonly provider: {
|
|
40
|
+
readonly type: "string";
|
|
41
|
+
};
|
|
42
|
+
readonly provider_config: {
|
|
43
|
+
readonly type: "object";
|
|
44
|
+
readonly default: {};
|
|
45
|
+
};
|
|
46
|
+
readonly metadata: {
|
|
47
|
+
readonly type: "object";
|
|
48
|
+
readonly default: {};
|
|
49
|
+
readonly "x-ui-hidden": true;
|
|
50
|
+
};
|
|
114
51
|
};
|
|
52
|
+
readonly required: readonly ["provider", "provider_config"];
|
|
53
|
+
readonly format: "model";
|
|
54
|
+
readonly additionalProperties: false;
|
|
55
|
+
} & {
|
|
56
|
+
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
115
57
|
}];
|
|
116
|
-
|
|
117
|
-
readonly
|
|
58
|
+
} & {
|
|
59
|
+
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
118
60
|
};
|
|
119
61
|
};
|
|
120
62
|
readonly required: readonly ["model"];
|
|
@@ -124,110 +66,53 @@ declare const UnloadModelOutputSchema: {
|
|
|
124
66
|
readonly type: "object";
|
|
125
67
|
readonly properties: {
|
|
126
68
|
readonly model: {
|
|
127
|
-
readonly "x-replicate": true;
|
|
128
|
-
readonly format?: string | undefined;
|
|
129
69
|
readonly oneOf: readonly [{
|
|
130
|
-
readonly
|
|
131
|
-
|
|
132
|
-
readonly description: `The model ${string}`;
|
|
133
|
-
} & {
|
|
134
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
135
|
-
readonly type: "string";
|
|
136
|
-
}, {
|
|
137
|
-
readonly type: "object";
|
|
138
|
-
readonly properties: {
|
|
139
|
-
readonly model_id: {
|
|
140
|
-
readonly type: "string";
|
|
141
|
-
};
|
|
142
|
-
readonly tasks: {
|
|
143
|
-
readonly type: "array";
|
|
144
|
-
readonly items: {
|
|
145
|
-
readonly type: "string";
|
|
146
|
-
};
|
|
147
|
-
readonly "x-ui-editor": "multiselect";
|
|
148
|
-
};
|
|
149
|
-
readonly title: {
|
|
150
|
-
readonly type: "string";
|
|
151
|
-
};
|
|
152
|
-
readonly description: {
|
|
153
|
-
readonly type: "string";
|
|
154
|
-
readonly "x-ui-editor": "textarea";
|
|
155
|
-
};
|
|
156
|
-
readonly provider: {
|
|
157
|
-
readonly type: "string";
|
|
158
|
-
};
|
|
159
|
-
readonly provider_config: {
|
|
160
|
-
readonly type: "object";
|
|
161
|
-
readonly default: {};
|
|
162
|
-
};
|
|
163
|
-
readonly metadata: {
|
|
164
|
-
readonly type: "object";
|
|
165
|
-
readonly default: {};
|
|
166
|
-
readonly "x-ui-hidden": true;
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
readonly required: readonly ["provider", "provider_config"];
|
|
170
|
-
readonly format: "model";
|
|
171
|
-
readonly additionalProperties: false;
|
|
172
|
-
} & {
|
|
173
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
174
|
-
}];
|
|
70
|
+
readonly title: "Model";
|
|
71
|
+
readonly description: `The model ${string}`;
|
|
175
72
|
} & {
|
|
176
73
|
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
74
|
+
readonly type: "string";
|
|
177
75
|
}, {
|
|
178
|
-
readonly type: "
|
|
179
|
-
readonly
|
|
180
|
-
readonly
|
|
181
|
-
readonly title: "Model";
|
|
182
|
-
readonly description: `The model ${string}`;
|
|
183
|
-
} & {
|
|
184
|
-
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
76
|
+
readonly type: "object";
|
|
77
|
+
readonly properties: {
|
|
78
|
+
readonly model_id: {
|
|
185
79
|
readonly type: "string";
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
readonly
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
};
|
|
192
|
-
readonly tasks: {
|
|
193
|
-
readonly type: "array";
|
|
194
|
-
readonly items: {
|
|
195
|
-
readonly type: "string";
|
|
196
|
-
};
|
|
197
|
-
readonly "x-ui-editor": "multiselect";
|
|
198
|
-
};
|
|
199
|
-
readonly title: {
|
|
200
|
-
readonly type: "string";
|
|
201
|
-
};
|
|
202
|
-
readonly description: {
|
|
203
|
-
readonly type: "string";
|
|
204
|
-
readonly "x-ui-editor": "textarea";
|
|
205
|
-
};
|
|
206
|
-
readonly provider: {
|
|
207
|
-
readonly type: "string";
|
|
208
|
-
};
|
|
209
|
-
readonly provider_config: {
|
|
210
|
-
readonly type: "object";
|
|
211
|
-
readonly default: {};
|
|
212
|
-
};
|
|
213
|
-
readonly metadata: {
|
|
214
|
-
readonly type: "object";
|
|
215
|
-
readonly default: {};
|
|
216
|
-
readonly "x-ui-hidden": true;
|
|
217
|
-
};
|
|
80
|
+
};
|
|
81
|
+
readonly tasks: {
|
|
82
|
+
readonly type: "array";
|
|
83
|
+
readonly items: {
|
|
84
|
+
readonly type: "string";
|
|
218
85
|
};
|
|
219
|
-
readonly
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
86
|
+
readonly "x-ui-editor": "multiselect";
|
|
87
|
+
};
|
|
88
|
+
readonly title: {
|
|
89
|
+
readonly type: "string";
|
|
90
|
+
};
|
|
91
|
+
readonly description: {
|
|
92
|
+
readonly type: "string";
|
|
93
|
+
readonly "x-ui-editor": "textarea";
|
|
94
|
+
};
|
|
95
|
+
readonly provider: {
|
|
96
|
+
readonly type: "string";
|
|
97
|
+
};
|
|
98
|
+
readonly provider_config: {
|
|
99
|
+
readonly type: "object";
|
|
100
|
+
readonly default: {};
|
|
101
|
+
};
|
|
102
|
+
readonly metadata: {
|
|
103
|
+
readonly type: "object";
|
|
104
|
+
readonly default: {};
|
|
105
|
+
readonly "x-ui-hidden": true;
|
|
106
|
+
};
|
|
227
107
|
};
|
|
108
|
+
readonly required: readonly ["provider", "provider_config"];
|
|
109
|
+
readonly format: "model";
|
|
110
|
+
readonly additionalProperties: false;
|
|
111
|
+
} & {
|
|
112
|
+
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
228
113
|
}];
|
|
229
|
-
|
|
230
|
-
readonly
|
|
114
|
+
} & {
|
|
115
|
+
readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
|
|
231
116
|
};
|
|
232
117
|
};
|
|
233
118
|
readonly required: readonly ["model"];
|
|
@@ -235,8 +120,6 @@ declare const UnloadModelOutputSchema: {
|
|
|
235
120
|
};
|
|
236
121
|
export type UnloadModelTaskRunInput = FromSchema<typeof UnloadModelInputSchema>;
|
|
237
122
|
export type UnloadModelTaskRunOutput = FromSchema<typeof UnloadModelOutputSchema>;
|
|
238
|
-
export type UnloadModelTaskExecuteInput = DeReplicateFromSchema<typeof UnloadModelInputSchema>;
|
|
239
|
-
export type UnloadModelTaskExecuteOutput = DeReplicateFromSchema<typeof UnloadModelOutputSchema>;
|
|
240
123
|
/**
|
|
241
124
|
* Unload a model from memory and clear its cache.
|
|
242
125
|
*
|
|
@@ -271,19 +154,7 @@ export declare const unloadModel: (input: UnloadModelTaskRunInput, config?: JobQ
|
|
|
271
154
|
provider_config: {
|
|
272
155
|
[x: string]: unknown;
|
|
273
156
|
};
|
|
274
|
-
}
|
|
275
|
-
title?: string | undefined;
|
|
276
|
-
description?: string | undefined;
|
|
277
|
-
model_id?: string | undefined;
|
|
278
|
-
tasks?: string[] | undefined;
|
|
279
|
-
metadata?: {
|
|
280
|
-
[x: string]: unknown;
|
|
281
|
-
} | undefined;
|
|
282
|
-
provider: string;
|
|
283
|
-
provider_config: {
|
|
284
|
-
[x: string]: unknown;
|
|
285
|
-
};
|
|
286
|
-
})[];
|
|
157
|
+
};
|
|
287
158
|
}>;
|
|
288
159
|
declare module "@workglow/task-graph" {
|
|
289
160
|
interface Workflow {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnloadModelTask.d.ts","sourceRoot":"","sources":["../../src/task/UnloadModelTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"UnloadModelTask.d.ts","sourceRoot":"","sources":["../../src/task/UnloadModelTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAY,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvC,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOO,CAAC;AAEpC,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOM,CAAC;AAEpC,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAChF,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAElF;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,MAAM,CACzC,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,CACnB;IACC,OAAc,IAAI,SAAqB;IACvC,OAAc,QAAQ,SAAY;IAClC,OAAc,KAAK,SAAkB;IACrC,OAAc,WAAW,SAAiE;WAC5E,WAAW,IAAI,cAAc;WAG7B,YAAY,IAAI,cAAc;IAG5C,OAAc,SAAS,UAAS;CACjC;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,uBAAuB,EAAE,SAAS,kBAAkB;;;;;;;;;;;;;;EAEtF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,WAAW,EAAE,cAAc,CACzB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,CACnB,CAAC;KACH;CACF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { CreateWorkflow, JobQueueTaskConfig, Task } from "@workglow/task-graph";
|
|
7
|
+
import { DataPortSchema, FromSchema, TypedArray, TypedArraySchemaOptions } from "@workglow/util";
|
|
8
|
+
declare const inputSchema: {
|
|
9
|
+
readonly type: "object";
|
|
10
|
+
readonly properties: {
|
|
11
|
+
readonly vector: {
|
|
12
|
+
readonly anyOf: readonly [{
|
|
13
|
+
readonly type: "array";
|
|
14
|
+
readonly format: "TypedArray";
|
|
15
|
+
readonly title: "Typed Array";
|
|
16
|
+
readonly description: "A typed array (Float32Array, Int8Array, etc.)";
|
|
17
|
+
}, {
|
|
18
|
+
readonly type: "array";
|
|
19
|
+
readonly items: {
|
|
20
|
+
readonly type: "array";
|
|
21
|
+
readonly format: "TypedArray";
|
|
22
|
+
readonly title: "Typed Array";
|
|
23
|
+
readonly description: "A typed array (Float32Array, Int8Array, etc.)";
|
|
24
|
+
};
|
|
25
|
+
}];
|
|
26
|
+
readonly title: "Input Vector(s)";
|
|
27
|
+
readonly description: "Vector or array of vectors to quantize";
|
|
28
|
+
};
|
|
29
|
+
readonly targetType: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly enum: ("float16" | "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16")[];
|
|
32
|
+
readonly title: "Target Type";
|
|
33
|
+
readonly description: "Target quantization type";
|
|
34
|
+
readonly default: "int8";
|
|
35
|
+
};
|
|
36
|
+
readonly normalize: {
|
|
37
|
+
readonly type: "boolean";
|
|
38
|
+
readonly title: "Normalize";
|
|
39
|
+
readonly description: "Normalize vector before quantization";
|
|
40
|
+
readonly default: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly required: readonly ["vector", "targetType"];
|
|
44
|
+
readonly additionalProperties: false;
|
|
45
|
+
};
|
|
46
|
+
declare const outputSchema: {
|
|
47
|
+
readonly type: "object";
|
|
48
|
+
readonly properties: {
|
|
49
|
+
readonly vector: {
|
|
50
|
+
readonly anyOf: readonly [{
|
|
51
|
+
readonly type: "array";
|
|
52
|
+
readonly format: "TypedArray";
|
|
53
|
+
readonly title: "Typed Array";
|
|
54
|
+
readonly description: "A typed array (Float32Array, Int8Array, etc.)";
|
|
55
|
+
}, {
|
|
56
|
+
readonly type: "array";
|
|
57
|
+
readonly items: {
|
|
58
|
+
readonly type: "array";
|
|
59
|
+
readonly format: "TypedArray";
|
|
60
|
+
readonly title: "Typed Array";
|
|
61
|
+
readonly description: "A typed array (Float32Array, Int8Array, etc.)";
|
|
62
|
+
};
|
|
63
|
+
}];
|
|
64
|
+
readonly title: "Output Vector(s)";
|
|
65
|
+
readonly description: "Quantized vector or array of vectors";
|
|
66
|
+
};
|
|
67
|
+
readonly originalType: {
|
|
68
|
+
readonly type: "string";
|
|
69
|
+
readonly enum: ("float16" | "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16")[];
|
|
70
|
+
readonly title: "Original Type";
|
|
71
|
+
readonly description: "Original vector type";
|
|
72
|
+
};
|
|
73
|
+
readonly targetType: {
|
|
74
|
+
readonly type: "string";
|
|
75
|
+
readonly enum: ("float16" | "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16")[];
|
|
76
|
+
readonly title: "Target Type";
|
|
77
|
+
readonly description: "Target quantization type";
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
readonly required: readonly ["vector", "originalType", "targetType"];
|
|
81
|
+
readonly additionalProperties: false;
|
|
82
|
+
};
|
|
83
|
+
export type VectorQuantizeTaskInput = FromSchema<typeof inputSchema, TypedArraySchemaOptions>;
|
|
84
|
+
export type VectorQuantizeTaskOutput = FromSchema<typeof outputSchema, TypedArraySchemaOptions>;
|
|
85
|
+
/**
|
|
86
|
+
* Task for quantizing vectors to reduce storage and improve performance.
|
|
87
|
+
* Supports various quantization types including binary, int8, uint8, int16, uint16.
|
|
88
|
+
*/
|
|
89
|
+
export declare class VectorQuantizeTask extends Task<VectorQuantizeTaskInput, VectorQuantizeTaskOutput, JobQueueTaskConfig> {
|
|
90
|
+
static type: string;
|
|
91
|
+
static category: string;
|
|
92
|
+
static title: string;
|
|
93
|
+
static description: string;
|
|
94
|
+
static cacheable: boolean;
|
|
95
|
+
static inputSchema(): DataPortSchema;
|
|
96
|
+
static outputSchema(): DataPortSchema;
|
|
97
|
+
executeReactive(input: VectorQuantizeTaskInput): Promise<VectorQuantizeTaskOutput>;
|
|
98
|
+
private getVectorType;
|
|
99
|
+
private vectorQuantize;
|
|
100
|
+
/**
|
|
101
|
+
* Find min and max values in a single pass for better performance
|
|
102
|
+
*/
|
|
103
|
+
private findMinMax;
|
|
104
|
+
private quantizeToInt8;
|
|
105
|
+
private quantizeToUint8;
|
|
106
|
+
private quantizeToInt16;
|
|
107
|
+
private quantizeToUint16;
|
|
108
|
+
}
|
|
109
|
+
export declare const vectorQuantize: (input: VectorQuantizeTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
110
|
+
vector: TypedArray | TypedArray[];
|
|
111
|
+
targetType: "float16" | "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16";
|
|
112
|
+
originalType: "float16" | "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16";
|
|
113
|
+
}>;
|
|
114
|
+
declare module "@workglow/task-graph" {
|
|
115
|
+
interface Workflow {
|
|
116
|
+
vectorQuantize: CreateWorkflow<VectorQuantizeTaskInput, VectorQuantizeTaskOutput, JobQueueTaskConfig>;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
export {};
|
|
120
|
+
//# sourceMappingURL=VectorQuantizeTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VectorQuantizeTask.d.ts","sourceRoot":"","sources":["../../src/task/VectorQuantizeTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EACL,cAAc,EACd,UAAU,EAGV,UAAU,EAEV,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AAExB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCkB,CAAC;AAEpC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCiB,CAAC;AAEpC,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,WAAW,EAAE,uBAAuB,CAAC,CAAC;AAC9F,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,YAAY,EAAE,uBAAuB,CAAC,CAAC;AAEhG;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,IAAI,CAC1C,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,CACnB;IACC,OAAc,IAAI,SAAwB;IAC1C,OAAc,QAAQ,SAAuB;IAC7C,OAAc,KAAK,SAAqB;IACxC,OAAc,WAAW,SAAgE;IACzF,OAAc,SAAS,UAAQ;WAEjB,WAAW,IAAI,cAAc;WAI7B,YAAY,IAAI,cAAc;IAItC,eAAe,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAexF,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,cAAc;IAuCtB;;OAEG;IACH,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,gBAAgB;CAQzB;AAED,eAAO,MAAM,cAAc,GAAI,OAAO,uBAAuB,EAAE,SAAS,kBAAkB;;;;EAEzF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,cAAc,EAAE,cAAc,CAC5B,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,CACnB,CAAC;KACH;CACF"}
|