@workglow/ai 0.0.102 → 0.0.103
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 +144 -49
- package/dist/browser.js.map +10 -9
- package/dist/bun.js +144 -49
- package/dist/bun.js.map +10 -9
- package/dist/job/AiJob.d.ts +3 -0
- package/dist/job/AiJob.d.ts.map +1 -1
- package/dist/node.js +144 -49
- package/dist/node.js.map +10 -9
- package/dist/provider/AiProviderRegistry.d.ts +8 -3
- package/dist/provider/AiProviderRegistry.d.ts.map +1 -1
- package/dist/task/ChunkToVectorTask.d.ts +5 -0
- package/dist/task/ChunkToVectorTask.d.ts.map +1 -1
- package/dist/task/StructuredGenerationTask.d.ts +130 -0
- package/dist/task/StructuredGenerationTask.d.ts.map +1 -0
- package/dist/task/base/AiTask.d.ts.map +1 -1
- package/dist/task/base/StreamingAiTask.d.ts +4 -3
- package/dist/task/base/StreamingAiTask.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 +11 -11
package/dist/browser.js
CHANGED
|
@@ -30,9 +30,9 @@ class AiProviderRegistry {
|
|
|
30
30
|
this.runFnRegistry.get(taskType).set(modelProvider, runFn);
|
|
31
31
|
}
|
|
32
32
|
registerAsWorkerRunFn(modelProvider, taskType) {
|
|
33
|
-
const workerFn = async (input, model, update_progress, signal) => {
|
|
33
|
+
const workerFn = async (input, model, update_progress, signal, outputSchema) => {
|
|
34
34
|
const workerManager = globalServiceRegistry.get(WORKER_MANAGER);
|
|
35
|
-
const result = await workerManager.callWorkerFunction(modelProvider, taskType, [input, model], {
|
|
35
|
+
const result = await workerManager.callWorkerFunction(modelProvider, taskType, [input, model, outputSchema], {
|
|
36
36
|
signal,
|
|
37
37
|
onProgress: update_progress
|
|
38
38
|
});
|
|
@@ -47,9 +47,9 @@ class AiProviderRegistry {
|
|
|
47
47
|
this.streamFnRegistry.get(taskType).set(modelProvider, streamFn);
|
|
48
48
|
}
|
|
49
49
|
registerAsWorkerStreamFn(modelProvider, taskType) {
|
|
50
|
-
const streamFn = async function* (input, model, signal) {
|
|
50
|
+
const streamFn = async function* (input, model, signal, outputSchema) {
|
|
51
51
|
const workerManager = globalServiceRegistry.get(WORKER_MANAGER);
|
|
52
|
-
yield* workerManager.callWorkerStreamFunction(modelProvider, taskType, [input, model], { signal });
|
|
52
|
+
yield* workerManager.callWorkerStreamFunction(modelProvider, taskType, [input, model, outputSchema], { signal });
|
|
53
53
|
};
|
|
54
54
|
this.registerStreamFn(modelProvider, taskType, streamFn);
|
|
55
55
|
}
|
|
@@ -121,7 +121,7 @@ class AiJob extends Job {
|
|
|
121
121
|
if (context.signal?.aborted) {
|
|
122
122
|
throw new AbortSignalJobError("Job aborted");
|
|
123
123
|
}
|
|
124
|
-
return await fn(input.taskInput, model, context.updateProgress, context.signal);
|
|
124
|
+
return await fn(input.taskInput, model, context.updateProgress, context.signal, input.outputSchema);
|
|
125
125
|
};
|
|
126
126
|
const runFnPromise = runFn();
|
|
127
127
|
return await Promise.race([runFnPromise, abortPromise]);
|
|
@@ -142,7 +142,7 @@ class AiJob extends Job {
|
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
const model = input.taskInput.model;
|
|
145
|
-
yield* streamFn(input.taskInput, model, context.signal);
|
|
145
|
+
yield* streamFn(input.taskInput, model, context.signal, input.outputSchema);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
// src/model/InMemoryModelRepository.ts
|
|
@@ -580,7 +580,8 @@ import { convertImageDataToUseableForm } from "@workglow/util";
|
|
|
580
580
|
// src/task/base/AiTask.ts
|
|
581
581
|
import {
|
|
582
582
|
JobQueueTask,
|
|
583
|
-
TaskConfigurationError
|
|
583
|
+
TaskConfigurationError,
|
|
584
|
+
hasStructuredOutput
|
|
584
585
|
} from "@workglow/task-graph";
|
|
585
586
|
function schemaFormat(schema) {
|
|
586
587
|
return typeof schema === "object" && schema !== null && "format" in schema ? schema.format : undefined;
|
|
@@ -599,11 +600,21 @@ class AiTask extends JobQueueTask {
|
|
|
599
600
|
throw new TaskConfigurationError("AiTask: Model was not resolved to ModelConfig - this indicates a bug in the resolution system");
|
|
600
601
|
}
|
|
601
602
|
const runtype = this.constructor.runtype ?? this.constructor.type;
|
|
602
|
-
|
|
603
|
+
const jobInput = {
|
|
603
604
|
taskType: runtype,
|
|
604
605
|
aiProvider: model.provider,
|
|
605
606
|
taskInput: input
|
|
606
607
|
};
|
|
608
|
+
const inputOutputSchema = input.outputSchema;
|
|
609
|
+
if (inputOutputSchema && typeof inputOutputSchema === "object") {
|
|
610
|
+
jobInput.outputSchema = inputOutputSchema;
|
|
611
|
+
} else {
|
|
612
|
+
const taskOutputSchema = this.outputSchema();
|
|
613
|
+
if (hasStructuredOutput(taskOutputSchema)) {
|
|
614
|
+
jobInput.outputSchema = taskOutputSchema;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return jobInput;
|
|
607
618
|
}
|
|
608
619
|
async createJob(input, queueName) {
|
|
609
620
|
const jobInput = await this.getJobInput(input);
|
|
@@ -1017,6 +1028,11 @@ var inputSchema2 = {
|
|
|
1017
1028
|
title: "Document ID",
|
|
1018
1029
|
description: "The document ID"
|
|
1019
1030
|
},
|
|
1031
|
+
doc_title: {
|
|
1032
|
+
type: "string",
|
|
1033
|
+
title: "Document Title",
|
|
1034
|
+
description: "Human-readable title for the source document"
|
|
1035
|
+
},
|
|
1020
1036
|
chunks: {
|
|
1021
1037
|
type: "array",
|
|
1022
1038
|
items: ChunkNodeSchema(),
|
|
@@ -1088,7 +1104,7 @@ class ChunkToVectorTask extends Task2 {
|
|
|
1088
1104
|
return outputSchema2;
|
|
1089
1105
|
}
|
|
1090
1106
|
async execute(input, context) {
|
|
1091
|
-
const { chunks, vectors } = input;
|
|
1107
|
+
const { chunks, vectors, doc_title } = input;
|
|
1092
1108
|
const chunkArray = chunks;
|
|
1093
1109
|
if (!chunkArray || !vectors) {
|
|
1094
1110
|
throw new Error("Both chunks and vector are required");
|
|
@@ -1110,6 +1126,7 @@ class ChunkToVectorTask extends Task2 {
|
|
|
1110
1126
|
depth: chunk.depth,
|
|
1111
1127
|
text: chunk.text,
|
|
1112
1128
|
nodePath: chunk.nodePath,
|
|
1129
|
+
...doc_title ? { doc_title } : {},
|
|
1113
1130
|
...chunk.enrichment || {}
|
|
1114
1131
|
});
|
|
1115
1132
|
}
|
|
@@ -2011,6 +2028,8 @@ class StreamingAiTask extends AiTask {
|
|
|
2011
2028
|
})) {
|
|
2012
2029
|
if (event.type === "text-delta") {
|
|
2013
2030
|
yield { ...event, port: event.port ?? defaultPort };
|
|
2031
|
+
} else if (event.type === "object-delta") {
|
|
2032
|
+
yield { ...event, port: event.port ?? defaultPort };
|
|
2014
2033
|
} else {
|
|
2015
2034
|
yield event;
|
|
2016
2035
|
}
|
|
@@ -4513,11 +4532,82 @@ var structuralParser = (input, config) => {
|
|
|
4513
4532
|
};
|
|
4514
4533
|
Workflow29.prototype.structuralParser = CreateWorkflow29(StructuralParserTask);
|
|
4515
4534
|
|
|
4535
|
+
// src/task/StructuredGenerationTask.ts
|
|
4536
|
+
import { CreateWorkflow as CreateWorkflow30, Workflow as Workflow30 } from "@workglow/task-graph";
|
|
4537
|
+
var modelSchema20 = TypeModel("model:StructuredGenerationTask");
|
|
4538
|
+
var StructuredGenerationInputSchema = {
|
|
4539
|
+
type: "object",
|
|
4540
|
+
properties: {
|
|
4541
|
+
model: modelSchema20,
|
|
4542
|
+
prompt: {
|
|
4543
|
+
type: "string",
|
|
4544
|
+
title: "Prompt",
|
|
4545
|
+
description: "The prompt to generate structured output from"
|
|
4546
|
+
},
|
|
4547
|
+
outputSchema: {
|
|
4548
|
+
type: "object",
|
|
4549
|
+
title: "Output Schema",
|
|
4550
|
+
description: "JSON Schema describing the desired output structure",
|
|
4551
|
+
additionalProperties: true
|
|
4552
|
+
},
|
|
4553
|
+
maxTokens: {
|
|
4554
|
+
type: "number",
|
|
4555
|
+
title: "Max Tokens",
|
|
4556
|
+
description: "The maximum number of tokens to generate",
|
|
4557
|
+
minimum: 1,
|
|
4558
|
+
maximum: 4096,
|
|
4559
|
+
"x-ui-group": "Configuration"
|
|
4560
|
+
},
|
|
4561
|
+
temperature: {
|
|
4562
|
+
type: "number",
|
|
4563
|
+
title: "Temperature",
|
|
4564
|
+
description: "The temperature to use for sampling",
|
|
4565
|
+
minimum: 0,
|
|
4566
|
+
maximum: 2,
|
|
4567
|
+
"x-ui-group": "Configuration"
|
|
4568
|
+
}
|
|
4569
|
+
},
|
|
4570
|
+
required: ["model", "prompt", "outputSchema"],
|
|
4571
|
+
additionalProperties: false
|
|
4572
|
+
};
|
|
4573
|
+
var StructuredGenerationOutputSchema = {
|
|
4574
|
+
type: "object",
|
|
4575
|
+
properties: {
|
|
4576
|
+
object: {
|
|
4577
|
+
type: "object",
|
|
4578
|
+
title: "Structured Output",
|
|
4579
|
+
description: "The generated structured object conforming to the provided schema",
|
|
4580
|
+
"x-stream": "object",
|
|
4581
|
+
"x-structured-output": true,
|
|
4582
|
+
additionalProperties: true
|
|
4583
|
+
}
|
|
4584
|
+
},
|
|
4585
|
+
required: ["object"],
|
|
4586
|
+
additionalProperties: false
|
|
4587
|
+
};
|
|
4588
|
+
|
|
4589
|
+
class StructuredGenerationTask extends StreamingAiTask {
|
|
4590
|
+
static type = "StructuredGenerationTask";
|
|
4591
|
+
static category = "AI Text Model";
|
|
4592
|
+
static title = "Structured Generation";
|
|
4593
|
+
static description = "Generates structured JSON output conforming to a provided schema using language models";
|
|
4594
|
+
static inputSchema() {
|
|
4595
|
+
return StructuredGenerationInputSchema;
|
|
4596
|
+
}
|
|
4597
|
+
static outputSchema() {
|
|
4598
|
+
return StructuredGenerationOutputSchema;
|
|
4599
|
+
}
|
|
4600
|
+
}
|
|
4601
|
+
var structuredGeneration = (input, config) => {
|
|
4602
|
+
return new StructuredGenerationTask({}, config).run(input);
|
|
4603
|
+
};
|
|
4604
|
+
Workflow30.prototype.structuredGeneration = CreateWorkflow30(StructuredGenerationTask);
|
|
4605
|
+
|
|
4516
4606
|
// src/task/TextChunkerTask.ts
|
|
4517
4607
|
import {
|
|
4518
|
-
CreateWorkflow as
|
|
4608
|
+
CreateWorkflow as CreateWorkflow31,
|
|
4519
4609
|
Task as Task13,
|
|
4520
|
-
Workflow as
|
|
4610
|
+
Workflow as Workflow31
|
|
4521
4611
|
} from "@workglow/task-graph";
|
|
4522
4612
|
var ChunkingStrategy = {
|
|
4523
4613
|
FIXED: "fixed",
|
|
@@ -4767,11 +4857,11 @@ class TextChunkerTask extends Task13 {
|
|
|
4767
4857
|
var textChunker = (input, config) => {
|
|
4768
4858
|
return new TextChunkerTask({}, config).run(input);
|
|
4769
4859
|
};
|
|
4770
|
-
|
|
4860
|
+
Workflow31.prototype.textChunker = CreateWorkflow31(TextChunkerTask);
|
|
4771
4861
|
|
|
4772
4862
|
// src/task/TextFillMaskTask.ts
|
|
4773
|
-
import { CreateWorkflow as
|
|
4774
|
-
var
|
|
4863
|
+
import { CreateWorkflow as CreateWorkflow32, Workflow as Workflow32 } from "@workglow/task-graph";
|
|
4864
|
+
var modelSchema21 = TypeModel("model:TextFillMaskTask");
|
|
4775
4865
|
var TextFillMaskInputSchema = {
|
|
4776
4866
|
type: "object",
|
|
4777
4867
|
properties: {
|
|
@@ -4780,7 +4870,7 @@ var TextFillMaskInputSchema = {
|
|
|
4780
4870
|
title: "Text",
|
|
4781
4871
|
description: "The text with a mask token to fill"
|
|
4782
4872
|
},
|
|
4783
|
-
model:
|
|
4873
|
+
model: modelSchema21
|
|
4784
4874
|
},
|
|
4785
4875
|
required: ["text", "model"],
|
|
4786
4876
|
additionalProperties: false
|
|
@@ -4835,21 +4925,21 @@ class TextFillMaskTask extends AiTask {
|
|
|
4835
4925
|
var textFillMask = (input, config) => {
|
|
4836
4926
|
return new TextFillMaskTask({}, config).run(input);
|
|
4837
4927
|
};
|
|
4838
|
-
|
|
4928
|
+
Workflow32.prototype.textFillMask = CreateWorkflow32(TextFillMaskTask);
|
|
4839
4929
|
|
|
4840
4930
|
// src/task/TextGenerationTask.ts
|
|
4841
|
-
import { CreateWorkflow as
|
|
4931
|
+
import { CreateWorkflow as CreateWorkflow33, Workflow as Workflow33 } from "@workglow/task-graph";
|
|
4842
4932
|
var generatedTextSchema2 = {
|
|
4843
4933
|
type: "string",
|
|
4844
4934
|
title: "Text",
|
|
4845
4935
|
description: "The generated text",
|
|
4846
4936
|
"x-stream": "append"
|
|
4847
4937
|
};
|
|
4848
|
-
var
|
|
4938
|
+
var modelSchema22 = TypeModel("model:TextGenerationTask");
|
|
4849
4939
|
var TextGenerationInputSchema = {
|
|
4850
4940
|
type: "object",
|
|
4851
4941
|
properties: {
|
|
4852
|
-
model:
|
|
4942
|
+
model: modelSchema22,
|
|
4853
4943
|
prompt: {
|
|
4854
4944
|
type: "string",
|
|
4855
4945
|
title: "Prompt",
|
|
@@ -4923,11 +5013,11 @@ class TextGenerationTask extends StreamingAiTask {
|
|
|
4923
5013
|
var textGeneration = (input, config) => {
|
|
4924
5014
|
return new TextGenerationTask({}, config).run(input);
|
|
4925
5015
|
};
|
|
4926
|
-
|
|
5016
|
+
Workflow33.prototype.textGeneration = CreateWorkflow33(TextGenerationTask);
|
|
4927
5017
|
|
|
4928
5018
|
// src/task/TextLanguageDetectionTask.ts
|
|
4929
|
-
import { CreateWorkflow as
|
|
4930
|
-
var
|
|
5019
|
+
import { CreateWorkflow as CreateWorkflow34, Workflow as Workflow34 } from "@workglow/task-graph";
|
|
5020
|
+
var modelSchema23 = TypeModel("model:TextLanguageDetectionTask");
|
|
4931
5021
|
var TextLanguageDetectionInputSchema = {
|
|
4932
5022
|
type: "object",
|
|
4933
5023
|
properties: {
|
|
@@ -4944,7 +5034,7 @@ var TextLanguageDetectionInputSchema = {
|
|
|
4944
5034
|
title: "Max Languages",
|
|
4945
5035
|
description: "The maximum number of languages to return"
|
|
4946
5036
|
},
|
|
4947
|
-
model:
|
|
5037
|
+
model: modelSchema23
|
|
4948
5038
|
},
|
|
4949
5039
|
required: ["text", "model"],
|
|
4950
5040
|
additionalProperties: false
|
|
@@ -4994,10 +5084,10 @@ class TextLanguageDetectionTask extends AiTask {
|
|
|
4994
5084
|
var textLanguageDetection = (input, config) => {
|
|
4995
5085
|
return new TextLanguageDetectionTask({}, config).run(input);
|
|
4996
5086
|
};
|
|
4997
|
-
|
|
5087
|
+
Workflow34.prototype.textLanguageDetection = CreateWorkflow34(TextLanguageDetectionTask);
|
|
4998
5088
|
|
|
4999
5089
|
// src/task/TextQuestionAnswerTask.ts
|
|
5000
|
-
import { CreateWorkflow as
|
|
5090
|
+
import { CreateWorkflow as CreateWorkflow35, Workflow as Workflow35 } from "@workglow/task-graph";
|
|
5001
5091
|
var contextSchema = {
|
|
5002
5092
|
type: "string",
|
|
5003
5093
|
title: "Context",
|
|
@@ -5014,13 +5104,13 @@ var textSchema = {
|
|
|
5014
5104
|
description: "The generated text",
|
|
5015
5105
|
"x-stream": "append"
|
|
5016
5106
|
};
|
|
5017
|
-
var
|
|
5107
|
+
var modelSchema24 = TypeModel("model:TextQuestionAnswerTask");
|
|
5018
5108
|
var TextQuestionAnswerInputSchema = {
|
|
5019
5109
|
type: "object",
|
|
5020
5110
|
properties: {
|
|
5021
5111
|
context: contextSchema,
|
|
5022
5112
|
question: questionSchema,
|
|
5023
|
-
model:
|
|
5113
|
+
model: modelSchema24
|
|
5024
5114
|
},
|
|
5025
5115
|
required: ["context", "question", "model"],
|
|
5026
5116
|
additionalProperties: false
|
|
@@ -5049,11 +5139,11 @@ class TextQuestionAnswerTask extends StreamingAiTask {
|
|
|
5049
5139
|
var textQuestionAnswer = (input, config) => {
|
|
5050
5140
|
return new TextQuestionAnswerTask({}, config).run(input);
|
|
5051
5141
|
};
|
|
5052
|
-
|
|
5142
|
+
Workflow35.prototype.textQuestionAnswer = CreateWorkflow35(TextQuestionAnswerTask);
|
|
5053
5143
|
|
|
5054
5144
|
// src/task/TextRewriterTask.ts
|
|
5055
|
-
import { CreateWorkflow as
|
|
5056
|
-
var
|
|
5145
|
+
import { CreateWorkflow as CreateWorkflow36, Workflow as Workflow36 } from "@workglow/task-graph";
|
|
5146
|
+
var modelSchema25 = TypeModel("model:TextRewriterTask");
|
|
5057
5147
|
var TextRewriterInputSchema = {
|
|
5058
5148
|
type: "object",
|
|
5059
5149
|
properties: {
|
|
@@ -5067,7 +5157,7 @@ var TextRewriterInputSchema = {
|
|
|
5067
5157
|
title: "Prompt",
|
|
5068
5158
|
description: "The prompt to direct the rewriting"
|
|
5069
5159
|
},
|
|
5070
|
-
model:
|
|
5160
|
+
model: modelSchema25
|
|
5071
5161
|
},
|
|
5072
5162
|
required: ["text", "prompt", "model"],
|
|
5073
5163
|
additionalProperties: false
|
|
@@ -5101,11 +5191,11 @@ class TextRewriterTask extends StreamingAiTask {
|
|
|
5101
5191
|
var textRewriter = (input, config) => {
|
|
5102
5192
|
return new TextRewriterTask({}, config).run(input);
|
|
5103
5193
|
};
|
|
5104
|
-
|
|
5194
|
+
Workflow36.prototype.textRewriter = CreateWorkflow36(TextRewriterTask);
|
|
5105
5195
|
|
|
5106
5196
|
// src/task/TextTranslationTask.ts
|
|
5107
|
-
import { CreateWorkflow as
|
|
5108
|
-
var
|
|
5197
|
+
import { CreateWorkflow as CreateWorkflow37, Workflow as Workflow37 } from "@workglow/task-graph";
|
|
5198
|
+
var modelSchema26 = TypeModel("model:TextTranslationTask");
|
|
5109
5199
|
var translationTextSchema = {
|
|
5110
5200
|
type: "string",
|
|
5111
5201
|
title: "Text",
|
|
@@ -5132,7 +5222,7 @@ var TextTranslationInputSchema = {
|
|
|
5132
5222
|
minLength: 2,
|
|
5133
5223
|
maxLength: 2
|
|
5134
5224
|
}),
|
|
5135
|
-
model:
|
|
5225
|
+
model: modelSchema26
|
|
5136
5226
|
},
|
|
5137
5227
|
required: ["text", "source_lang", "target_lang", "model"],
|
|
5138
5228
|
additionalProperties: false
|
|
@@ -5167,13 +5257,13 @@ class TextTranslationTask extends StreamingAiTask {
|
|
|
5167
5257
|
var textTranslation = (input, config) => {
|
|
5168
5258
|
return new TextTranslationTask({}, config).run(input);
|
|
5169
5259
|
};
|
|
5170
|
-
|
|
5260
|
+
Workflow37.prototype.textTranslation = CreateWorkflow37(TextTranslationTask);
|
|
5171
5261
|
|
|
5172
5262
|
// src/task/TopicSegmenterTask.ts
|
|
5173
5263
|
import {
|
|
5174
|
-
CreateWorkflow as
|
|
5264
|
+
CreateWorkflow as CreateWorkflow38,
|
|
5175
5265
|
Task as Task14,
|
|
5176
|
-
Workflow as
|
|
5266
|
+
Workflow as Workflow38
|
|
5177
5267
|
} from "@workglow/task-graph";
|
|
5178
5268
|
var SegmentationMethod = {
|
|
5179
5269
|
HEURISTIC: "heuristic",
|
|
@@ -5454,15 +5544,15 @@ class TopicSegmenterTask extends Task14 {
|
|
|
5454
5544
|
var topicSegmenter = (input, config) => {
|
|
5455
5545
|
return new TopicSegmenterTask({}, config).run(input);
|
|
5456
5546
|
};
|
|
5457
|
-
|
|
5547
|
+
Workflow38.prototype.topicSegmenter = CreateWorkflow38(TopicSegmenterTask);
|
|
5458
5548
|
|
|
5459
5549
|
// src/task/UnloadModelTask.ts
|
|
5460
|
-
import { CreateWorkflow as
|
|
5461
|
-
var
|
|
5550
|
+
import { CreateWorkflow as CreateWorkflow39, Workflow as Workflow39 } from "@workglow/task-graph";
|
|
5551
|
+
var modelSchema27 = TypeModel("model");
|
|
5462
5552
|
var UnloadModelInputSchema = {
|
|
5463
5553
|
type: "object",
|
|
5464
5554
|
properties: {
|
|
5465
|
-
model:
|
|
5555
|
+
model: modelSchema27
|
|
5466
5556
|
},
|
|
5467
5557
|
required: ["model"],
|
|
5468
5558
|
additionalProperties: false
|
|
@@ -5470,7 +5560,7 @@ var UnloadModelInputSchema = {
|
|
|
5470
5560
|
var UnloadModelOutputSchema = {
|
|
5471
5561
|
type: "object",
|
|
5472
5562
|
properties: {
|
|
5473
|
-
model:
|
|
5563
|
+
model: modelSchema27
|
|
5474
5564
|
},
|
|
5475
5565
|
required: ["model"],
|
|
5476
5566
|
additionalProperties: false
|
|
@@ -5492,10 +5582,10 @@ class UnloadModelTask extends AiTask {
|
|
|
5492
5582
|
var unloadModel = (input, config) => {
|
|
5493
5583
|
return new UnloadModelTask({}, config).run(input);
|
|
5494
5584
|
};
|
|
5495
|
-
|
|
5585
|
+
Workflow39.prototype.unloadModel = CreateWorkflow39(UnloadModelTask);
|
|
5496
5586
|
|
|
5497
5587
|
// src/task/VectorQuantizeTask.ts
|
|
5498
|
-
import { CreateWorkflow as
|
|
5588
|
+
import { CreateWorkflow as CreateWorkflow40, Task as Task15, Workflow as Workflow40 } from "@workglow/task-graph";
|
|
5499
5589
|
import {
|
|
5500
5590
|
normalizeNumberArray,
|
|
5501
5591
|
TensorType,
|
|
@@ -5675,10 +5765,10 @@ class VectorQuantizeTask extends Task15 {
|
|
|
5675
5765
|
var vectorQuantize = (input, config) => {
|
|
5676
5766
|
return new VectorQuantizeTask({}, config).run(input);
|
|
5677
5767
|
};
|
|
5678
|
-
|
|
5768
|
+
Workflow40.prototype.vectorQuantize = CreateWorkflow40(VectorQuantizeTask);
|
|
5679
5769
|
|
|
5680
5770
|
// src/task/VectorSimilarityTask.ts
|
|
5681
|
-
import { CreateWorkflow as
|
|
5771
|
+
import { CreateWorkflow as CreateWorkflow41, GraphAsTask, Workflow as Workflow41 } from "@workglow/task-graph";
|
|
5682
5772
|
import {
|
|
5683
5773
|
cosineSimilarity,
|
|
5684
5774
|
hammingSimilarity,
|
|
@@ -5784,7 +5874,7 @@ class VectorSimilarityTask extends GraphAsTask {
|
|
|
5784
5874
|
var similarity = (input, config) => {
|
|
5785
5875
|
return new VectorSimilarityTask({}, config).run(input);
|
|
5786
5876
|
};
|
|
5787
|
-
|
|
5877
|
+
Workflow41.prototype.similarity = CreateWorkflow41(VectorSimilarityTask);
|
|
5788
5878
|
|
|
5789
5879
|
// src/task/index.ts
|
|
5790
5880
|
var registerAiTasks = () => {
|
|
@@ -5814,6 +5904,7 @@ var registerAiTasks = () => {
|
|
|
5814
5904
|
QueryExpanderTask,
|
|
5815
5905
|
RerankerTask,
|
|
5816
5906
|
StructuralParserTask,
|
|
5907
|
+
StructuredGenerationTask,
|
|
5817
5908
|
TextChunkerTask,
|
|
5818
5909
|
TextClassificationTask,
|
|
5819
5910
|
TextEmbeddingTask,
|
|
@@ -5849,6 +5940,7 @@ export {
|
|
|
5849
5940
|
textEmbedding,
|
|
5850
5941
|
textClassification,
|
|
5851
5942
|
textChunker,
|
|
5943
|
+
structuredGeneration,
|
|
5852
5944
|
structuralParser,
|
|
5853
5945
|
similarity,
|
|
5854
5946
|
setGlobalModelRepository,
|
|
@@ -5923,6 +6015,9 @@ export {
|
|
|
5923
6015
|
TextClassificationOutputSchema,
|
|
5924
6016
|
TextClassificationInputSchema,
|
|
5925
6017
|
TextChunkerTask,
|
|
6018
|
+
StructuredGenerationTask,
|
|
6019
|
+
StructuredGenerationOutputSchema,
|
|
6020
|
+
StructuredGenerationInputSchema,
|
|
5926
6021
|
StructuralParserTask,
|
|
5927
6022
|
StreamingAiTask,
|
|
5928
6023
|
SimilarityFn,
|
|
@@ -5990,4 +6085,4 @@ export {
|
|
|
5990
6085
|
AiJob
|
|
5991
6086
|
};
|
|
5992
6087
|
|
|
5993
|
-
//# debugId=
|
|
6088
|
+
//# debugId=80CE1A613759B37B64756E2164756E21
|