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