@workglow/ai 0.2.5 → 0.2.7
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/dist/browser.js +220 -87
- package/dist/browser.js.map +13 -12
- package/dist/bun.js +220 -87
- package/dist/bun.js.map +13 -12
- package/dist/model/ModelRepository.d.ts +2 -0
- package/dist/model/ModelRepository.d.ts.map +1 -1
- package/dist/model/ModelSchema.d.ts +16 -0
- package/dist/model/ModelSchema.d.ts.map +1 -1
- package/dist/node.js +220 -87
- package/dist/node.js.map +13 -12
- package/dist/provider/AiProvider.d.ts +6 -0
- package/dist/provider/AiProvider.d.ts.map +1 -1
- package/dist/provider/AiProviderRegistry.d.ts +2 -0
- package/dist/provider/AiProviderRegistry.d.ts.map +1 -1
- package/dist/task/AgentTask.d.ts +16 -0
- package/dist/task/AgentTask.d.ts.map +1 -1
- package/dist/task/BackgroundRemovalTask.d.ts +8 -0
- package/dist/task/BackgroundRemovalTask.d.ts.map +1 -1
- package/dist/task/ChunkRetrievalTask.d.ts +8 -0
- package/dist/task/ChunkRetrievalTask.d.ts.map +1 -1
- package/dist/task/ContextBuilderTask.d.ts +8 -0
- package/dist/task/ContextBuilderTask.d.ts.map +1 -1
- package/dist/task/CountTokensTask.d.ts +8 -0
- package/dist/task/CountTokensTask.d.ts.map +1 -1
- package/dist/task/DocumentEnricherTask.d.ts +23 -2
- package/dist/task/DocumentEnricherTask.d.ts.map +1 -1
- package/dist/task/DownloadModelTask.d.ts +18 -0
- package/dist/task/DownloadModelTask.d.ts.map +1 -1
- package/dist/task/FaceDetectorTask.d.ts +8 -0
- package/dist/task/FaceDetectorTask.d.ts.map +1 -1
- package/dist/task/FaceLandmarkerTask.d.ts +8 -0
- package/dist/task/FaceLandmarkerTask.d.ts.map +1 -1
- package/dist/task/GestureRecognizerTask.d.ts +8 -0
- package/dist/task/GestureRecognizerTask.d.ts.map +1 -1
- package/dist/task/HandLandmarkerTask.d.ts +8 -0
- package/dist/task/HandLandmarkerTask.d.ts.map +1 -1
- package/dist/task/HierarchicalChunkerTask.d.ts +15 -2
- package/dist/task/HierarchicalChunkerTask.d.ts.map +1 -1
- package/dist/task/ImageClassificationTask.d.ts +8 -0
- package/dist/task/ImageClassificationTask.d.ts.map +1 -1
- package/dist/task/ImageEmbeddingTask.d.ts +8 -0
- package/dist/task/ImageEmbeddingTask.d.ts.map +1 -1
- package/dist/task/ImageSegmentationTask.d.ts +8 -0
- package/dist/task/ImageSegmentationTask.d.ts.map +1 -1
- package/dist/task/ImageToTextTask.d.ts +8 -0
- package/dist/task/ImageToTextTask.d.ts.map +1 -1
- package/dist/task/KbToDocumentsTask.d.ts +98 -0
- package/dist/task/KbToDocumentsTask.d.ts.map +1 -0
- package/dist/task/ModelInfoTask.d.ts +29 -1
- package/dist/task/ModelInfoTask.d.ts.map +1 -1
- package/dist/task/ObjectDetectionTask.d.ts +8 -0
- package/dist/task/ObjectDetectionTask.d.ts.map +1 -1
- package/dist/task/PoseLandmarkerTask.d.ts +8 -0
- package/dist/task/PoseLandmarkerTask.d.ts.map +1 -1
- package/dist/task/RerankerTask.d.ts +8 -1
- package/dist/task/RerankerTask.d.ts.map +1 -1
- package/dist/task/StructuralParserTask.d.ts +8 -7
- package/dist/task/StructuralParserTask.d.ts.map +1 -1
- package/dist/task/StructuredGenerationTask.d.ts +8 -0
- package/dist/task/StructuredGenerationTask.d.ts.map +1 -1
- package/dist/task/TextClassificationTask.d.ts +8 -0
- package/dist/task/TextClassificationTask.d.ts.map +1 -1
- package/dist/task/TextEmbeddingTask.d.ts +8 -0
- package/dist/task/TextEmbeddingTask.d.ts.map +1 -1
- package/dist/task/TextFillMaskTask.d.ts +8 -0
- package/dist/task/TextFillMaskTask.d.ts.map +1 -1
- package/dist/task/TextGenerationTask.d.ts +8 -0
- package/dist/task/TextGenerationTask.d.ts.map +1 -1
- package/dist/task/TextLanguageDetectionTask.d.ts +8 -0
- package/dist/task/TextLanguageDetectionTask.d.ts.map +1 -1
- package/dist/task/TextNamedEntityRecognitionTask.d.ts +8 -0
- package/dist/task/TextNamedEntityRecognitionTask.d.ts.map +1 -1
- package/dist/task/TextQuestionAnswerTask.d.ts +8 -0
- package/dist/task/TextQuestionAnswerTask.d.ts.map +1 -1
- package/dist/task/TextRewriterTask.d.ts +8 -0
- package/dist/task/TextRewriterTask.d.ts.map +1 -1
- package/dist/task/TextSummaryTask.d.ts +8 -0
- package/dist/task/TextSummaryTask.d.ts.map +1 -1
- package/dist/task/TextTranslationTask.d.ts +8 -0
- package/dist/task/TextTranslationTask.d.ts.map +1 -1
- package/dist/task/ToolCallingTask.d.ts +8 -0
- package/dist/task/ToolCallingTask.d.ts.map +1 -1
- package/dist/task/UnloadModelTask.d.ts +18 -0
- package/dist/task/UnloadModelTask.d.ts.map +1 -1
- package/dist/task/base/AiTask.d.ts.map +1 -1
- package/dist/task/base/AiTaskSchemas.d.ts +16 -0
- package/dist/task/base/AiTaskSchemas.d.ts.map +1 -1
- package/dist/task/index.d.ts +3 -1
- package/dist/task/index.d.ts.map +1 -1
- package/dist/worker.js +19 -3
- package/dist/worker.js.map +4 -4
- package/package.json +11 -11
package/dist/browser.js
CHANGED
|
@@ -454,7 +454,15 @@ var ModelConfigSchema = {
|
|
|
454
454
|
provider_config: {
|
|
455
455
|
type: "object",
|
|
456
456
|
properties: {
|
|
457
|
-
credential_key: { type: "string", format: "credential", "x-ui-hidden": true }
|
|
457
|
+
credential_key: { type: "string", format: "credential", "x-ui-hidden": true },
|
|
458
|
+
native_dimensions: {
|
|
459
|
+
type: "integer",
|
|
460
|
+
description: "Native output vector dimensions for embedding models"
|
|
461
|
+
},
|
|
462
|
+
mrl: {
|
|
463
|
+
type: "boolean",
|
|
464
|
+
description: "Whether the model supports Matryoshka Representation Learning"
|
|
465
|
+
}
|
|
458
466
|
},
|
|
459
467
|
additionalProperties: true,
|
|
460
468
|
default: {}
|
|
@@ -648,6 +656,7 @@ registerInputCompactor("model", async (value, _format, registry) => {
|
|
|
648
656
|
|
|
649
657
|
// src/provider/AiProvider.ts
|
|
650
658
|
import { globalServiceRegistry as globalServiceRegistry3, WORKER_MANAGER as WORKER_MANAGER2 } from "@workglow/util/worker";
|
|
659
|
+
var DEFAULT_AI_PROVIDER_WORKER_IDLE_TIMEOUT_MS = 15 * 60 * 1000;
|
|
651
660
|
function resolveAiProviderGpuQueueConcurrency(concurrency) {
|
|
652
661
|
if (concurrency === undefined) {
|
|
653
662
|
return 1;
|
|
@@ -695,7 +704,13 @@ class AiProvider {
|
|
|
695
704
|
const registry = getAiProviderRegistry();
|
|
696
705
|
if (!isInline && options.worker) {
|
|
697
706
|
const workerManager = globalServiceRegistry3.get(WORKER_MANAGER2);
|
|
698
|
-
|
|
707
|
+
if (typeof options.worker === "function") {
|
|
708
|
+
workerManager.registerWorker(this.name, options.worker, {
|
|
709
|
+
idleTimeoutMs: options.workerIdleTimeoutMs ?? DEFAULT_AI_PROVIDER_WORKER_IDLE_TIMEOUT_MS
|
|
710
|
+
});
|
|
711
|
+
} else {
|
|
712
|
+
workerManager.registerWorker(this.name, options.worker);
|
|
713
|
+
}
|
|
699
714
|
for (const taskType of this.taskTypes) {
|
|
700
715
|
registry.registerAsWorkerRunFn(this.name, taskType);
|
|
701
716
|
registry.registerAsWorkerStreamFn(this.name, taskType);
|
|
@@ -1049,6 +1064,18 @@ class AiTask extends Task {
|
|
|
1049
1064
|
const jobInput = await this.getJobInput(input);
|
|
1050
1065
|
const strategy = getAiProviderRegistry().getStrategy(model);
|
|
1051
1066
|
const output = await strategy.execute(jobInput, executeContext, this.runConfig.runnerId);
|
|
1067
|
+
if (executeContext.resourceScope) {
|
|
1068
|
+
const registry = getAiProviderRegistry();
|
|
1069
|
+
const provider = registry.getProvider(model.provider);
|
|
1070
|
+
const unloadFn = provider?.getRunFn("UnloadModelTask");
|
|
1071
|
+
if (unloadFn) {
|
|
1072
|
+
const modelPath = model.provider_config?.model_path ?? model.model;
|
|
1073
|
+
const resourceKey = `ai:${model.provider}:${modelPath}`;
|
|
1074
|
+
executeContext.resourceScope.register(resourceKey, async () => {
|
|
1075
|
+
await unloadFn({ model }, model, () => {}, AbortSignal.timeout(30000));
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1052
1079
|
return output;
|
|
1053
1080
|
}
|
|
1054
1081
|
async getJobInput(input) {
|
|
@@ -1144,7 +1171,7 @@ class AiTask extends Task {
|
|
|
1144
1171
|
if (modelTaskProperties.length > 0) {
|
|
1145
1172
|
const modelRepo = registry.get(MODEL_REPOSITORY);
|
|
1146
1173
|
const taskModels = await modelRepo.findModelsByTask(this.type) ?? [];
|
|
1147
|
-
for (const [key
|
|
1174
|
+
for (const [key] of modelTaskProperties) {
|
|
1148
1175
|
const requestedModel = input[key];
|
|
1149
1176
|
if (typeof requestedModel === "string") {
|
|
1150
1177
|
const found = taskModels?.find((m) => m.model_id === requestedModel);
|
|
@@ -3205,6 +3232,8 @@ var inputSchema7 = {
|
|
|
3205
3232
|
description: "The document ID"
|
|
3206
3233
|
},
|
|
3207
3234
|
documentTree: {
|
|
3235
|
+
type: "object",
|
|
3236
|
+
additionalProperties: true,
|
|
3208
3237
|
title: "Document Tree",
|
|
3209
3238
|
description: "The hierarchical document tree to enrich"
|
|
3210
3239
|
},
|
|
@@ -4207,6 +4236,8 @@ var inputSchema9 = {
|
|
|
4207
4236
|
description: "The ID of the document"
|
|
4208
4237
|
},
|
|
4209
4238
|
documentTree: {
|
|
4239
|
+
type: "object",
|
|
4240
|
+
additionalProperties: true,
|
|
4210
4241
|
title: "Document Tree",
|
|
4211
4242
|
description: "The hierarchical document tree to chunk"
|
|
4212
4243
|
},
|
|
@@ -4592,8 +4623,97 @@ var hierarchyJoin = (input, config) => {
|
|
|
4592
4623
|
};
|
|
4593
4624
|
Workflow22.prototype.hierarchyJoin = CreateWorkflow22(HierarchyJoinTask);
|
|
4594
4625
|
|
|
4626
|
+
// src/task/KbToDocumentsTask.ts
|
|
4627
|
+
import { TypeKnowledgeBase as TypeKnowledgeBase7 } from "@workglow/knowledge-base";
|
|
4628
|
+
import { CreateWorkflow as CreateWorkflow23, Task as Task13, Workflow as Workflow23 } from "@workglow/task-graph";
|
|
4629
|
+
var inputSchema11 = {
|
|
4630
|
+
type: "object",
|
|
4631
|
+
properties: {
|
|
4632
|
+
knowledgeBase: TypeKnowledgeBase7({
|
|
4633
|
+
title: "Knowledge Base",
|
|
4634
|
+
description: "The knowledge base instance to list documents from"
|
|
4635
|
+
}),
|
|
4636
|
+
onlyStale: {
|
|
4637
|
+
type: "boolean",
|
|
4638
|
+
title: "Only Stale",
|
|
4639
|
+
description: "If true, only return documents that have no chunks (need embedding)",
|
|
4640
|
+
default: true
|
|
4641
|
+
}
|
|
4642
|
+
},
|
|
4643
|
+
required: ["knowledgeBase"],
|
|
4644
|
+
additionalProperties: false
|
|
4645
|
+
};
|
|
4646
|
+
var outputSchema11 = {
|
|
4647
|
+
type: "object",
|
|
4648
|
+
properties: {
|
|
4649
|
+
doc_id: {
|
|
4650
|
+
type: "array",
|
|
4651
|
+
items: { type: "string" },
|
|
4652
|
+
title: "Document IDs",
|
|
4653
|
+
description: "Array of document IDs"
|
|
4654
|
+
},
|
|
4655
|
+
documentTree: {
|
|
4656
|
+
type: "array",
|
|
4657
|
+
items: { type: "object", additionalProperties: true },
|
|
4658
|
+
title: "Document Trees",
|
|
4659
|
+
description: "Array of document root nodes (parallel to doc_id)"
|
|
4660
|
+
},
|
|
4661
|
+
title: {
|
|
4662
|
+
type: "array",
|
|
4663
|
+
items: { type: "string" },
|
|
4664
|
+
title: "Titles",
|
|
4665
|
+
description: "Array of document titles (parallel to doc_id)"
|
|
4666
|
+
}
|
|
4667
|
+
},
|
|
4668
|
+
required: ["doc_id", "documentTree", "title"],
|
|
4669
|
+
additionalProperties: false
|
|
4670
|
+
};
|
|
4671
|
+
|
|
4672
|
+
class KbToDocumentsTask extends Task13 {
|
|
4673
|
+
static type = "KbToDocumentsTask";
|
|
4674
|
+
static category = "Vector Store";
|
|
4675
|
+
static title = "Knowledge Base to Documents";
|
|
4676
|
+
static description = "List documents from a knowledge base, optionally filtering to only those that need embedding";
|
|
4677
|
+
static cacheable = false;
|
|
4678
|
+
static inputSchema() {
|
|
4679
|
+
return inputSchema11;
|
|
4680
|
+
}
|
|
4681
|
+
static outputSchema() {
|
|
4682
|
+
return outputSchema11;
|
|
4683
|
+
}
|
|
4684
|
+
async execute(input, context) {
|
|
4685
|
+
const { knowledgeBase, onlyStale = true } = input;
|
|
4686
|
+
const kb = knowledgeBase;
|
|
4687
|
+
await context.updateProgress(1, "Listing documents");
|
|
4688
|
+
const allDocIds = await kb.listDocuments();
|
|
4689
|
+
const doc_id = [];
|
|
4690
|
+
const documentTree = [];
|
|
4691
|
+
const title = [];
|
|
4692
|
+
for (const id of allDocIds) {
|
|
4693
|
+
if (onlyStale) {
|
|
4694
|
+
const chunks = await kb.getChunksForDocument(id);
|
|
4695
|
+
if (chunks.length > 0) {
|
|
4696
|
+
continue;
|
|
4697
|
+
}
|
|
4698
|
+
}
|
|
4699
|
+
const doc = await kb.getDocument(id);
|
|
4700
|
+
if (!doc) {
|
|
4701
|
+
continue;
|
|
4702
|
+
}
|
|
4703
|
+
doc_id.push(id);
|
|
4704
|
+
documentTree.push(doc.root);
|
|
4705
|
+
title.push(doc.metadata.title);
|
|
4706
|
+
}
|
|
4707
|
+
return { doc_id, documentTree, title };
|
|
4708
|
+
}
|
|
4709
|
+
}
|
|
4710
|
+
var kbToDocuments = (input, config) => {
|
|
4711
|
+
return new KbToDocumentsTask(config).run(input);
|
|
4712
|
+
};
|
|
4713
|
+
Workflow23.prototype.kbToDocuments = CreateWorkflow23(KbToDocumentsTask);
|
|
4714
|
+
|
|
4595
4715
|
// src/task/ImageClassificationTask.ts
|
|
4596
|
-
import { CreateWorkflow as
|
|
4716
|
+
import { CreateWorkflow as CreateWorkflow24, Workflow as Workflow24 } from "@workglow/task-graph";
|
|
4597
4717
|
var modelSchema15 = TypeModel("model:ImageClassificationTask");
|
|
4598
4718
|
var ImageClassificationInputSchema = {
|
|
4599
4719
|
type: "object",
|
|
@@ -4653,10 +4773,10 @@ class ImageClassificationTask extends AiVisionTask {
|
|
|
4653
4773
|
var imageClassification = (input, config) => {
|
|
4654
4774
|
return new ImageClassificationTask(config).run(input);
|
|
4655
4775
|
};
|
|
4656
|
-
|
|
4776
|
+
Workflow24.prototype.imageClassification = CreateWorkflow24(ImageClassificationTask);
|
|
4657
4777
|
|
|
4658
4778
|
// src/task/ImageEmbeddingTask.ts
|
|
4659
|
-
import { CreateWorkflow as
|
|
4779
|
+
import { CreateWorkflow as CreateWorkflow25, Workflow as Workflow25 } from "@workglow/task-graph";
|
|
4660
4780
|
import {
|
|
4661
4781
|
TypedArraySchema as TypedArraySchema7
|
|
4662
4782
|
} from "@workglow/util/schema";
|
|
@@ -4697,10 +4817,10 @@ class ImageEmbeddingTask extends AiVisionTask {
|
|
|
4697
4817
|
var imageEmbedding = (input, config) => {
|
|
4698
4818
|
return new ImageEmbeddingTask(config).run(input);
|
|
4699
4819
|
};
|
|
4700
|
-
|
|
4820
|
+
Workflow25.prototype.imageEmbedding = CreateWorkflow25(ImageEmbeddingTask);
|
|
4701
4821
|
|
|
4702
4822
|
// src/task/ImageSegmentationTask.ts
|
|
4703
|
-
import { CreateWorkflow as
|
|
4823
|
+
import { CreateWorkflow as CreateWorkflow26, Workflow as Workflow26 } from "@workglow/task-graph";
|
|
4704
4824
|
var modelSchema17 = TypeModel("model:ImageSegmentationTask");
|
|
4705
4825
|
var ImageSegmentationInputSchema = {
|
|
4706
4826
|
type: "object",
|
|
@@ -4785,10 +4905,10 @@ class ImageSegmentationTask extends AiVisionTask {
|
|
|
4785
4905
|
var imageSegmentation = (input, config) => {
|
|
4786
4906
|
return new ImageSegmentationTask(config).run(input);
|
|
4787
4907
|
};
|
|
4788
|
-
|
|
4908
|
+
Workflow26.prototype.imageSegmentation = CreateWorkflow26(ImageSegmentationTask);
|
|
4789
4909
|
|
|
4790
4910
|
// src/task/ImageToTextTask.ts
|
|
4791
|
-
import { CreateWorkflow as
|
|
4911
|
+
import { CreateWorkflow as CreateWorkflow27, Workflow as Workflow27 } from "@workglow/task-graph";
|
|
4792
4912
|
var modelSchema18 = TypeModel("model:ImageToTextTask");
|
|
4793
4913
|
var generatedTextSchema = {
|
|
4794
4914
|
type: "string",
|
|
@@ -4840,10 +4960,10 @@ class ImageToTextTask extends AiVisionTask {
|
|
|
4840
4960
|
var imageToText = (input, config) => {
|
|
4841
4961
|
return new ImageToTextTask(config).run(input);
|
|
4842
4962
|
};
|
|
4843
|
-
|
|
4963
|
+
Workflow27.prototype.imageToText = CreateWorkflow27(ImageToTextTask);
|
|
4844
4964
|
|
|
4845
4965
|
// src/task/ModelInfoTask.ts
|
|
4846
|
-
import { CreateWorkflow as
|
|
4966
|
+
import { CreateWorkflow as CreateWorkflow28, Workflow as Workflow28 } from "@workglow/task-graph";
|
|
4847
4967
|
var modelSchema19 = TypeModel("model");
|
|
4848
4968
|
var ModelInfoInputSchema = {
|
|
4849
4969
|
type: "object",
|
|
@@ -4851,7 +4971,7 @@ var ModelInfoInputSchema = {
|
|
|
4851
4971
|
model: modelSchema19,
|
|
4852
4972
|
detail: {
|
|
4853
4973
|
type: "string",
|
|
4854
|
-
enum: ["cached_status", "files", "files_with_metadata"],
|
|
4974
|
+
enum: ["cached_status", "files", "files_with_metadata", "dimensions"],
|
|
4855
4975
|
default: "files_with_metadata"
|
|
4856
4976
|
}
|
|
4857
4977
|
},
|
|
@@ -4873,6 +4993,14 @@ var ModelInfoOutputSchema = {
|
|
|
4873
4993
|
type: "array",
|
|
4874
4994
|
items: { type: "string" },
|
|
4875
4995
|
description: "Available quantization variants (e.g. fp32, fp16, q8). Only present for models with quantization options."
|
|
4996
|
+
},
|
|
4997
|
+
native_dimensions: {
|
|
4998
|
+
type: "integer",
|
|
4999
|
+
description: "Native output vector dimensions. Only present when detail is 'dimensions' and the provider can determine them."
|
|
5000
|
+
},
|
|
5001
|
+
mrl: {
|
|
5002
|
+
type: "boolean",
|
|
5003
|
+
description: "Whether the model supports Matryoshka Representation Learning. Only present when detail is 'dimensions'."
|
|
4876
5004
|
}
|
|
4877
5005
|
},
|
|
4878
5006
|
required: [
|
|
@@ -4911,10 +5039,10 @@ class ModelInfoTask extends AiTask {
|
|
|
4911
5039
|
var modelInfo = (input, config) => {
|
|
4912
5040
|
return new ModelInfoTask(config).run(input);
|
|
4913
5041
|
};
|
|
4914
|
-
|
|
5042
|
+
Workflow28.prototype.modelInfo = CreateWorkflow28(ModelInfoTask);
|
|
4915
5043
|
|
|
4916
5044
|
// src/task/ModelSearchTask.ts
|
|
4917
|
-
import { CreateWorkflow as
|
|
5045
|
+
import { CreateWorkflow as CreateWorkflow29, Task as Task14, Workflow as Workflow29 } from "@workglow/task-graph";
|
|
4918
5046
|
var ModelSearchInputSchema = {
|
|
4919
5047
|
type: "object",
|
|
4920
5048
|
properties: {
|
|
@@ -4979,7 +5107,7 @@ var ModelSearchOutputSchema = {
|
|
|
4979
5107
|
additionalProperties: false
|
|
4980
5108
|
};
|
|
4981
5109
|
|
|
4982
|
-
class ModelSearchTask extends
|
|
5110
|
+
class ModelSearchTask extends Task14 {
|
|
4983
5111
|
static type = "ModelSearchTask";
|
|
4984
5112
|
static category = "AI Model";
|
|
4985
5113
|
static title = "Model Search";
|
|
@@ -5005,10 +5133,10 @@ class ModelSearchTask extends Task13 {
|
|
|
5005
5133
|
var modelSearch = (input, config) => {
|
|
5006
5134
|
return new ModelSearchTask(config).run(input);
|
|
5007
5135
|
};
|
|
5008
|
-
|
|
5136
|
+
Workflow29.prototype.modelSearch = CreateWorkflow29(ModelSearchTask);
|
|
5009
5137
|
|
|
5010
5138
|
// src/task/ObjectDetectionTask.ts
|
|
5011
|
-
import { CreateWorkflow as
|
|
5139
|
+
import { CreateWorkflow as CreateWorkflow30, Workflow as Workflow30 } from "@workglow/task-graph";
|
|
5012
5140
|
var modelSchema20 = TypeModel("model:ObjectDetectionTask");
|
|
5013
5141
|
var detectionSchema = {
|
|
5014
5142
|
type: "object",
|
|
@@ -5088,10 +5216,10 @@ class ObjectDetectionTask extends AiVisionTask {
|
|
|
5088
5216
|
var objectDetection = (input, config) => {
|
|
5089
5217
|
return new ObjectDetectionTask(config).run(input);
|
|
5090
5218
|
};
|
|
5091
|
-
|
|
5219
|
+
Workflow30.prototype.objectDetection = CreateWorkflow30(ObjectDetectionTask);
|
|
5092
5220
|
|
|
5093
5221
|
// src/task/PoseLandmarkerTask.ts
|
|
5094
|
-
import { CreateWorkflow as
|
|
5222
|
+
import { CreateWorkflow as CreateWorkflow31, Workflow as Workflow31 } from "@workglow/task-graph";
|
|
5095
5223
|
var modelSchema21 = TypeModel("model:PoseLandmarkerTask");
|
|
5096
5224
|
var TypePoseLandmark = {
|
|
5097
5225
|
type: "object",
|
|
@@ -5250,17 +5378,17 @@ class PoseLandmarkerTask extends AiVisionTask {
|
|
|
5250
5378
|
var poseLandmarker = (input, config) => {
|
|
5251
5379
|
return new PoseLandmarkerTask(config).run(input);
|
|
5252
5380
|
};
|
|
5253
|
-
|
|
5381
|
+
Workflow31.prototype.poseLandmarker = CreateWorkflow31(PoseLandmarkerTask);
|
|
5254
5382
|
|
|
5255
5383
|
// src/task/QueryExpanderTask.ts
|
|
5256
|
-
import { CreateWorkflow as
|
|
5384
|
+
import { CreateWorkflow as CreateWorkflow32, Task as Task15, Workflow as Workflow32 } from "@workglow/task-graph";
|
|
5257
5385
|
var QueryExpansionMethod = {
|
|
5258
5386
|
MULTI_QUERY: "multi-query",
|
|
5259
5387
|
HYDE: "hyde",
|
|
5260
5388
|
SYNONYMS: "synonyms",
|
|
5261
5389
|
PARAPHRASE: "paraphrase"
|
|
5262
5390
|
};
|
|
5263
|
-
var
|
|
5391
|
+
var inputSchema12 = {
|
|
5264
5392
|
type: "object",
|
|
5265
5393
|
properties: {
|
|
5266
5394
|
query: {
|
|
@@ -5292,7 +5420,7 @@ var inputSchema11 = {
|
|
|
5292
5420
|
required: ["query"],
|
|
5293
5421
|
additionalProperties: false
|
|
5294
5422
|
};
|
|
5295
|
-
var
|
|
5423
|
+
var outputSchema12 = {
|
|
5296
5424
|
type: "object",
|
|
5297
5425
|
properties: {
|
|
5298
5426
|
query: {
|
|
@@ -5321,17 +5449,17 @@ var outputSchema11 = {
|
|
|
5321
5449
|
additionalProperties: false
|
|
5322
5450
|
};
|
|
5323
5451
|
|
|
5324
|
-
class QueryExpanderTask extends
|
|
5452
|
+
class QueryExpanderTask extends Task15 {
|
|
5325
5453
|
static type = "QueryExpanderTask";
|
|
5326
5454
|
static category = "RAG";
|
|
5327
5455
|
static title = "Query Expander";
|
|
5328
5456
|
static description = "Expand queries to improve retrieval coverage";
|
|
5329
5457
|
static cacheable = true;
|
|
5330
5458
|
static inputSchema() {
|
|
5331
|
-
return
|
|
5459
|
+
return inputSchema12;
|
|
5332
5460
|
}
|
|
5333
5461
|
static outputSchema() {
|
|
5334
|
-
return
|
|
5462
|
+
return outputSchema12;
|
|
5335
5463
|
}
|
|
5336
5464
|
async execute(input, context) {
|
|
5337
5465
|
const { query, method = QueryExpansionMethod.MULTI_QUERY, numVariations = 3 } = input;
|
|
@@ -5463,13 +5591,13 @@ class QueryExpanderTask extends Task14 {
|
|
|
5463
5591
|
var queryExpander = (input, config) => {
|
|
5464
5592
|
return new QueryExpanderTask(config).run(input);
|
|
5465
5593
|
};
|
|
5466
|
-
|
|
5594
|
+
Workflow32.prototype.queryExpander = CreateWorkflow32(QueryExpanderTask);
|
|
5467
5595
|
|
|
5468
5596
|
// src/task/RerankerTask.ts
|
|
5469
|
-
import { CreateWorkflow as
|
|
5597
|
+
import { CreateWorkflow as CreateWorkflow34, Task as Task16, Workflow as Workflow34 } from "@workglow/task-graph";
|
|
5470
5598
|
|
|
5471
5599
|
// src/task/TextClassificationTask.ts
|
|
5472
|
-
import { CreateWorkflow as
|
|
5600
|
+
import { CreateWorkflow as CreateWorkflow33, Workflow as Workflow33 } from "@workglow/task-graph";
|
|
5473
5601
|
var modelSchema22 = TypeModel("model:TextClassificationTask");
|
|
5474
5602
|
var TextClassificationInputSchema = {
|
|
5475
5603
|
type: "object",
|
|
@@ -5547,10 +5675,10 @@ class TextClassificationTask extends AiTask {
|
|
|
5547
5675
|
var textClassification = (input, config) => {
|
|
5548
5676
|
return new TextClassificationTask(config).run(input);
|
|
5549
5677
|
};
|
|
5550
|
-
|
|
5678
|
+
Workflow33.prototype.textClassification = CreateWorkflow33(TextClassificationTask);
|
|
5551
5679
|
|
|
5552
5680
|
// src/task/RerankerTask.ts
|
|
5553
|
-
var
|
|
5681
|
+
var inputSchema13 = {
|
|
5554
5682
|
type: "object",
|
|
5555
5683
|
properties: {
|
|
5556
5684
|
query: {
|
|
@@ -5601,7 +5729,7 @@ var inputSchema12 = {
|
|
|
5601
5729
|
required: ["query", "chunks"],
|
|
5602
5730
|
additionalProperties: false
|
|
5603
5731
|
};
|
|
5604
|
-
var
|
|
5732
|
+
var outputSchema13 = {
|
|
5605
5733
|
type: "object",
|
|
5606
5734
|
properties: {
|
|
5607
5735
|
chunks: {
|
|
@@ -5642,18 +5770,17 @@ var outputSchema12 = {
|
|
|
5642
5770
|
additionalProperties: false
|
|
5643
5771
|
};
|
|
5644
5772
|
|
|
5645
|
-
class RerankerTask extends
|
|
5773
|
+
class RerankerTask extends Task16 {
|
|
5646
5774
|
static type = "RerankerTask";
|
|
5647
5775
|
static category = "RAG";
|
|
5648
5776
|
static title = "Reranker";
|
|
5649
5777
|
static description = "Rerank retrieved chunks to improve relevance";
|
|
5650
5778
|
static cacheable = true;
|
|
5651
|
-
resolvedCrossEncoderModel;
|
|
5652
5779
|
static inputSchema() {
|
|
5653
|
-
return
|
|
5780
|
+
return inputSchema13;
|
|
5654
5781
|
}
|
|
5655
5782
|
static outputSchema() {
|
|
5656
|
-
return
|
|
5783
|
+
return outputSchema13;
|
|
5657
5784
|
}
|
|
5658
5785
|
async execute(input, context) {
|
|
5659
5786
|
const { query, chunks, scores = [], metadata = [], topK, method = "simple", model } = input;
|
|
@@ -5771,13 +5898,13 @@ class RerankerTask extends Task15 {
|
|
|
5771
5898
|
var reranker = (input, config) => {
|
|
5772
5899
|
return new RerankerTask(config).run(input);
|
|
5773
5900
|
};
|
|
5774
|
-
|
|
5901
|
+
Workflow34.prototype.reranker = CreateWorkflow34(RerankerTask);
|
|
5775
5902
|
|
|
5776
5903
|
// src/task/StructuralParserTask.ts
|
|
5777
5904
|
import { StructuralParser } from "@workglow/knowledge-base";
|
|
5778
|
-
import { CreateWorkflow as
|
|
5905
|
+
import { CreateWorkflow as CreateWorkflow35, Task as Task17, Workflow as Workflow35 } from "@workglow/task-graph";
|
|
5779
5906
|
import { uuid4 as uuid42 } from "@workglow/util";
|
|
5780
|
-
var
|
|
5907
|
+
var inputSchema14 = {
|
|
5781
5908
|
type: "object",
|
|
5782
5909
|
properties: {
|
|
5783
5910
|
text: {
|
|
@@ -5811,7 +5938,7 @@ var inputSchema13 = {
|
|
|
5811
5938
|
required: ["text", "title"],
|
|
5812
5939
|
additionalProperties: false
|
|
5813
5940
|
};
|
|
5814
|
-
var
|
|
5941
|
+
var outputSchema14 = {
|
|
5815
5942
|
type: "object",
|
|
5816
5943
|
properties: {
|
|
5817
5944
|
doc_id: {
|
|
@@ -5820,8 +5947,10 @@ var outputSchema13 = {
|
|
|
5820
5947
|
description: "Generated or provided document ID"
|
|
5821
5948
|
},
|
|
5822
5949
|
documentTree: {
|
|
5950
|
+
type: "object",
|
|
5823
5951
|
title: "Document Tree",
|
|
5824
|
-
description: "Parsed hierarchical document tree"
|
|
5952
|
+
description: "Parsed hierarchical document tree",
|
|
5953
|
+
additionalProperties: true
|
|
5825
5954
|
},
|
|
5826
5955
|
nodeCount: {
|
|
5827
5956
|
type: "number",
|
|
@@ -5833,21 +5962,21 @@ var outputSchema13 = {
|
|
|
5833
5962
|
additionalProperties: false
|
|
5834
5963
|
};
|
|
5835
5964
|
|
|
5836
|
-
class StructuralParserTask extends
|
|
5965
|
+
class StructuralParserTask extends Task17 {
|
|
5837
5966
|
static type = "StructuralParserTask";
|
|
5838
5967
|
static category = "Document";
|
|
5839
5968
|
static title = "Structural Parser";
|
|
5840
5969
|
static description = "Parse documents into hierarchical tree structure";
|
|
5841
5970
|
static cacheable = true;
|
|
5842
5971
|
static inputSchema() {
|
|
5843
|
-
return
|
|
5972
|
+
return inputSchema14;
|
|
5844
5973
|
}
|
|
5845
5974
|
static outputSchema() {
|
|
5846
|
-
return
|
|
5975
|
+
return outputSchema14;
|
|
5847
5976
|
}
|
|
5848
5977
|
async execute(input, context) {
|
|
5849
5978
|
const { text, title, format = "auto", sourceUri, doc_id: providedDocId } = input;
|
|
5850
|
-
const doc_id = providedDocId || uuid42();
|
|
5979
|
+
const doc_id = providedDocId || sourceUri || uuid42();
|
|
5851
5980
|
let documentTree;
|
|
5852
5981
|
if (format === "markdown") {
|
|
5853
5982
|
documentTree = await StructuralParser.parseMarkdown(doc_id, text, title);
|
|
@@ -5876,10 +6005,10 @@ class StructuralParserTask extends Task16 {
|
|
|
5876
6005
|
var structuralParser = (input, config) => {
|
|
5877
6006
|
return new StructuralParserTask(config).run(input);
|
|
5878
6007
|
};
|
|
5879
|
-
|
|
6008
|
+
Workflow35.prototype.structuralParser = CreateWorkflow35(StructuralParserTask);
|
|
5880
6009
|
|
|
5881
6010
|
// src/task/StructuredGenerationTask.ts
|
|
5882
|
-
import { CreateWorkflow as
|
|
6011
|
+
import { CreateWorkflow as CreateWorkflow36, Workflow as Workflow36 } from "@workglow/task-graph";
|
|
5883
6012
|
var modelSchema23 = TypeModel("model:StructuredGenerationTask");
|
|
5884
6013
|
var StructuredGenerationInputSchema = {
|
|
5885
6014
|
type: "object",
|
|
@@ -5947,17 +6076,17 @@ class StructuredGenerationTask extends StreamingAiTask {
|
|
|
5947
6076
|
var structuredGeneration = (input, config) => {
|
|
5948
6077
|
return new StructuredGenerationTask(config).run(input);
|
|
5949
6078
|
};
|
|
5950
|
-
|
|
6079
|
+
Workflow36.prototype.structuredGeneration = CreateWorkflow36(StructuredGenerationTask);
|
|
5951
6080
|
|
|
5952
6081
|
// src/task/TextChunkerTask.ts
|
|
5953
|
-
import { CreateWorkflow as
|
|
6082
|
+
import { CreateWorkflow as CreateWorkflow37, Task as Task18, Workflow as Workflow37 } from "@workglow/task-graph";
|
|
5954
6083
|
var ChunkingStrategy = {
|
|
5955
6084
|
FIXED: "fixed",
|
|
5956
6085
|
SENTENCE: "sentence",
|
|
5957
6086
|
PARAGRAPH: "paragraph",
|
|
5958
6087
|
SEMANTIC: "semantic"
|
|
5959
6088
|
};
|
|
5960
|
-
var
|
|
6089
|
+
var inputSchema15 = {
|
|
5961
6090
|
type: "object",
|
|
5962
6091
|
properties: {
|
|
5963
6092
|
text: {
|
|
@@ -5990,7 +6119,7 @@ var inputSchema14 = {
|
|
|
5990
6119
|
required: ["text"],
|
|
5991
6120
|
additionalProperties: false
|
|
5992
6121
|
};
|
|
5993
|
-
var
|
|
6122
|
+
var outputSchema15 = {
|
|
5994
6123
|
type: "object",
|
|
5995
6124
|
properties: {
|
|
5996
6125
|
chunks: {
|
|
@@ -6019,17 +6148,17 @@ var outputSchema14 = {
|
|
|
6019
6148
|
additionalProperties: false
|
|
6020
6149
|
};
|
|
6021
6150
|
|
|
6022
|
-
class TextChunkerTask extends
|
|
6151
|
+
class TextChunkerTask extends Task18 {
|
|
6023
6152
|
static type = "TextChunkerTask";
|
|
6024
6153
|
static category = "Document";
|
|
6025
6154
|
static title = "Text Chunker";
|
|
6026
6155
|
static description = "Splits text into chunks using various strategies (fixed, sentence, paragraph)";
|
|
6027
6156
|
static cacheable = true;
|
|
6028
6157
|
static inputSchema() {
|
|
6029
|
-
return
|
|
6158
|
+
return inputSchema15;
|
|
6030
6159
|
}
|
|
6031
6160
|
static outputSchema() {
|
|
6032
|
-
return
|
|
6161
|
+
return outputSchema15;
|
|
6033
6162
|
}
|
|
6034
6163
|
async execute(input, context) {
|
|
6035
6164
|
const { text, chunkSize = 512, chunkOverlap = 50, strategy = ChunkingStrategy.FIXED } = input;
|
|
@@ -6199,10 +6328,10 @@ class TextChunkerTask extends Task17 {
|
|
|
6199
6328
|
var textChunker = (input, config) => {
|
|
6200
6329
|
return new TextChunkerTask(config).run(input);
|
|
6201
6330
|
};
|
|
6202
|
-
|
|
6331
|
+
Workflow37.prototype.textChunker = CreateWorkflow37(TextChunkerTask);
|
|
6203
6332
|
|
|
6204
6333
|
// src/task/TextFillMaskTask.ts
|
|
6205
|
-
import { CreateWorkflow as
|
|
6334
|
+
import { CreateWorkflow as CreateWorkflow38, Workflow as Workflow38 } from "@workglow/task-graph";
|
|
6206
6335
|
var modelSchema24 = TypeModel("model:TextFillMaskTask");
|
|
6207
6336
|
var TextFillMaskInputSchema = {
|
|
6208
6337
|
type: "object",
|
|
@@ -6267,10 +6396,10 @@ class TextFillMaskTask extends AiTask {
|
|
|
6267
6396
|
var textFillMask = (input, config) => {
|
|
6268
6397
|
return new TextFillMaskTask(config).run(input);
|
|
6269
6398
|
};
|
|
6270
|
-
|
|
6399
|
+
Workflow38.prototype.textFillMask = CreateWorkflow38(TextFillMaskTask);
|
|
6271
6400
|
|
|
6272
6401
|
// src/task/TextGenerationTask.ts
|
|
6273
|
-
import { CreateWorkflow as
|
|
6402
|
+
import { CreateWorkflow as CreateWorkflow39, Workflow as Workflow39 } from "@workglow/task-graph";
|
|
6274
6403
|
var generatedTextSchema2 = {
|
|
6275
6404
|
type: "string",
|
|
6276
6405
|
title: "Text",
|
|
@@ -6355,10 +6484,10 @@ class TextGenerationTask extends StreamingAiTask {
|
|
|
6355
6484
|
var textGeneration = (input, config) => {
|
|
6356
6485
|
return new TextGenerationTask(config).run(input);
|
|
6357
6486
|
};
|
|
6358
|
-
|
|
6487
|
+
Workflow39.prototype.textGeneration = CreateWorkflow39(TextGenerationTask);
|
|
6359
6488
|
|
|
6360
6489
|
// src/task/TextLanguageDetectionTask.ts
|
|
6361
|
-
import { CreateWorkflow as
|
|
6490
|
+
import { CreateWorkflow as CreateWorkflow40, Workflow as Workflow40 } from "@workglow/task-graph";
|
|
6362
6491
|
var modelSchema26 = TypeModel("model:TextLanguageDetectionTask");
|
|
6363
6492
|
var TextLanguageDetectionInputSchema = {
|
|
6364
6493
|
type: "object",
|
|
@@ -6426,10 +6555,10 @@ class TextLanguageDetectionTask extends AiTask {
|
|
|
6426
6555
|
var textLanguageDetection = (input, config) => {
|
|
6427
6556
|
return new TextLanguageDetectionTask(config).run(input);
|
|
6428
6557
|
};
|
|
6429
|
-
|
|
6558
|
+
Workflow40.prototype.textLanguageDetection = CreateWorkflow40(TextLanguageDetectionTask);
|
|
6430
6559
|
|
|
6431
6560
|
// src/task/TextQuestionAnswerTask.ts
|
|
6432
|
-
import { CreateWorkflow as
|
|
6561
|
+
import { CreateWorkflow as CreateWorkflow41, Workflow as Workflow41 } from "@workglow/task-graph";
|
|
6433
6562
|
var contextSchema = {
|
|
6434
6563
|
type: "string",
|
|
6435
6564
|
title: "Context",
|
|
@@ -6481,10 +6610,10 @@ class TextQuestionAnswerTask extends StreamingAiTask {
|
|
|
6481
6610
|
var textQuestionAnswer = (input, config) => {
|
|
6482
6611
|
return new TextQuestionAnswerTask(config).run(input);
|
|
6483
6612
|
};
|
|
6484
|
-
|
|
6613
|
+
Workflow41.prototype.textQuestionAnswer = CreateWorkflow41(TextQuestionAnswerTask);
|
|
6485
6614
|
|
|
6486
6615
|
// src/task/TextRewriterTask.ts
|
|
6487
|
-
import { CreateWorkflow as
|
|
6616
|
+
import { CreateWorkflow as CreateWorkflow42, Workflow as Workflow42 } from "@workglow/task-graph";
|
|
6488
6617
|
var modelSchema28 = TypeModel("model:TextRewriterTask");
|
|
6489
6618
|
var TextRewriterInputSchema = {
|
|
6490
6619
|
type: "object",
|
|
@@ -6533,10 +6662,10 @@ class TextRewriterTask extends StreamingAiTask {
|
|
|
6533
6662
|
var textRewriter = (input, config) => {
|
|
6534
6663
|
return new TextRewriterTask(config).run(input);
|
|
6535
6664
|
};
|
|
6536
|
-
|
|
6665
|
+
Workflow42.prototype.textRewriter = CreateWorkflow42(TextRewriterTask);
|
|
6537
6666
|
|
|
6538
6667
|
// src/task/TextTranslationTask.ts
|
|
6539
|
-
import { CreateWorkflow as
|
|
6668
|
+
import { CreateWorkflow as CreateWorkflow43, Workflow as Workflow43 } from "@workglow/task-graph";
|
|
6540
6669
|
var modelSchema29 = TypeModel("model:TextTranslationTask");
|
|
6541
6670
|
var translationTextSchema = {
|
|
6542
6671
|
type: "string",
|
|
@@ -6599,16 +6728,16 @@ class TextTranslationTask extends StreamingAiTask {
|
|
|
6599
6728
|
var textTranslation = (input, config) => {
|
|
6600
6729
|
return new TextTranslationTask(config).run(input);
|
|
6601
6730
|
};
|
|
6602
|
-
|
|
6731
|
+
Workflow43.prototype.textTranslation = CreateWorkflow43(TextTranslationTask);
|
|
6603
6732
|
|
|
6604
6733
|
// src/task/TopicSegmenterTask.ts
|
|
6605
|
-
import { CreateWorkflow as
|
|
6734
|
+
import { CreateWorkflow as CreateWorkflow44, Task as Task19, Workflow as Workflow44 } from "@workglow/task-graph";
|
|
6606
6735
|
var SegmentationMethod = {
|
|
6607
6736
|
HEURISTIC: "heuristic",
|
|
6608
6737
|
EMBEDDING_SIMILARITY: "embedding-similarity",
|
|
6609
6738
|
HYBRID: "hybrid"
|
|
6610
6739
|
};
|
|
6611
|
-
var
|
|
6740
|
+
var inputSchema16 = {
|
|
6612
6741
|
type: "object",
|
|
6613
6742
|
properties: {
|
|
6614
6743
|
text: {
|
|
@@ -6649,7 +6778,7 @@ var inputSchema15 = {
|
|
|
6649
6778
|
required: ["text"],
|
|
6650
6779
|
additionalProperties: false
|
|
6651
6780
|
};
|
|
6652
|
-
var
|
|
6781
|
+
var outputSchema16 = {
|
|
6653
6782
|
type: "object",
|
|
6654
6783
|
properties: {
|
|
6655
6784
|
segments: {
|
|
@@ -6677,7 +6806,7 @@ var outputSchema15 = {
|
|
|
6677
6806
|
additionalProperties: false
|
|
6678
6807
|
};
|
|
6679
6808
|
|
|
6680
|
-
class TopicSegmenterTask extends
|
|
6809
|
+
class TopicSegmenterTask extends Task19 {
|
|
6681
6810
|
static type = "TopicSegmenterTask";
|
|
6682
6811
|
static category = "Document";
|
|
6683
6812
|
static title = "Topic Segmenter";
|
|
@@ -6685,10 +6814,10 @@ class TopicSegmenterTask extends Task18 {
|
|
|
6685
6814
|
static cacheable = true;
|
|
6686
6815
|
static EMBEDDING_DIMENSIONS = 256;
|
|
6687
6816
|
static inputSchema() {
|
|
6688
|
-
return
|
|
6817
|
+
return inputSchema16;
|
|
6689
6818
|
}
|
|
6690
6819
|
static outputSchema() {
|
|
6691
|
-
return
|
|
6820
|
+
return outputSchema16;
|
|
6692
6821
|
}
|
|
6693
6822
|
async execute(input, context) {
|
|
6694
6823
|
const {
|
|
@@ -6882,10 +7011,10 @@ class TopicSegmenterTask extends Task18 {
|
|
|
6882
7011
|
var topicSegmenter = (input, config) => {
|
|
6883
7012
|
return new TopicSegmenterTask(config).run(input);
|
|
6884
7013
|
};
|
|
6885
|
-
|
|
7014
|
+
Workflow44.prototype.topicSegmenter = CreateWorkflow44(TopicSegmenterTask);
|
|
6886
7015
|
|
|
6887
7016
|
// src/task/UnloadModelTask.ts
|
|
6888
|
-
import { CreateWorkflow as
|
|
7017
|
+
import { CreateWorkflow as CreateWorkflow45, Workflow as Workflow45 } from "@workglow/task-graph";
|
|
6889
7018
|
var modelSchema30 = TypeModel("model");
|
|
6890
7019
|
var UnloadModelInputSchema = {
|
|
6891
7020
|
type: "object",
|
|
@@ -6920,16 +7049,16 @@ class UnloadModelTask extends AiTask {
|
|
|
6920
7049
|
var unloadModel = (input, config) => {
|
|
6921
7050
|
return new UnloadModelTask(config).run(input);
|
|
6922
7051
|
};
|
|
6923
|
-
|
|
7052
|
+
Workflow45.prototype.unloadModel = CreateWorkflow45(UnloadModelTask);
|
|
6924
7053
|
|
|
6925
7054
|
// src/task/VectorQuantizeTask.ts
|
|
6926
|
-
import { CreateWorkflow as
|
|
7055
|
+
import { CreateWorkflow as CreateWorkflow46, Task as Task20, Workflow as Workflow46 } from "@workglow/task-graph";
|
|
6927
7056
|
import {
|
|
6928
7057
|
normalizeNumberArray,
|
|
6929
7058
|
TensorType,
|
|
6930
7059
|
TypedArraySchema as TypedArraySchema8
|
|
6931
7060
|
} from "@workglow/util/schema";
|
|
6932
|
-
var
|
|
7061
|
+
var inputSchema17 = {
|
|
6933
7062
|
type: "object",
|
|
6934
7063
|
properties: {
|
|
6935
7064
|
vector: {
|
|
@@ -6966,7 +7095,7 @@ var inputSchema16 = {
|
|
|
6966
7095
|
required: ["vector", "targetType"],
|
|
6967
7096
|
additionalProperties: false
|
|
6968
7097
|
};
|
|
6969
|
-
var
|
|
7098
|
+
var outputSchema17 = {
|
|
6970
7099
|
type: "object",
|
|
6971
7100
|
properties: {
|
|
6972
7101
|
vector: {
|
|
@@ -7003,17 +7132,17 @@ var outputSchema16 = {
|
|
|
7003
7132
|
additionalProperties: false
|
|
7004
7133
|
};
|
|
7005
7134
|
|
|
7006
|
-
class VectorQuantizeTask extends
|
|
7135
|
+
class VectorQuantizeTask extends Task20 {
|
|
7007
7136
|
static type = "VectorQuantizeTask";
|
|
7008
7137
|
static category = "Vector";
|
|
7009
7138
|
static title = "Quantize";
|
|
7010
7139
|
static description = "Quantize vectors to reduce storage and improve performance";
|
|
7011
7140
|
static cacheable = true;
|
|
7012
7141
|
static inputSchema() {
|
|
7013
|
-
return
|
|
7142
|
+
return inputSchema17;
|
|
7014
7143
|
}
|
|
7015
7144
|
static outputSchema() {
|
|
7016
|
-
return
|
|
7145
|
+
return outputSchema17;
|
|
7017
7146
|
}
|
|
7018
7147
|
async executeReactive(input) {
|
|
7019
7148
|
const { vector, targetType, normalize = true } = input;
|
|
@@ -7103,10 +7232,10 @@ class VectorQuantizeTask extends Task19 {
|
|
|
7103
7232
|
var vectorQuantize = (input, config) => {
|
|
7104
7233
|
return new VectorQuantizeTask(config).run(input);
|
|
7105
7234
|
};
|
|
7106
|
-
|
|
7235
|
+
Workflow46.prototype.vectorQuantize = CreateWorkflow46(VectorQuantizeTask);
|
|
7107
7236
|
|
|
7108
7237
|
// src/task/VectorSimilarityTask.ts
|
|
7109
|
-
import { CreateWorkflow as
|
|
7238
|
+
import { CreateWorkflow as CreateWorkflow47, GraphAsTask, Workflow as Workflow47 } from "@workglow/task-graph";
|
|
7110
7239
|
import {
|
|
7111
7240
|
cosineSimilarity,
|
|
7112
7241
|
hammingSimilarity,
|
|
@@ -7212,7 +7341,7 @@ class VectorSimilarityTask extends GraphAsTask {
|
|
|
7212
7341
|
var similarity = (input, config) => {
|
|
7213
7342
|
return new VectorSimilarityTask(config).run(input);
|
|
7214
7343
|
};
|
|
7215
|
-
|
|
7344
|
+
Workflow47.prototype.similarity = CreateWorkflow47(VectorSimilarityTask);
|
|
7216
7345
|
// src/task/MessageConversion.ts
|
|
7217
7346
|
function getInputMessages(input) {
|
|
7218
7347
|
const messages = input.messages;
|
|
@@ -7431,6 +7560,7 @@ var registerAiTasks = () => {
|
|
|
7431
7560
|
HandLandmarkerTask,
|
|
7432
7561
|
HierarchicalChunkerTask,
|
|
7433
7562
|
HierarchyJoinTask,
|
|
7563
|
+
KbToDocumentsTask,
|
|
7434
7564
|
ImageClassificationTask,
|
|
7435
7565
|
ImageEmbeddingTask,
|
|
7436
7566
|
ImageSegmentationTask,
|
|
@@ -7499,6 +7629,7 @@ export {
|
|
|
7499
7629
|
objectDetection,
|
|
7500
7630
|
modelSearch,
|
|
7501
7631
|
modelInfo,
|
|
7632
|
+
kbToDocuments,
|
|
7502
7633
|
isAllowedToolName,
|
|
7503
7634
|
imageToText,
|
|
7504
7635
|
imageSegmentation,
|
|
@@ -7609,6 +7740,7 @@ export {
|
|
|
7609
7740
|
ModelInfoTask,
|
|
7610
7741
|
ModelConfigSchema,
|
|
7611
7742
|
MODEL_REPOSITORY,
|
|
7743
|
+
KbToDocumentsTask,
|
|
7612
7744
|
InMemoryModelRepository,
|
|
7613
7745
|
ImageToTextTask,
|
|
7614
7746
|
ImageToTextOutputSchema,
|
|
@@ -7640,6 +7772,7 @@ export {
|
|
|
7640
7772
|
DocumentUpsertTask,
|
|
7641
7773
|
DocumentEnricherTask,
|
|
7642
7774
|
DirectExecutionStrategy,
|
|
7775
|
+
DEFAULT_AI_PROVIDER_WORKER_IDLE_TIMEOUT_MS,
|
|
7643
7776
|
CountTokensTask,
|
|
7644
7777
|
CountTokensOutputSchema,
|
|
7645
7778
|
CountTokensInputSchema,
|
|
@@ -7663,4 +7796,4 @@ export {
|
|
|
7663
7796
|
AgentInputSchema
|
|
7664
7797
|
};
|
|
7665
7798
|
|
|
7666
|
-
//# debugId=
|
|
7799
|
+
//# debugId=E5D2CAC1AFB89B5564756E2164756E21
|