@workglow/ai 0.0.108 → 0.0.110
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 +181 -118
- package/dist/browser.js.map +23 -22
- package/dist/bun.js +181 -118
- package/dist/bun.js.map +23 -22
- package/dist/node.js +181 -118
- package/dist/node.js.map +23 -22
- package/dist/provider/AiProvider.d.ts +4 -0
- package/dist/provider/AiProvider.d.ts.map +1 -1
- package/dist/task/CountTokensTask.d.ts +25 -7
- package/dist/task/CountTokensTask.d.ts.map +1 -1
- package/dist/task/DocumentEnricherTask.d.ts.map +1 -1
- package/dist/task/ModelInfoTask.d.ts +211 -0
- package/dist/task/ModelInfoTask.d.ts.map +1 -0
- package/dist/task/RerankerTask.d.ts.map +1 -1
- package/dist/task/TextClassificationTask.d.ts +59 -21
- package/dist/task/TextClassificationTask.d.ts.map +1 -1
- package/dist/task/TextFillMaskTask.d.ts +70 -26
- package/dist/task/TextFillMaskTask.d.ts.map +1 -1
- package/dist/task/TextGenerationTask.d.ts +27 -8
- package/dist/task/TextGenerationTask.d.ts.map +1 -1
- package/dist/task/TextLanguageDetectionTask.d.ts +59 -21
- package/dist/task/TextLanguageDetectionTask.d.ts.map +1 -1
- package/dist/task/TextNamedEntityRecognitionTask.d.ts +70 -26
- package/dist/task/TextNamedEntityRecognitionTask.d.ts.map +1 -1
- package/dist/task/TextQuestionAnswerTask.d.ts +39 -11
- package/dist/task/TextQuestionAnswerTask.d.ts.map +1 -1
- package/dist/task/TextRewriterTask.d.ts +27 -8
- package/dist/task/TextRewriterTask.d.ts.map +1 -1
- package/dist/task/TextSummaryTask.d.ts +27 -8
- package/dist/task/TextSummaryTask.d.ts.map +1 -1
- package/dist/task/TextTranslationTask.d.ts +27 -8
- package/dist/task/TextTranslationTask.d.ts.map +1 -1
- package/dist/task/ToolCallingTask.d.ts +45 -13
- package/dist/task/ToolCallingTask.d.ts.map +1 -1
- package/dist/task/base/AiTask.d.ts.map +1 -1
- package/dist/task/index.d.ts +3 -1
- package/dist/task/index.d.ts.map +1 -1
- package/package.json +17 -16
package/dist/bun.js
CHANGED
|
@@ -322,7 +322,7 @@ async function createDefaultQueue(providerName, concurrency) {
|
|
|
322
322
|
const server = new JobQueueServer(AiJob, {
|
|
323
323
|
storage,
|
|
324
324
|
queueName: providerName,
|
|
325
|
-
limiter: new ConcurrencyLimiter(concurrency
|
|
325
|
+
limiter: new ConcurrencyLimiter(concurrency)
|
|
326
326
|
});
|
|
327
327
|
const client = new JobQueueClient({
|
|
328
328
|
storage,
|
|
@@ -601,6 +601,7 @@ class AiTask extends JobQueueTask {
|
|
|
601
601
|
const modelLabel = typeof input.model === "string" ? input.model : typeof input.model === "object" && input.model ? input.model.model_id || input.model.title || input.model.provider : undefined;
|
|
602
602
|
config.title ||= `${new.target.type || new.target.name}${modelLabel ? " with model " + modelLabel : ""}`;
|
|
603
603
|
super(input, config);
|
|
604
|
+
this.jobClass = AiJob;
|
|
604
605
|
}
|
|
605
606
|
async getJobInput(input) {
|
|
606
607
|
const model = input.model;
|
|
@@ -1581,11 +1582,11 @@ var modelSchema3 = TypeModel("model");
|
|
|
1581
1582
|
var CountTokensInputSchema = {
|
|
1582
1583
|
type: "object",
|
|
1583
1584
|
properties: {
|
|
1584
|
-
text: {
|
|
1585
|
+
text: TypeSingleOrArray({
|
|
1585
1586
|
type: "string",
|
|
1586
1587
|
title: "Text",
|
|
1587
1588
|
description: "The text to count tokens for"
|
|
1588
|
-
},
|
|
1589
|
+
}),
|
|
1589
1590
|
model: modelSchema3
|
|
1590
1591
|
},
|
|
1591
1592
|
required: ["text", "model"],
|
|
@@ -1594,11 +1595,11 @@ var CountTokensInputSchema = {
|
|
|
1594
1595
|
var CountTokensOutputSchema = {
|
|
1595
1596
|
type: "object",
|
|
1596
1597
|
properties: {
|
|
1597
|
-
count: {
|
|
1598
|
+
count: TypeSingleOrArray({
|
|
1598
1599
|
type: "number",
|
|
1599
1600
|
title: "Token Count",
|
|
1600
1601
|
description: "The number of tokens in the text"
|
|
1601
|
-
}
|
|
1602
|
+
})
|
|
1602
1603
|
},
|
|
1603
1604
|
required: ["count"],
|
|
1604
1605
|
additionalProperties: false
|
|
@@ -1939,11 +1940,11 @@ var modelSchema5 = TypeModel("model:TextNamedEntityRecognitionTask");
|
|
|
1939
1940
|
var TextNamedEntityRecognitionInputSchema = {
|
|
1940
1941
|
type: "object",
|
|
1941
1942
|
properties: {
|
|
1942
|
-
text: {
|
|
1943
|
+
text: TypeSingleOrArray({
|
|
1943
1944
|
type: "string",
|
|
1944
1945
|
title: "Text",
|
|
1945
1946
|
description: "The text to extract named entities from"
|
|
1946
|
-
},
|
|
1947
|
+
}),
|
|
1947
1948
|
blockList: {
|
|
1948
1949
|
type: "array",
|
|
1949
1950
|
items: {
|
|
@@ -1962,7 +1963,7 @@ var TextNamedEntityRecognitionInputSchema = {
|
|
|
1962
1963
|
var TextNamedEntityRecognitionOutputSchema = {
|
|
1963
1964
|
type: "object",
|
|
1964
1965
|
properties: {
|
|
1965
|
-
entities: {
|
|
1966
|
+
entities: TypeSingleOrArray({
|
|
1966
1967
|
type: "array",
|
|
1967
1968
|
items: {
|
|
1968
1969
|
type: "object",
|
|
@@ -1988,7 +1989,7 @@ var TextNamedEntityRecognitionOutputSchema = {
|
|
|
1988
1989
|
},
|
|
1989
1990
|
title: "Entities",
|
|
1990
1991
|
description: "The extracted named entities with their types, scores, and text"
|
|
1991
|
-
}
|
|
1992
|
+
})
|
|
1992
1993
|
},
|
|
1993
1994
|
required: ["entities"],
|
|
1994
1995
|
additionalProperties: false
|
|
@@ -2050,11 +2051,11 @@ var modelSchema6 = TypeModel("model:TextSummaryTask");
|
|
|
2050
2051
|
var TextSummaryInputSchema = {
|
|
2051
2052
|
type: "object",
|
|
2052
2053
|
properties: {
|
|
2053
|
-
text: {
|
|
2054
|
+
text: TypeSingleOrArray({
|
|
2054
2055
|
type: "string",
|
|
2055
2056
|
title: "Text",
|
|
2056
2057
|
description: "The text to summarize"
|
|
2057
|
-
},
|
|
2058
|
+
}),
|
|
2058
2059
|
model: modelSchema6
|
|
2059
2060
|
},
|
|
2060
2061
|
required: ["text", "model"],
|
|
@@ -2063,12 +2064,12 @@ var TextSummaryInputSchema = {
|
|
|
2063
2064
|
var TextSummaryOutputSchema = {
|
|
2064
2065
|
type: "object",
|
|
2065
2066
|
properties: {
|
|
2066
|
-
text: {
|
|
2067
|
+
text: TypeSingleOrArray({
|
|
2067
2068
|
type: "string",
|
|
2068
2069
|
title: "Text",
|
|
2069
2070
|
description: "The summarized text",
|
|
2070
2071
|
"x-stream": "append"
|
|
2071
|
-
}
|
|
2072
|
+
})
|
|
2072
2073
|
},
|
|
2073
2074
|
required: ["text"],
|
|
2074
2075
|
additionalProperties: false
|
|
@@ -3657,9 +3658,68 @@ var imageToText = (input, config) => {
|
|
|
3657
3658
|
};
|
|
3658
3659
|
Workflow23.prototype.imageToText = CreateWorkflow23(ImageToTextTask);
|
|
3659
3660
|
|
|
3660
|
-
// src/task/
|
|
3661
|
+
// src/task/ModelInfoTask.ts
|
|
3661
3662
|
import { CreateWorkflow as CreateWorkflow24, Workflow as Workflow24 } from "@workglow/task-graph";
|
|
3662
|
-
var modelSchema17 = TypeModel("model
|
|
3663
|
+
var modelSchema17 = TypeModel("model");
|
|
3664
|
+
var ModelInfoInputSchema = {
|
|
3665
|
+
type: "object",
|
|
3666
|
+
properties: {
|
|
3667
|
+
model: modelSchema17,
|
|
3668
|
+
detail: {
|
|
3669
|
+
type: "string",
|
|
3670
|
+
enum: ["cached_status", "files", "files_with_metadata"],
|
|
3671
|
+
default: "files_with_metadata"
|
|
3672
|
+
}
|
|
3673
|
+
},
|
|
3674
|
+
required: ["model"],
|
|
3675
|
+
additionalProperties: false
|
|
3676
|
+
};
|
|
3677
|
+
var ModelInfoOutputSchema = {
|
|
3678
|
+
type: "object",
|
|
3679
|
+
properties: {
|
|
3680
|
+
model: modelSchema17,
|
|
3681
|
+
is_local: { type: "boolean" },
|
|
3682
|
+
is_remote: { type: "boolean" },
|
|
3683
|
+
supports_browser: { type: "boolean" },
|
|
3684
|
+
supports_node: { type: "boolean" },
|
|
3685
|
+
is_cached: { type: "boolean" },
|
|
3686
|
+
is_loaded: { type: "boolean" },
|
|
3687
|
+
file_sizes: {}
|
|
3688
|
+
},
|
|
3689
|
+
required: [
|
|
3690
|
+
"model",
|
|
3691
|
+
"is_local",
|
|
3692
|
+
"is_remote",
|
|
3693
|
+
"supports_browser",
|
|
3694
|
+
"supports_node",
|
|
3695
|
+
"is_cached",
|
|
3696
|
+
"is_loaded",
|
|
3697
|
+
"file_sizes"
|
|
3698
|
+
],
|
|
3699
|
+
additionalProperties: false
|
|
3700
|
+
};
|
|
3701
|
+
|
|
3702
|
+
class ModelInfoTask extends AiTask {
|
|
3703
|
+
static type = "ModelInfoTask";
|
|
3704
|
+
static category = "Hidden";
|
|
3705
|
+
static title = "Model Info";
|
|
3706
|
+
static description = "Returns runtime information about a model including locality, cache status, and file sizes";
|
|
3707
|
+
static inputSchema() {
|
|
3708
|
+
return ModelInfoInputSchema;
|
|
3709
|
+
}
|
|
3710
|
+
static outputSchema() {
|
|
3711
|
+
return ModelInfoOutputSchema;
|
|
3712
|
+
}
|
|
3713
|
+
static cacheable = false;
|
|
3714
|
+
}
|
|
3715
|
+
var modelInfo = (input, config) => {
|
|
3716
|
+
return new ModelInfoTask({}, config).run(input);
|
|
3717
|
+
};
|
|
3718
|
+
Workflow24.prototype.modelInfo = CreateWorkflow24(ModelInfoTask);
|
|
3719
|
+
|
|
3720
|
+
// src/task/ObjectDetectionTask.ts
|
|
3721
|
+
import { CreateWorkflow as CreateWorkflow25, Workflow as Workflow25 } from "@workglow/task-graph";
|
|
3722
|
+
var modelSchema18 = TypeModel("model:ObjectDetectionTask");
|
|
3663
3723
|
var detectionSchema = {
|
|
3664
3724
|
type: "object",
|
|
3665
3725
|
properties: {
|
|
@@ -3684,7 +3744,7 @@ var ObjectDetectionInputSchema = {
|
|
|
3684
3744
|
type: "object",
|
|
3685
3745
|
properties: {
|
|
3686
3746
|
image: TypeImageInput,
|
|
3687
|
-
model:
|
|
3747
|
+
model: modelSchema18,
|
|
3688
3748
|
labels: {
|
|
3689
3749
|
type: "array",
|
|
3690
3750
|
items: {
|
|
@@ -3738,11 +3798,11 @@ class ObjectDetectionTask extends AiVisionTask {
|
|
|
3738
3798
|
var objectDetection = (input, config) => {
|
|
3739
3799
|
return new ObjectDetectionTask({}, config).run(input);
|
|
3740
3800
|
};
|
|
3741
|
-
|
|
3801
|
+
Workflow25.prototype.objectDetection = CreateWorkflow25(ObjectDetectionTask);
|
|
3742
3802
|
|
|
3743
3803
|
// src/task/PoseLandmarkerTask.ts
|
|
3744
|
-
import { CreateWorkflow as
|
|
3745
|
-
var
|
|
3804
|
+
import { CreateWorkflow as CreateWorkflow26, Workflow as Workflow26 } from "@workglow/task-graph";
|
|
3805
|
+
var modelSchema19 = TypeModel("model:PoseLandmarkerTask");
|
|
3746
3806
|
var TypePoseLandmark = {
|
|
3747
3807
|
type: "object",
|
|
3748
3808
|
properties: {
|
|
@@ -3821,7 +3881,7 @@ var PoseLandmarkerInputSchema = {
|
|
|
3821
3881
|
type: "object",
|
|
3822
3882
|
properties: {
|
|
3823
3883
|
image: TypeImageInput,
|
|
3824
|
-
model:
|
|
3884
|
+
model: modelSchema19,
|
|
3825
3885
|
numPoses: {
|
|
3826
3886
|
type: "number",
|
|
3827
3887
|
minimum: 1,
|
|
@@ -3900,13 +3960,13 @@ class PoseLandmarkerTask extends AiVisionTask {
|
|
|
3900
3960
|
var poseLandmarker = (input, config) => {
|
|
3901
3961
|
return new PoseLandmarkerTask({}, config).run(input);
|
|
3902
3962
|
};
|
|
3903
|
-
|
|
3963
|
+
Workflow26.prototype.poseLandmarker = CreateWorkflow26(PoseLandmarkerTask);
|
|
3904
3964
|
|
|
3905
3965
|
// src/task/QueryExpanderTask.ts
|
|
3906
3966
|
import {
|
|
3907
|
-
CreateWorkflow as
|
|
3967
|
+
CreateWorkflow as CreateWorkflow27,
|
|
3908
3968
|
Task as Task10,
|
|
3909
|
-
Workflow as
|
|
3969
|
+
Workflow as Workflow27
|
|
3910
3970
|
} from "@workglow/task-graph";
|
|
3911
3971
|
var QueryExpansionMethod = {
|
|
3912
3972
|
MULTI_QUERY: "multi-query",
|
|
@@ -4117,26 +4177,26 @@ class QueryExpanderTask extends Task10 {
|
|
|
4117
4177
|
var queryExpander = (input, config) => {
|
|
4118
4178
|
return new QueryExpanderTask({}, config).run(input);
|
|
4119
4179
|
};
|
|
4120
|
-
|
|
4180
|
+
Workflow27.prototype.queryExpander = CreateWorkflow27(QueryExpanderTask);
|
|
4121
4181
|
|
|
4122
4182
|
// src/task/RerankerTask.ts
|
|
4123
4183
|
import {
|
|
4124
|
-
CreateWorkflow as
|
|
4184
|
+
CreateWorkflow as CreateWorkflow29,
|
|
4125
4185
|
Task as Task11,
|
|
4126
|
-
Workflow as
|
|
4186
|
+
Workflow as Workflow29
|
|
4127
4187
|
} from "@workglow/task-graph";
|
|
4128
4188
|
|
|
4129
4189
|
// src/task/TextClassificationTask.ts
|
|
4130
|
-
import { CreateWorkflow as
|
|
4131
|
-
var
|
|
4190
|
+
import { CreateWorkflow as CreateWorkflow28, Workflow as Workflow28 } from "@workglow/task-graph";
|
|
4191
|
+
var modelSchema20 = TypeModel("model:TextClassificationTask");
|
|
4132
4192
|
var TextClassificationInputSchema = {
|
|
4133
4193
|
type: "object",
|
|
4134
4194
|
properties: {
|
|
4135
|
-
text: {
|
|
4195
|
+
text: TypeSingleOrArray({
|
|
4136
4196
|
type: "string",
|
|
4137
4197
|
title: "Text",
|
|
4138
4198
|
description: "The text to classify"
|
|
4139
|
-
},
|
|
4199
|
+
}),
|
|
4140
4200
|
candidateLabels: {
|
|
4141
4201
|
type: "array",
|
|
4142
4202
|
items: {
|
|
@@ -4155,7 +4215,7 @@ var TextClassificationInputSchema = {
|
|
|
4155
4215
|
description: "The maximum number of categories to return",
|
|
4156
4216
|
"x-ui-group": "Configuration"
|
|
4157
4217
|
},
|
|
4158
|
-
model:
|
|
4218
|
+
model: modelSchema20
|
|
4159
4219
|
},
|
|
4160
4220
|
required: ["text", "model"],
|
|
4161
4221
|
additionalProperties: false
|
|
@@ -4163,7 +4223,7 @@ var TextClassificationInputSchema = {
|
|
|
4163
4223
|
var TextClassificationOutputSchema = {
|
|
4164
4224
|
type: "object",
|
|
4165
4225
|
properties: {
|
|
4166
|
-
categories: {
|
|
4226
|
+
categories: TypeSingleOrArray({
|
|
4167
4227
|
type: "array",
|
|
4168
4228
|
items: {
|
|
4169
4229
|
type: "object",
|
|
@@ -4184,7 +4244,7 @@ var TextClassificationOutputSchema = {
|
|
|
4184
4244
|
},
|
|
4185
4245
|
title: "Categories",
|
|
4186
4246
|
description: "The classification categories with their scores"
|
|
4187
|
-
}
|
|
4247
|
+
})
|
|
4188
4248
|
},
|
|
4189
4249
|
required: ["categories"],
|
|
4190
4250
|
additionalProperties: false
|
|
@@ -4205,7 +4265,7 @@ class TextClassificationTask extends AiTask {
|
|
|
4205
4265
|
var textClassification = (input, config) => {
|
|
4206
4266
|
return new TextClassificationTask({}, config).run(input);
|
|
4207
4267
|
};
|
|
4208
|
-
|
|
4268
|
+
Workflow28.prototype.textClassification = CreateWorkflow28(TextClassificationTask);
|
|
4209
4269
|
|
|
4210
4270
|
// src/task/RerankerTask.ts
|
|
4211
4271
|
var inputSchema11 = {
|
|
@@ -4429,14 +4489,14 @@ class RerankerTask extends Task11 {
|
|
|
4429
4489
|
var reranker = (input, config) => {
|
|
4430
4490
|
return new RerankerTask({}, config).run(input);
|
|
4431
4491
|
};
|
|
4432
|
-
|
|
4492
|
+
Workflow29.prototype.reranker = CreateWorkflow29(RerankerTask);
|
|
4433
4493
|
|
|
4434
4494
|
// src/task/StructuralParserTask.ts
|
|
4435
4495
|
import { StructuralParser } from "@workglow/dataset";
|
|
4436
4496
|
import {
|
|
4437
|
-
CreateWorkflow as
|
|
4497
|
+
CreateWorkflow as CreateWorkflow30,
|
|
4438
4498
|
Task as Task12,
|
|
4439
|
-
Workflow as
|
|
4499
|
+
Workflow as Workflow30
|
|
4440
4500
|
} from "@workglow/task-graph";
|
|
4441
4501
|
import { uuid4 as uuid42 } from "@workglow/util";
|
|
4442
4502
|
var inputSchema12 = {
|
|
@@ -4538,15 +4598,15 @@ class StructuralParserTask extends Task12 {
|
|
|
4538
4598
|
var structuralParser = (input, config) => {
|
|
4539
4599
|
return new StructuralParserTask({}, config).run(input);
|
|
4540
4600
|
};
|
|
4541
|
-
|
|
4601
|
+
Workflow30.prototype.structuralParser = CreateWorkflow30(StructuralParserTask);
|
|
4542
4602
|
|
|
4543
4603
|
// src/task/StructuredGenerationTask.ts
|
|
4544
|
-
import { CreateWorkflow as
|
|
4545
|
-
var
|
|
4604
|
+
import { CreateWorkflow as CreateWorkflow31, Workflow as Workflow31 } from "@workglow/task-graph";
|
|
4605
|
+
var modelSchema21 = TypeModel("model:StructuredGenerationTask");
|
|
4546
4606
|
var StructuredGenerationInputSchema = {
|
|
4547
4607
|
type: "object",
|
|
4548
4608
|
properties: {
|
|
4549
|
-
model:
|
|
4609
|
+
model: modelSchema21,
|
|
4550
4610
|
prompt: {
|
|
4551
4611
|
type: "string",
|
|
4552
4612
|
title: "Prompt",
|
|
@@ -4609,13 +4669,13 @@ class StructuredGenerationTask extends StreamingAiTask {
|
|
|
4609
4669
|
var structuredGeneration = (input, config) => {
|
|
4610
4670
|
return new StructuredGenerationTask({}, config).run(input);
|
|
4611
4671
|
};
|
|
4612
|
-
|
|
4672
|
+
Workflow31.prototype.structuredGeneration = CreateWorkflow31(StructuredGenerationTask);
|
|
4613
4673
|
|
|
4614
4674
|
// src/task/TextChunkerTask.ts
|
|
4615
4675
|
import {
|
|
4616
|
-
CreateWorkflow as
|
|
4676
|
+
CreateWorkflow as CreateWorkflow32,
|
|
4617
4677
|
Task as Task13,
|
|
4618
|
-
Workflow as
|
|
4678
|
+
Workflow as Workflow32
|
|
4619
4679
|
} from "@workglow/task-graph";
|
|
4620
4680
|
var ChunkingStrategy = {
|
|
4621
4681
|
FIXED: "fixed",
|
|
@@ -4865,20 +4925,20 @@ class TextChunkerTask extends Task13 {
|
|
|
4865
4925
|
var textChunker = (input, config) => {
|
|
4866
4926
|
return new TextChunkerTask({}, config).run(input);
|
|
4867
4927
|
};
|
|
4868
|
-
|
|
4928
|
+
Workflow32.prototype.textChunker = CreateWorkflow32(TextChunkerTask);
|
|
4869
4929
|
|
|
4870
4930
|
// src/task/TextFillMaskTask.ts
|
|
4871
|
-
import { CreateWorkflow as
|
|
4872
|
-
var
|
|
4931
|
+
import { CreateWorkflow as CreateWorkflow33, Workflow as Workflow33 } from "@workglow/task-graph";
|
|
4932
|
+
var modelSchema22 = TypeModel("model:TextFillMaskTask");
|
|
4873
4933
|
var TextFillMaskInputSchema = {
|
|
4874
4934
|
type: "object",
|
|
4875
4935
|
properties: {
|
|
4876
|
-
text: {
|
|
4936
|
+
text: TypeSingleOrArray({
|
|
4877
4937
|
type: "string",
|
|
4878
4938
|
title: "Text",
|
|
4879
4939
|
description: "The text with a mask token to fill"
|
|
4880
|
-
},
|
|
4881
|
-
model:
|
|
4940
|
+
}),
|
|
4941
|
+
model: modelSchema22
|
|
4882
4942
|
},
|
|
4883
4943
|
required: ["text", "model"],
|
|
4884
4944
|
additionalProperties: false
|
|
@@ -4886,7 +4946,7 @@ var TextFillMaskInputSchema = {
|
|
|
4886
4946
|
var TextFillMaskOutputSchema = {
|
|
4887
4947
|
type: "object",
|
|
4888
4948
|
properties: {
|
|
4889
|
-
predictions: {
|
|
4949
|
+
predictions: TypeSingleOrArray({
|
|
4890
4950
|
type: "array",
|
|
4891
4951
|
items: {
|
|
4892
4952
|
type: "object",
|
|
@@ -4912,7 +4972,7 @@ var TextFillMaskOutputSchema = {
|
|
|
4912
4972
|
},
|
|
4913
4973
|
title: "Predictions",
|
|
4914
4974
|
description: "The predicted tokens to fill the mask with their scores and complete sequences"
|
|
4915
|
-
}
|
|
4975
|
+
})
|
|
4916
4976
|
},
|
|
4917
4977
|
required: ["predictions"],
|
|
4918
4978
|
additionalProperties: false
|
|
@@ -4933,26 +4993,26 @@ class TextFillMaskTask extends AiTask {
|
|
|
4933
4993
|
var textFillMask = (input, config) => {
|
|
4934
4994
|
return new TextFillMaskTask({}, config).run(input);
|
|
4935
4995
|
};
|
|
4936
|
-
|
|
4996
|
+
Workflow33.prototype.textFillMask = CreateWorkflow33(TextFillMaskTask);
|
|
4937
4997
|
|
|
4938
4998
|
// src/task/TextGenerationTask.ts
|
|
4939
|
-
import { CreateWorkflow as
|
|
4940
|
-
var generatedTextSchema2 = {
|
|
4999
|
+
import { CreateWorkflow as CreateWorkflow34, Workflow as Workflow34 } from "@workglow/task-graph";
|
|
5000
|
+
var generatedTextSchema2 = TypeSingleOrArray({
|
|
4941
5001
|
type: "string",
|
|
4942
5002
|
title: "Text",
|
|
4943
5003
|
description: "The generated text",
|
|
4944
5004
|
"x-stream": "append"
|
|
4945
|
-
};
|
|
4946
|
-
var
|
|
5005
|
+
});
|
|
5006
|
+
var modelSchema23 = TypeModel("model:TextGenerationTask");
|
|
4947
5007
|
var TextGenerationInputSchema = {
|
|
4948
5008
|
type: "object",
|
|
4949
5009
|
properties: {
|
|
4950
|
-
model:
|
|
4951
|
-
prompt: {
|
|
5010
|
+
model: modelSchema23,
|
|
5011
|
+
prompt: TypeSingleOrArray({
|
|
4952
5012
|
type: "string",
|
|
4953
5013
|
title: "Prompt",
|
|
4954
5014
|
description: "The prompt to generate text from"
|
|
4955
|
-
},
|
|
5015
|
+
}),
|
|
4956
5016
|
maxTokens: {
|
|
4957
5017
|
type: "number",
|
|
4958
5018
|
title: "Max Tokens",
|
|
@@ -5021,19 +5081,19 @@ class TextGenerationTask extends StreamingAiTask {
|
|
|
5021
5081
|
var textGeneration = (input, config) => {
|
|
5022
5082
|
return new TextGenerationTask({}, config).run(input);
|
|
5023
5083
|
};
|
|
5024
|
-
|
|
5084
|
+
Workflow34.prototype.textGeneration = CreateWorkflow34(TextGenerationTask);
|
|
5025
5085
|
|
|
5026
5086
|
// src/task/TextLanguageDetectionTask.ts
|
|
5027
|
-
import { CreateWorkflow as
|
|
5028
|
-
var
|
|
5087
|
+
import { CreateWorkflow as CreateWorkflow35, Workflow as Workflow35 } from "@workglow/task-graph";
|
|
5088
|
+
var modelSchema24 = TypeModel("model:TextLanguageDetectionTask");
|
|
5029
5089
|
var TextLanguageDetectionInputSchema = {
|
|
5030
5090
|
type: "object",
|
|
5031
5091
|
properties: {
|
|
5032
|
-
text: {
|
|
5092
|
+
text: TypeSingleOrArray({
|
|
5033
5093
|
type: "string",
|
|
5034
5094
|
title: "Text",
|
|
5035
5095
|
description: "The text to detect the language of"
|
|
5036
|
-
},
|
|
5096
|
+
}),
|
|
5037
5097
|
maxLanguages: {
|
|
5038
5098
|
type: "number",
|
|
5039
5099
|
minimum: 0,
|
|
@@ -5042,7 +5102,7 @@ var TextLanguageDetectionInputSchema = {
|
|
|
5042
5102
|
title: "Max Languages",
|
|
5043
5103
|
description: "The maximum number of languages to return"
|
|
5044
5104
|
},
|
|
5045
|
-
model:
|
|
5105
|
+
model: modelSchema24
|
|
5046
5106
|
},
|
|
5047
5107
|
required: ["text", "model"],
|
|
5048
5108
|
additionalProperties: false
|
|
@@ -5050,7 +5110,7 @@ var TextLanguageDetectionInputSchema = {
|
|
|
5050
5110
|
var TextLanguageDetectionOutputSchema = {
|
|
5051
5111
|
type: "object",
|
|
5052
5112
|
properties: {
|
|
5053
|
-
languages: {
|
|
5113
|
+
languages: TypeSingleOrArray({
|
|
5054
5114
|
type: "array",
|
|
5055
5115
|
items: {
|
|
5056
5116
|
type: "object",
|
|
@@ -5071,7 +5131,7 @@ var TextLanguageDetectionOutputSchema = {
|
|
|
5071
5131
|
},
|
|
5072
5132
|
title: "Languages",
|
|
5073
5133
|
description: "The languages with their scores"
|
|
5074
|
-
}
|
|
5134
|
+
})
|
|
5075
5135
|
},
|
|
5076
5136
|
required: ["languages"],
|
|
5077
5137
|
additionalProperties: false
|
|
@@ -5092,33 +5152,33 @@ class TextLanguageDetectionTask extends AiTask {
|
|
|
5092
5152
|
var textLanguageDetection = (input, config) => {
|
|
5093
5153
|
return new TextLanguageDetectionTask({}, config).run(input);
|
|
5094
5154
|
};
|
|
5095
|
-
|
|
5155
|
+
Workflow35.prototype.textLanguageDetection = CreateWorkflow35(TextLanguageDetectionTask);
|
|
5096
5156
|
|
|
5097
5157
|
// src/task/TextQuestionAnswerTask.ts
|
|
5098
|
-
import { CreateWorkflow as
|
|
5099
|
-
var contextSchema = {
|
|
5158
|
+
import { CreateWorkflow as CreateWorkflow36, Workflow as Workflow36 } from "@workglow/task-graph";
|
|
5159
|
+
var contextSchema = TypeSingleOrArray({
|
|
5100
5160
|
type: "string",
|
|
5101
5161
|
title: "Context",
|
|
5102
5162
|
description: "The context of the question"
|
|
5103
|
-
};
|
|
5104
|
-
var questionSchema = {
|
|
5163
|
+
});
|
|
5164
|
+
var questionSchema = TypeSingleOrArray({
|
|
5105
5165
|
type: "string",
|
|
5106
5166
|
title: "Question",
|
|
5107
5167
|
description: "The question to answer"
|
|
5108
|
-
};
|
|
5109
|
-
var textSchema = {
|
|
5168
|
+
});
|
|
5169
|
+
var textSchema = TypeSingleOrArray({
|
|
5110
5170
|
type: "string",
|
|
5111
5171
|
title: "Text",
|
|
5112
5172
|
description: "The generated text",
|
|
5113
5173
|
"x-stream": "append"
|
|
5114
|
-
};
|
|
5115
|
-
var
|
|
5174
|
+
});
|
|
5175
|
+
var modelSchema25 = TypeModel("model:TextQuestionAnswerTask");
|
|
5116
5176
|
var TextQuestionAnswerInputSchema = {
|
|
5117
5177
|
type: "object",
|
|
5118
5178
|
properties: {
|
|
5119
5179
|
context: contextSchema,
|
|
5120
5180
|
question: questionSchema,
|
|
5121
|
-
model:
|
|
5181
|
+
model: modelSchema25
|
|
5122
5182
|
},
|
|
5123
5183
|
required: ["context", "question", "model"],
|
|
5124
5184
|
additionalProperties: false
|
|
@@ -5147,25 +5207,25 @@ class TextQuestionAnswerTask extends StreamingAiTask {
|
|
|
5147
5207
|
var textQuestionAnswer = (input, config) => {
|
|
5148
5208
|
return new TextQuestionAnswerTask({}, config).run(input);
|
|
5149
5209
|
};
|
|
5150
|
-
|
|
5210
|
+
Workflow36.prototype.textQuestionAnswer = CreateWorkflow36(TextQuestionAnswerTask);
|
|
5151
5211
|
|
|
5152
5212
|
// src/task/TextRewriterTask.ts
|
|
5153
|
-
import { CreateWorkflow as
|
|
5154
|
-
var
|
|
5213
|
+
import { CreateWorkflow as CreateWorkflow37, Workflow as Workflow37 } from "@workglow/task-graph";
|
|
5214
|
+
var modelSchema26 = TypeModel("model:TextRewriterTask");
|
|
5155
5215
|
var TextRewriterInputSchema = {
|
|
5156
5216
|
type: "object",
|
|
5157
5217
|
properties: {
|
|
5158
|
-
text: {
|
|
5218
|
+
text: TypeSingleOrArray({
|
|
5159
5219
|
type: "string",
|
|
5160
5220
|
title: "Text",
|
|
5161
5221
|
description: "The text to rewrite"
|
|
5162
|
-
},
|
|
5222
|
+
}),
|
|
5163
5223
|
prompt: {
|
|
5164
5224
|
type: "string",
|
|
5165
5225
|
title: "Prompt",
|
|
5166
5226
|
description: "The prompt to direct the rewriting"
|
|
5167
5227
|
},
|
|
5168
|
-
model:
|
|
5228
|
+
model: modelSchema26
|
|
5169
5229
|
},
|
|
5170
5230
|
required: ["text", "prompt", "model"],
|
|
5171
5231
|
additionalProperties: false
|
|
@@ -5173,12 +5233,12 @@ var TextRewriterInputSchema = {
|
|
|
5173
5233
|
var TextRewriterOutputSchema = {
|
|
5174
5234
|
type: "object",
|
|
5175
5235
|
properties: {
|
|
5176
|
-
text: {
|
|
5236
|
+
text: TypeSingleOrArray({
|
|
5177
5237
|
type: "string",
|
|
5178
5238
|
title: "Text",
|
|
5179
5239
|
description: "The rewritten text",
|
|
5180
5240
|
"x-stream": "append"
|
|
5181
|
-
}
|
|
5241
|
+
})
|
|
5182
5242
|
},
|
|
5183
5243
|
required: ["text"],
|
|
5184
5244
|
additionalProperties: false
|
|
@@ -5199,10 +5259,10 @@ class TextRewriterTask extends StreamingAiTask {
|
|
|
5199
5259
|
var textRewriter = (input, config) => {
|
|
5200
5260
|
return new TextRewriterTask({}, config).run(input);
|
|
5201
5261
|
};
|
|
5202
|
-
|
|
5262
|
+
Workflow37.prototype.textRewriter = CreateWorkflow37(TextRewriterTask);
|
|
5203
5263
|
|
|
5204
5264
|
// src/task/ToolCallingTask.ts
|
|
5205
|
-
import { CreateWorkflow as
|
|
5265
|
+
import { CreateWorkflow as CreateWorkflow38, TaskRegistry, Workflow as Workflow38 } from "@workglow/task-graph";
|
|
5206
5266
|
import { getLogger } from "@workglow/util";
|
|
5207
5267
|
function buildToolDescription(tool) {
|
|
5208
5268
|
let desc = tool.description;
|
|
@@ -5274,16 +5334,16 @@ var ToolDefinitionSchema = {
|
|
|
5274
5334
|
required: ["name", "description", "inputSchema"],
|
|
5275
5335
|
additionalProperties: false
|
|
5276
5336
|
};
|
|
5277
|
-
var
|
|
5337
|
+
var modelSchema27 = TypeModel("model:ToolCallingTask");
|
|
5278
5338
|
var ToolCallingInputSchema = {
|
|
5279
5339
|
type: "object",
|
|
5280
5340
|
properties: {
|
|
5281
|
-
model:
|
|
5282
|
-
prompt: {
|
|
5341
|
+
model: modelSchema27,
|
|
5342
|
+
prompt: TypeSingleOrArray({
|
|
5283
5343
|
type: "string",
|
|
5284
5344
|
title: "Prompt",
|
|
5285
5345
|
description: "The prompt to send to the model"
|
|
5286
|
-
},
|
|
5346
|
+
}),
|
|
5287
5347
|
systemPrompt: {
|
|
5288
5348
|
type: "string",
|
|
5289
5349
|
title: "System Prompt",
|
|
@@ -5323,19 +5383,19 @@ var ToolCallingInputSchema = {
|
|
|
5323
5383
|
var ToolCallingOutputSchema = {
|
|
5324
5384
|
type: "object",
|
|
5325
5385
|
properties: {
|
|
5326
|
-
text: {
|
|
5386
|
+
text: TypeSingleOrArray({
|
|
5327
5387
|
type: "string",
|
|
5328
5388
|
title: "Text",
|
|
5329
5389
|
description: "Any text content generated by the model",
|
|
5330
5390
|
"x-stream": "append"
|
|
5331
|
-
},
|
|
5332
|
-
toolCalls: {
|
|
5391
|
+
}),
|
|
5392
|
+
toolCalls: TypeSingleOrArray({
|
|
5333
5393
|
type: "object",
|
|
5334
5394
|
title: "Tool Calls",
|
|
5335
5395
|
description: "Tool invocations requested by the model, keyed by call id",
|
|
5336
5396
|
additionalProperties: true,
|
|
5337
5397
|
"x-stream": "object"
|
|
5338
|
-
}
|
|
5398
|
+
})
|
|
5339
5399
|
},
|
|
5340
5400
|
required: ["text", "toolCalls"],
|
|
5341
5401
|
additionalProperties: false
|
|
@@ -5356,25 +5416,25 @@ class ToolCallingTask extends StreamingAiTask {
|
|
|
5356
5416
|
var toolCalling = (input, config) => {
|
|
5357
5417
|
return new ToolCallingTask({}, config).run(input);
|
|
5358
5418
|
};
|
|
5359
|
-
|
|
5419
|
+
Workflow38.prototype.toolCalling = CreateWorkflow38(ToolCallingTask);
|
|
5360
5420
|
|
|
5361
5421
|
// src/task/TextTranslationTask.ts
|
|
5362
|
-
import { CreateWorkflow as
|
|
5363
|
-
var
|
|
5364
|
-
var translationTextSchema = {
|
|
5422
|
+
import { CreateWorkflow as CreateWorkflow39, Workflow as Workflow39 } from "@workglow/task-graph";
|
|
5423
|
+
var modelSchema28 = TypeModel("model:TextTranslationTask");
|
|
5424
|
+
var translationTextSchema = TypeSingleOrArray({
|
|
5365
5425
|
type: "string",
|
|
5366
5426
|
title: "Text",
|
|
5367
5427
|
description: "The translated text",
|
|
5368
5428
|
"x-stream": "replace"
|
|
5369
|
-
};
|
|
5429
|
+
});
|
|
5370
5430
|
var TextTranslationInputSchema = {
|
|
5371
5431
|
type: "object",
|
|
5372
5432
|
properties: {
|
|
5373
|
-
text: {
|
|
5433
|
+
text: TypeSingleOrArray({
|
|
5374
5434
|
type: "string",
|
|
5375
5435
|
title: "Text",
|
|
5376
5436
|
description: "The text to translate"
|
|
5377
|
-
},
|
|
5437
|
+
}),
|
|
5378
5438
|
source_lang: TypeLanguage({
|
|
5379
5439
|
title: "Source Language",
|
|
5380
5440
|
description: "The source language",
|
|
@@ -5387,7 +5447,7 @@ var TextTranslationInputSchema = {
|
|
|
5387
5447
|
minLength: 2,
|
|
5388
5448
|
maxLength: 2
|
|
5389
5449
|
}),
|
|
5390
|
-
model:
|
|
5450
|
+
model: modelSchema28
|
|
5391
5451
|
},
|
|
5392
5452
|
required: ["text", "source_lang", "target_lang", "model"],
|
|
5393
5453
|
additionalProperties: false
|
|
@@ -5422,13 +5482,13 @@ class TextTranslationTask extends StreamingAiTask {
|
|
|
5422
5482
|
var textTranslation = (input, config) => {
|
|
5423
5483
|
return new TextTranslationTask({}, config).run(input);
|
|
5424
5484
|
};
|
|
5425
|
-
|
|
5485
|
+
Workflow39.prototype.textTranslation = CreateWorkflow39(TextTranslationTask);
|
|
5426
5486
|
|
|
5427
5487
|
// src/task/TopicSegmenterTask.ts
|
|
5428
5488
|
import {
|
|
5429
|
-
CreateWorkflow as
|
|
5489
|
+
CreateWorkflow as CreateWorkflow40,
|
|
5430
5490
|
Task as Task14,
|
|
5431
|
-
Workflow as
|
|
5491
|
+
Workflow as Workflow40
|
|
5432
5492
|
} from "@workglow/task-graph";
|
|
5433
5493
|
var SegmentationMethod = {
|
|
5434
5494
|
HEURISTIC: "heuristic",
|
|
@@ -5709,15 +5769,15 @@ class TopicSegmenterTask extends Task14 {
|
|
|
5709
5769
|
var topicSegmenter = (input, config) => {
|
|
5710
5770
|
return new TopicSegmenterTask({}, config).run(input);
|
|
5711
5771
|
};
|
|
5712
|
-
|
|
5772
|
+
Workflow40.prototype.topicSegmenter = CreateWorkflow40(TopicSegmenterTask);
|
|
5713
5773
|
|
|
5714
5774
|
// src/task/UnloadModelTask.ts
|
|
5715
|
-
import { CreateWorkflow as
|
|
5716
|
-
var
|
|
5775
|
+
import { CreateWorkflow as CreateWorkflow41, Workflow as Workflow41 } from "@workglow/task-graph";
|
|
5776
|
+
var modelSchema29 = TypeModel("model");
|
|
5717
5777
|
var UnloadModelInputSchema = {
|
|
5718
5778
|
type: "object",
|
|
5719
5779
|
properties: {
|
|
5720
|
-
model:
|
|
5780
|
+
model: modelSchema29
|
|
5721
5781
|
},
|
|
5722
5782
|
required: ["model"],
|
|
5723
5783
|
additionalProperties: false
|
|
@@ -5725,7 +5785,7 @@ var UnloadModelInputSchema = {
|
|
|
5725
5785
|
var UnloadModelOutputSchema = {
|
|
5726
5786
|
type: "object",
|
|
5727
5787
|
properties: {
|
|
5728
|
-
model:
|
|
5788
|
+
model: modelSchema29
|
|
5729
5789
|
},
|
|
5730
5790
|
required: ["model"],
|
|
5731
5791
|
additionalProperties: false
|
|
@@ -5747,10 +5807,10 @@ class UnloadModelTask extends AiTask {
|
|
|
5747
5807
|
var unloadModel = (input, config) => {
|
|
5748
5808
|
return new UnloadModelTask({}, config).run(input);
|
|
5749
5809
|
};
|
|
5750
|
-
|
|
5810
|
+
Workflow41.prototype.unloadModel = CreateWorkflow41(UnloadModelTask);
|
|
5751
5811
|
|
|
5752
5812
|
// src/task/VectorQuantizeTask.ts
|
|
5753
|
-
import { CreateWorkflow as
|
|
5813
|
+
import { CreateWorkflow as CreateWorkflow42, Task as Task15, Workflow as Workflow42 } from "@workglow/task-graph";
|
|
5754
5814
|
import {
|
|
5755
5815
|
normalizeNumberArray,
|
|
5756
5816
|
TensorType,
|
|
@@ -5930,10 +5990,10 @@ class VectorQuantizeTask extends Task15 {
|
|
|
5930
5990
|
var vectorQuantize = (input, config) => {
|
|
5931
5991
|
return new VectorQuantizeTask({}, config).run(input);
|
|
5932
5992
|
};
|
|
5933
|
-
|
|
5993
|
+
Workflow42.prototype.vectorQuantize = CreateWorkflow42(VectorQuantizeTask);
|
|
5934
5994
|
|
|
5935
5995
|
// src/task/VectorSimilarityTask.ts
|
|
5936
|
-
import { CreateWorkflow as
|
|
5996
|
+
import { CreateWorkflow as CreateWorkflow43, GraphAsTask, Workflow as Workflow43 } from "@workglow/task-graph";
|
|
5937
5997
|
import {
|
|
5938
5998
|
cosineSimilarity,
|
|
5939
5999
|
hammingSimilarity,
|
|
@@ -6039,7 +6099,7 @@ class VectorSimilarityTask extends GraphAsTask {
|
|
|
6039
6099
|
var similarity = (input, config) => {
|
|
6040
6100
|
return new VectorSimilarityTask({}, config).run(input);
|
|
6041
6101
|
};
|
|
6042
|
-
|
|
6102
|
+
Workflow43.prototype.similarity = CreateWorkflow43(VectorSimilarityTask);
|
|
6043
6103
|
|
|
6044
6104
|
// src/task/index.ts
|
|
6045
6105
|
var registerAiTasks = () => {
|
|
@@ -6064,6 +6124,7 @@ var registerAiTasks = () => {
|
|
|
6064
6124
|
ImageEmbeddingTask,
|
|
6065
6125
|
ImageSegmentationTask,
|
|
6066
6126
|
ImageToTextTask,
|
|
6127
|
+
ModelInfoTask,
|
|
6067
6128
|
ObjectDetectionTask,
|
|
6068
6129
|
PoseLandmarkerTask,
|
|
6069
6130
|
QueryExpanderTask,
|
|
@@ -6118,6 +6179,7 @@ export {
|
|
|
6118
6179
|
queryExpander,
|
|
6119
6180
|
poseLandmarker,
|
|
6120
6181
|
objectDetection,
|
|
6182
|
+
modelInfo,
|
|
6121
6183
|
isAllowedToolName,
|
|
6122
6184
|
imageToText,
|
|
6123
6185
|
imageSegmentation,
|
|
@@ -6208,6 +6270,7 @@ export {
|
|
|
6208
6270
|
ModelRepository,
|
|
6209
6271
|
ModelRecordSchema,
|
|
6210
6272
|
ModelPrimaryKeyNames,
|
|
6273
|
+
ModelInfoTask,
|
|
6211
6274
|
ModelConfigSchema,
|
|
6212
6275
|
MODEL_REPOSITORY,
|
|
6213
6276
|
InMemoryModelRepository,
|
|
@@ -6259,4 +6322,4 @@ export {
|
|
|
6259
6322
|
AiJob
|
|
6260
6323
|
};
|
|
6261
6324
|
|
|
6262
|
-
//# debugId=
|
|
6325
|
+
//# debugId=E73E8DF34D71240E64756E2164756E21
|