@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.
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { IJobExecuteContext, Job } from "@workglow/job-queue";
7
7
  import { TaskInput, TaskOutput, type StreamEvent } from "@workglow/task-graph";
8
+ import type { JsonSchema } from "@workglow/util";
8
9
  import type { ModelConfig } from "../model/ModelSchema";
9
10
  /**
10
11
  * Input data for the AiJob
@@ -15,6 +16,8 @@ export interface AiJobInput<Input extends TaskInput = TaskInput> {
15
16
  taskInput: Input & {
16
17
  model: ModelConfig;
17
18
  };
19
+ /** JSON Schema for structured output, when the task declares x-structured-output. */
20
+ outputSchema?: JsonSchema;
18
21
  }
19
22
  /**
20
23
  * Extends the base Job class to provide custom execution functionality
@@ -1 +1 @@
1
- {"version":3,"file":"AiJob.d.ts","sourceRoot":"","sources":["../../src/job/AiJob.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,WAAW,CAAA;KAAE,CAAC;CAC3C;AAED;;;GAGG;AACH,qBAAa,KAAK,CAChB,KAAK,SAAS,UAAU,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,EAC3D,MAAM,SAAS,UAAU,GAAG,UAAU,CACtC,SAAQ,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACG,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IA4CzE;;;OAGG;IACI,aAAa,CAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,kBAAkB,GAC1B,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAmBtC"}
1
+ {"version":3,"file":"AiJob.d.ts","sourceRoot":"","sources":["../../src/job/AiJob.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,KAAK,GAAG;QAAE,KAAK,EAAE,WAAW,CAAA;KAAE,CAAC;IAC1C,qFAAqF;IACrF,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED;;;GAGG;AACH,qBAAa,KAAK,CAChB,KAAK,SAAS,UAAU,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,EAC3D,MAAM,SAAS,UAAU,GAAG,UAAU,CACtC,SAAQ,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACG,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAkDzE;;;OAGG;IACI,aAAa,CAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,kBAAkB,GAC1B,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;CAmBtC"}
package/dist/node.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
- return {
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 CreateWorkflow30,
4608
+ CreateWorkflow as CreateWorkflow31,
4519
4609
  Task as Task13,
4520
- Workflow as Workflow30
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
- Workflow30.prototype.textChunker = CreateWorkflow30(TextChunkerTask);
4860
+ Workflow31.prototype.textChunker = CreateWorkflow31(TextChunkerTask);
4771
4861
 
4772
4862
  // src/task/TextFillMaskTask.ts
4773
- import { CreateWorkflow as CreateWorkflow31, Workflow as Workflow31 } from "@workglow/task-graph";
4774
- var modelSchema20 = TypeModel("model:TextFillMaskTask");
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: modelSchema20
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
- Workflow31.prototype.textFillMask = CreateWorkflow31(TextFillMaskTask);
4928
+ Workflow32.prototype.textFillMask = CreateWorkflow32(TextFillMaskTask);
4839
4929
 
4840
4930
  // src/task/TextGenerationTask.ts
4841
- import { CreateWorkflow as CreateWorkflow32, Workflow as Workflow32 } from "@workglow/task-graph";
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 modelSchema21 = TypeModel("model:TextGenerationTask");
4938
+ var modelSchema22 = TypeModel("model:TextGenerationTask");
4849
4939
  var TextGenerationInputSchema = {
4850
4940
  type: "object",
4851
4941
  properties: {
4852
- model: modelSchema21,
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
- Workflow32.prototype.textGeneration = CreateWorkflow32(TextGenerationTask);
5016
+ Workflow33.prototype.textGeneration = CreateWorkflow33(TextGenerationTask);
4927
5017
 
4928
5018
  // src/task/TextLanguageDetectionTask.ts
4929
- import { CreateWorkflow as CreateWorkflow33, Workflow as Workflow33 } from "@workglow/task-graph";
4930
- var modelSchema22 = TypeModel("model:TextLanguageDetectionTask");
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: modelSchema22
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
- Workflow33.prototype.textLanguageDetection = CreateWorkflow33(TextLanguageDetectionTask);
5087
+ Workflow34.prototype.textLanguageDetection = CreateWorkflow34(TextLanguageDetectionTask);
4998
5088
 
4999
5089
  // src/task/TextQuestionAnswerTask.ts
5000
- import { CreateWorkflow as CreateWorkflow34, Workflow as Workflow34 } from "@workglow/task-graph";
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 modelSchema23 = TypeModel("model:TextQuestionAnswerTask");
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: modelSchema23
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
- Workflow34.prototype.textQuestionAnswer = CreateWorkflow34(TextQuestionAnswerTask);
5142
+ Workflow35.prototype.textQuestionAnswer = CreateWorkflow35(TextQuestionAnswerTask);
5053
5143
 
5054
5144
  // src/task/TextRewriterTask.ts
5055
- import { CreateWorkflow as CreateWorkflow35, Workflow as Workflow35 } from "@workglow/task-graph";
5056
- var modelSchema24 = TypeModel("model:TextRewriterTask");
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: modelSchema24
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
- Workflow35.prototype.textRewriter = CreateWorkflow35(TextRewriterTask);
5194
+ Workflow36.prototype.textRewriter = CreateWorkflow36(TextRewriterTask);
5105
5195
 
5106
5196
  // src/task/TextTranslationTask.ts
5107
- import { CreateWorkflow as CreateWorkflow36, Workflow as Workflow36 } from "@workglow/task-graph";
5108
- var modelSchema25 = TypeModel("model:TextTranslationTask");
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: modelSchema25
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
- Workflow36.prototype.textTranslation = CreateWorkflow36(TextTranslationTask);
5260
+ Workflow37.prototype.textTranslation = CreateWorkflow37(TextTranslationTask);
5171
5261
 
5172
5262
  // src/task/TopicSegmenterTask.ts
5173
5263
  import {
5174
- CreateWorkflow as CreateWorkflow37,
5264
+ CreateWorkflow as CreateWorkflow38,
5175
5265
  Task as Task14,
5176
- Workflow as Workflow37
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
- Workflow37.prototype.topicSegmenter = CreateWorkflow37(TopicSegmenterTask);
5547
+ Workflow38.prototype.topicSegmenter = CreateWorkflow38(TopicSegmenterTask);
5458
5548
 
5459
5549
  // src/task/UnloadModelTask.ts
5460
- import { CreateWorkflow as CreateWorkflow38, Workflow as Workflow38 } from "@workglow/task-graph";
5461
- var modelSchema26 = TypeModel("model");
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: modelSchema26
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: modelSchema26
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
- Workflow38.prototype.unloadModel = CreateWorkflow38(UnloadModelTask);
5585
+ Workflow39.prototype.unloadModel = CreateWorkflow39(UnloadModelTask);
5496
5586
 
5497
5587
  // src/task/VectorQuantizeTask.ts
5498
- import { CreateWorkflow as CreateWorkflow39, Task as Task15, Workflow as Workflow39 } from "@workglow/task-graph";
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
- Workflow39.prototype.vectorQuantize = CreateWorkflow39(VectorQuantizeTask);
5768
+ Workflow40.prototype.vectorQuantize = CreateWorkflow40(VectorQuantizeTask);
5679
5769
 
5680
5770
  // src/task/VectorSimilarityTask.ts
5681
- import { CreateWorkflow as CreateWorkflow40, GraphAsTask, Workflow as Workflow40 } from "@workglow/task-graph";
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
- Workflow40.prototype.similarity = CreateWorkflow40(VectorSimilarityTask);
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=ABDF225708417FBC64756E2164756E21
6088
+ //# debugId=69DD026BF72324CF64756E2164756E21