@workglow/ai 0.0.102 → 0.0.104

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.
Files changed (84) hide show
  1. package/dist/browser.js +152 -50
  2. package/dist/browser.js.map +11 -10
  3. package/dist/bun.js +152 -50
  4. package/dist/bun.js.map +11 -10
  5. package/dist/job/AiJob.d.ts +3 -0
  6. package/dist/job/AiJob.d.ts.map +1 -1
  7. package/dist/model/ModelRepository.d.ts +2 -0
  8. package/dist/model/ModelRepository.d.ts.map +1 -1
  9. package/dist/model/ModelSchema.d.ts +16 -0
  10. package/dist/model/ModelSchema.d.ts.map +1 -1
  11. package/dist/node.js +152 -50
  12. package/dist/node.js.map +11 -10
  13. package/dist/provider/AiProviderRegistry.d.ts +9 -3
  14. package/dist/provider/AiProviderRegistry.d.ts.map +1 -1
  15. package/dist/task/BackgroundRemovalTask.d.ts +8 -0
  16. package/dist/task/BackgroundRemovalTask.d.ts.map +1 -1
  17. package/dist/task/ChunkRetrievalTask.d.ts +8 -0
  18. package/dist/task/ChunkRetrievalTask.d.ts.map +1 -1
  19. package/dist/task/ChunkToVectorTask.d.ts +5 -0
  20. package/dist/task/ChunkToVectorTask.d.ts.map +1 -1
  21. package/dist/task/ContextBuilderTask.d.ts +8 -0
  22. package/dist/task/ContextBuilderTask.d.ts.map +1 -1
  23. package/dist/task/CountTokensTask.d.ts +8 -0
  24. package/dist/task/CountTokensTask.d.ts.map +1 -1
  25. package/dist/task/DocumentEnricherTask.d.ts +16 -0
  26. package/dist/task/DocumentEnricherTask.d.ts.map +1 -1
  27. package/dist/task/DownloadModelTask.d.ts +17 -0
  28. package/dist/task/DownloadModelTask.d.ts.map +1 -1
  29. package/dist/task/FaceDetectorTask.d.ts +8 -0
  30. package/dist/task/FaceDetectorTask.d.ts.map +1 -1
  31. package/dist/task/FaceLandmarkerTask.d.ts +8 -0
  32. package/dist/task/FaceLandmarkerTask.d.ts.map +1 -1
  33. package/dist/task/GestureRecognizerTask.d.ts +8 -0
  34. package/dist/task/GestureRecognizerTask.d.ts.map +1 -1
  35. package/dist/task/HandLandmarkerTask.d.ts +8 -0
  36. package/dist/task/HandLandmarkerTask.d.ts.map +1 -1
  37. package/dist/task/HierarchicalChunkerTask.d.ts +8 -0
  38. package/dist/task/HierarchicalChunkerTask.d.ts.map +1 -1
  39. package/dist/task/ImageClassificationTask.d.ts +8 -0
  40. package/dist/task/ImageClassificationTask.d.ts.map +1 -1
  41. package/dist/task/ImageEmbeddingTask.d.ts +8 -0
  42. package/dist/task/ImageEmbeddingTask.d.ts.map +1 -1
  43. package/dist/task/ImageSegmentationTask.d.ts +8 -0
  44. package/dist/task/ImageSegmentationTask.d.ts.map +1 -1
  45. package/dist/task/ImageToTextTask.d.ts +8 -0
  46. package/dist/task/ImageToTextTask.d.ts.map +1 -1
  47. package/dist/task/ObjectDetectionTask.d.ts +8 -0
  48. package/dist/task/ObjectDetectionTask.d.ts.map +1 -1
  49. package/dist/task/PoseLandmarkerTask.d.ts +8 -0
  50. package/dist/task/PoseLandmarkerTask.d.ts.map +1 -1
  51. package/dist/task/RerankerTask.d.ts +8 -0
  52. package/dist/task/RerankerTask.d.ts.map +1 -1
  53. package/dist/task/StructuredGenerationTask.d.ts +138 -0
  54. package/dist/task/StructuredGenerationTask.d.ts.map +1 -0
  55. package/dist/task/TextClassificationTask.d.ts +8 -0
  56. package/dist/task/TextClassificationTask.d.ts.map +1 -1
  57. package/dist/task/TextEmbeddingTask.d.ts +8 -0
  58. package/dist/task/TextEmbeddingTask.d.ts.map +1 -1
  59. package/dist/task/TextFillMaskTask.d.ts +8 -0
  60. package/dist/task/TextFillMaskTask.d.ts.map +1 -1
  61. package/dist/task/TextGenerationTask.d.ts +8 -0
  62. package/dist/task/TextGenerationTask.d.ts.map +1 -1
  63. package/dist/task/TextLanguageDetectionTask.d.ts +8 -0
  64. package/dist/task/TextLanguageDetectionTask.d.ts.map +1 -1
  65. package/dist/task/TextNamedEntityRecognitionTask.d.ts +8 -0
  66. package/dist/task/TextNamedEntityRecognitionTask.d.ts.map +1 -1
  67. package/dist/task/TextQuestionAnswerTask.d.ts +8 -0
  68. package/dist/task/TextQuestionAnswerTask.d.ts.map +1 -1
  69. package/dist/task/TextRewriterTask.d.ts +8 -0
  70. package/dist/task/TextRewriterTask.d.ts.map +1 -1
  71. package/dist/task/TextSummaryTask.d.ts +8 -0
  72. package/dist/task/TextSummaryTask.d.ts.map +1 -1
  73. package/dist/task/TextTranslationTask.d.ts +8 -0
  74. package/dist/task/TextTranslationTask.d.ts.map +1 -1
  75. package/dist/task/UnloadModelTask.d.ts +17 -0
  76. package/dist/task/UnloadModelTask.d.ts.map +1 -1
  77. package/dist/task/base/AiTask.d.ts.map +1 -1
  78. package/dist/task/base/AiTaskSchemas.d.ts +16 -0
  79. package/dist/task/base/AiTaskSchemas.d.ts.map +1 -1
  80. package/dist/task/base/StreamingAiTask.d.ts +4 -3
  81. package/dist/task/base/StreamingAiTask.d.ts.map +1 -1
  82. package/dist/task/index.d.ts +3 -1
  83. package/dist/task/index.d.ts.map +1 -1
  84. package/package.json +11 -11
package/dist/bun.js CHANGED
@@ -31,9 +31,9 @@ class AiProviderRegistry {
31
31
  this.runFnRegistry.get(taskType).set(modelProvider, runFn);
32
32
  }
33
33
  registerAsWorkerRunFn(modelProvider, taskType) {
34
- const workerFn = async (input, model, update_progress, signal) => {
34
+ const workerFn = async (input, model, update_progress, signal, outputSchema) => {
35
35
  const workerManager = globalServiceRegistry.get(WORKER_MANAGER);
36
- const result = await workerManager.callWorkerFunction(modelProvider, taskType, [input, model], {
36
+ const result = await workerManager.callWorkerFunction(modelProvider, taskType, [input, model, outputSchema], {
37
37
  signal,
38
38
  onProgress: update_progress
39
39
  });
@@ -48,9 +48,9 @@ class AiProviderRegistry {
48
48
  this.streamFnRegistry.get(taskType).set(modelProvider, streamFn);
49
49
  }
50
50
  registerAsWorkerStreamFn(modelProvider, taskType) {
51
- const streamFn = async function* (input, model, signal) {
51
+ const streamFn = async function* (input, model, signal, outputSchema) {
52
52
  const workerManager = globalServiceRegistry.get(WORKER_MANAGER);
53
- yield* workerManager.callWorkerStreamFunction(modelProvider, taskType, [input, model], { signal });
53
+ yield* workerManager.callWorkerStreamFunction(modelProvider, taskType, [input, model, outputSchema], { signal });
54
54
  };
55
55
  this.registerStreamFn(modelProvider, taskType, streamFn);
56
56
  }
@@ -122,7 +122,7 @@ class AiJob extends Job {
122
122
  if (context.signal?.aborted) {
123
123
  throw new AbortSignalJobError("Job aborted");
124
124
  }
125
- return await fn(input.taskInput, model, context.updateProgress, context.signal);
125
+ return await fn(input.taskInput, model, context.updateProgress, context.signal, input.outputSchema);
126
126
  };
127
127
  const runFnPromise = runFn();
128
128
  return await Promise.race([runFnPromise, abortPromise]);
@@ -143,7 +143,7 @@ class AiJob extends Job {
143
143
  return;
144
144
  }
145
145
  const model = input.taskInput.model;
146
- yield* streamFn(input.taskInput, model, context.signal);
146
+ yield* streamFn(input.taskInput, model, context.signal, input.outputSchema);
147
147
  }
148
148
  }
149
149
  // src/model/InMemoryModelRepository.ts
@@ -245,7 +245,14 @@ var ModelConfigSchema = {
245
245
  title: { type: "string" },
246
246
  description: { type: "string", "x-ui-editor": "textarea" },
247
247
  provider: { type: "string" },
248
- provider_config: { type: "object", default: {} },
248
+ provider_config: {
249
+ type: "object",
250
+ properties: {
251
+ credential_key: { type: "string", format: "credential", "x-ui-hidden": true }
252
+ },
253
+ additionalProperties: true,
254
+ default: {}
255
+ },
249
256
  metadata: { type: "object", default: {}, "x-ui-hidden": true }
250
257
  },
251
258
  required: ["provider", "provider_config"],
@@ -581,7 +588,8 @@ import { convertImageDataToUseableForm } from "@workglow/util";
581
588
  // src/task/base/AiTask.ts
582
589
  import {
583
590
  JobQueueTask,
584
- TaskConfigurationError
591
+ TaskConfigurationError,
592
+ hasStructuredOutput
585
593
  } from "@workglow/task-graph";
586
594
  function schemaFormat(schema) {
587
595
  return typeof schema === "object" && schema !== null && "format" in schema ? schema.format : undefined;
@@ -600,11 +608,21 @@ class AiTask extends JobQueueTask {
600
608
  throw new TaskConfigurationError("AiTask: Model was not resolved to ModelConfig - this indicates a bug in the resolution system");
601
609
  }
602
610
  const runtype = this.constructor.runtype ?? this.constructor.type;
603
- return {
611
+ const jobInput = {
604
612
  taskType: runtype,
605
613
  aiProvider: model.provider,
606
614
  taskInput: input
607
615
  };
616
+ const inputOutputSchema = input.outputSchema;
617
+ if (inputOutputSchema && typeof inputOutputSchema === "object") {
618
+ jobInput.outputSchema = inputOutputSchema;
619
+ } else {
620
+ const taskOutputSchema = this.outputSchema();
621
+ if (hasStructuredOutput(taskOutputSchema)) {
622
+ jobInput.outputSchema = taskOutputSchema;
623
+ }
624
+ }
625
+ return jobInput;
608
626
  }
609
627
  async createJob(input, queueName) {
610
628
  const jobInput = await this.getJobInput(input);
@@ -1018,6 +1036,11 @@ var inputSchema2 = {
1018
1036
  title: "Document ID",
1019
1037
  description: "The document ID"
1020
1038
  },
1039
+ doc_title: {
1040
+ type: "string",
1041
+ title: "Document Title",
1042
+ description: "Human-readable title for the source document"
1043
+ },
1021
1044
  chunks: {
1022
1045
  type: "array",
1023
1046
  items: ChunkNodeSchema(),
@@ -1089,7 +1112,7 @@ class ChunkToVectorTask extends Task2 {
1089
1112
  return outputSchema2;
1090
1113
  }
1091
1114
  async execute(input, context) {
1092
- const { chunks, vectors } = input;
1115
+ const { chunks, vectors, doc_title } = input;
1093
1116
  const chunkArray = chunks;
1094
1117
  if (!chunkArray || !vectors) {
1095
1118
  throw new Error("Both chunks and vector are required");
@@ -1111,6 +1134,7 @@ class ChunkToVectorTask extends Task2 {
1111
1134
  depth: chunk.depth,
1112
1135
  text: chunk.text,
1113
1136
  nodePath: chunk.nodePath,
1137
+ ...doc_title ? { doc_title } : {},
1114
1138
  ...chunk.enrichment || {}
1115
1139
  });
1116
1140
  }
@@ -2012,6 +2036,8 @@ class StreamingAiTask extends AiTask {
2012
2036
  })) {
2013
2037
  if (event.type === "text-delta") {
2014
2038
  yield { ...event, port: event.port ?? defaultPort };
2039
+ } else if (event.type === "object-delta") {
2040
+ yield { ...event, port: event.port ?? defaultPort };
2015
2041
  } else {
2016
2042
  yield event;
2017
2043
  }
@@ -4514,11 +4540,82 @@ var structuralParser = (input, config) => {
4514
4540
  };
4515
4541
  Workflow29.prototype.structuralParser = CreateWorkflow29(StructuralParserTask);
4516
4542
 
4543
+ // src/task/StructuredGenerationTask.ts
4544
+ import { CreateWorkflow as CreateWorkflow30, Workflow as Workflow30 } from "@workglow/task-graph";
4545
+ var modelSchema20 = TypeModel("model:StructuredGenerationTask");
4546
+ var StructuredGenerationInputSchema = {
4547
+ type: "object",
4548
+ properties: {
4549
+ model: modelSchema20,
4550
+ prompt: {
4551
+ type: "string",
4552
+ title: "Prompt",
4553
+ description: "The prompt to generate structured output from"
4554
+ },
4555
+ outputSchema: {
4556
+ type: "object",
4557
+ title: "Output Schema",
4558
+ description: "JSON Schema describing the desired output structure",
4559
+ additionalProperties: true
4560
+ },
4561
+ maxTokens: {
4562
+ type: "number",
4563
+ title: "Max Tokens",
4564
+ description: "The maximum number of tokens to generate",
4565
+ minimum: 1,
4566
+ maximum: 4096,
4567
+ "x-ui-group": "Configuration"
4568
+ },
4569
+ temperature: {
4570
+ type: "number",
4571
+ title: "Temperature",
4572
+ description: "The temperature to use for sampling",
4573
+ minimum: 0,
4574
+ maximum: 2,
4575
+ "x-ui-group": "Configuration"
4576
+ }
4577
+ },
4578
+ required: ["model", "prompt", "outputSchema"],
4579
+ additionalProperties: false
4580
+ };
4581
+ var StructuredGenerationOutputSchema = {
4582
+ type: "object",
4583
+ properties: {
4584
+ object: {
4585
+ type: "object",
4586
+ title: "Structured Output",
4587
+ description: "The generated structured object conforming to the provided schema",
4588
+ "x-stream": "object",
4589
+ "x-structured-output": true,
4590
+ additionalProperties: true
4591
+ }
4592
+ },
4593
+ required: ["object"],
4594
+ additionalProperties: false
4595
+ };
4596
+
4597
+ class StructuredGenerationTask extends StreamingAiTask {
4598
+ static type = "StructuredGenerationTask";
4599
+ static category = "AI Text Model";
4600
+ static title = "Structured Generation";
4601
+ static description = "Generates structured JSON output conforming to a provided schema using language models";
4602
+ static inputSchema() {
4603
+ return StructuredGenerationInputSchema;
4604
+ }
4605
+ static outputSchema() {
4606
+ return StructuredGenerationOutputSchema;
4607
+ }
4608
+ }
4609
+ var structuredGeneration = (input, config) => {
4610
+ return new StructuredGenerationTask({}, config).run(input);
4611
+ };
4612
+ Workflow30.prototype.structuredGeneration = CreateWorkflow30(StructuredGenerationTask);
4613
+
4517
4614
  // src/task/TextChunkerTask.ts
4518
4615
  import {
4519
- CreateWorkflow as CreateWorkflow30,
4616
+ CreateWorkflow as CreateWorkflow31,
4520
4617
  Task as Task13,
4521
- Workflow as Workflow30
4618
+ Workflow as Workflow31
4522
4619
  } from "@workglow/task-graph";
4523
4620
  var ChunkingStrategy = {
4524
4621
  FIXED: "fixed",
@@ -4768,11 +4865,11 @@ class TextChunkerTask extends Task13 {
4768
4865
  var textChunker = (input, config) => {
4769
4866
  return new TextChunkerTask({}, config).run(input);
4770
4867
  };
4771
- Workflow30.prototype.textChunker = CreateWorkflow30(TextChunkerTask);
4868
+ Workflow31.prototype.textChunker = CreateWorkflow31(TextChunkerTask);
4772
4869
 
4773
4870
  // src/task/TextFillMaskTask.ts
4774
- import { CreateWorkflow as CreateWorkflow31, Workflow as Workflow31 } from "@workglow/task-graph";
4775
- var modelSchema20 = TypeModel("model:TextFillMaskTask");
4871
+ import { CreateWorkflow as CreateWorkflow32, Workflow as Workflow32 } from "@workglow/task-graph";
4872
+ var modelSchema21 = TypeModel("model:TextFillMaskTask");
4776
4873
  var TextFillMaskInputSchema = {
4777
4874
  type: "object",
4778
4875
  properties: {
@@ -4781,7 +4878,7 @@ var TextFillMaskInputSchema = {
4781
4878
  title: "Text",
4782
4879
  description: "The text with a mask token to fill"
4783
4880
  },
4784
- model: modelSchema20
4881
+ model: modelSchema21
4785
4882
  },
4786
4883
  required: ["text", "model"],
4787
4884
  additionalProperties: false
@@ -4836,21 +4933,21 @@ class TextFillMaskTask extends AiTask {
4836
4933
  var textFillMask = (input, config) => {
4837
4934
  return new TextFillMaskTask({}, config).run(input);
4838
4935
  };
4839
- Workflow31.prototype.textFillMask = CreateWorkflow31(TextFillMaskTask);
4936
+ Workflow32.prototype.textFillMask = CreateWorkflow32(TextFillMaskTask);
4840
4937
 
4841
4938
  // src/task/TextGenerationTask.ts
4842
- import { CreateWorkflow as CreateWorkflow32, Workflow as Workflow32 } from "@workglow/task-graph";
4939
+ import { CreateWorkflow as CreateWorkflow33, Workflow as Workflow33 } from "@workglow/task-graph";
4843
4940
  var generatedTextSchema2 = {
4844
4941
  type: "string",
4845
4942
  title: "Text",
4846
4943
  description: "The generated text",
4847
4944
  "x-stream": "append"
4848
4945
  };
4849
- var modelSchema21 = TypeModel("model:TextGenerationTask");
4946
+ var modelSchema22 = TypeModel("model:TextGenerationTask");
4850
4947
  var TextGenerationInputSchema = {
4851
4948
  type: "object",
4852
4949
  properties: {
4853
- model: modelSchema21,
4950
+ model: modelSchema22,
4854
4951
  prompt: {
4855
4952
  type: "string",
4856
4953
  title: "Prompt",
@@ -4924,11 +5021,11 @@ class TextGenerationTask extends StreamingAiTask {
4924
5021
  var textGeneration = (input, config) => {
4925
5022
  return new TextGenerationTask({}, config).run(input);
4926
5023
  };
4927
- Workflow32.prototype.textGeneration = CreateWorkflow32(TextGenerationTask);
5024
+ Workflow33.prototype.textGeneration = CreateWorkflow33(TextGenerationTask);
4928
5025
 
4929
5026
  // src/task/TextLanguageDetectionTask.ts
4930
- import { CreateWorkflow as CreateWorkflow33, Workflow as Workflow33 } from "@workglow/task-graph";
4931
- var modelSchema22 = TypeModel("model:TextLanguageDetectionTask");
5027
+ import { CreateWorkflow as CreateWorkflow34, Workflow as Workflow34 } from "@workglow/task-graph";
5028
+ var modelSchema23 = TypeModel("model:TextLanguageDetectionTask");
4932
5029
  var TextLanguageDetectionInputSchema = {
4933
5030
  type: "object",
4934
5031
  properties: {
@@ -4945,7 +5042,7 @@ var TextLanguageDetectionInputSchema = {
4945
5042
  title: "Max Languages",
4946
5043
  description: "The maximum number of languages to return"
4947
5044
  },
4948
- model: modelSchema22
5045
+ model: modelSchema23
4949
5046
  },
4950
5047
  required: ["text", "model"],
4951
5048
  additionalProperties: false
@@ -4995,10 +5092,10 @@ class TextLanguageDetectionTask extends AiTask {
4995
5092
  var textLanguageDetection = (input, config) => {
4996
5093
  return new TextLanguageDetectionTask({}, config).run(input);
4997
5094
  };
4998
- Workflow33.prototype.textLanguageDetection = CreateWorkflow33(TextLanguageDetectionTask);
5095
+ Workflow34.prototype.textLanguageDetection = CreateWorkflow34(TextLanguageDetectionTask);
4999
5096
 
5000
5097
  // src/task/TextQuestionAnswerTask.ts
5001
- import { CreateWorkflow as CreateWorkflow34, Workflow as Workflow34 } from "@workglow/task-graph";
5098
+ import { CreateWorkflow as CreateWorkflow35, Workflow as Workflow35 } from "@workglow/task-graph";
5002
5099
  var contextSchema = {
5003
5100
  type: "string",
5004
5101
  title: "Context",
@@ -5015,13 +5112,13 @@ var textSchema = {
5015
5112
  description: "The generated text",
5016
5113
  "x-stream": "append"
5017
5114
  };
5018
- var modelSchema23 = TypeModel("model:TextQuestionAnswerTask");
5115
+ var modelSchema24 = TypeModel("model:TextQuestionAnswerTask");
5019
5116
  var TextQuestionAnswerInputSchema = {
5020
5117
  type: "object",
5021
5118
  properties: {
5022
5119
  context: contextSchema,
5023
5120
  question: questionSchema,
5024
- model: modelSchema23
5121
+ model: modelSchema24
5025
5122
  },
5026
5123
  required: ["context", "question", "model"],
5027
5124
  additionalProperties: false
@@ -5050,11 +5147,11 @@ class TextQuestionAnswerTask extends StreamingAiTask {
5050
5147
  var textQuestionAnswer = (input, config) => {
5051
5148
  return new TextQuestionAnswerTask({}, config).run(input);
5052
5149
  };
5053
- Workflow34.prototype.textQuestionAnswer = CreateWorkflow34(TextQuestionAnswerTask);
5150
+ Workflow35.prototype.textQuestionAnswer = CreateWorkflow35(TextQuestionAnswerTask);
5054
5151
 
5055
5152
  // src/task/TextRewriterTask.ts
5056
- import { CreateWorkflow as CreateWorkflow35, Workflow as Workflow35 } from "@workglow/task-graph";
5057
- var modelSchema24 = TypeModel("model:TextRewriterTask");
5153
+ import { CreateWorkflow as CreateWorkflow36, Workflow as Workflow36 } from "@workglow/task-graph";
5154
+ var modelSchema25 = TypeModel("model:TextRewriterTask");
5058
5155
  var TextRewriterInputSchema = {
5059
5156
  type: "object",
5060
5157
  properties: {
@@ -5068,7 +5165,7 @@ var TextRewriterInputSchema = {
5068
5165
  title: "Prompt",
5069
5166
  description: "The prompt to direct the rewriting"
5070
5167
  },
5071
- model: modelSchema24
5168
+ model: modelSchema25
5072
5169
  },
5073
5170
  required: ["text", "prompt", "model"],
5074
5171
  additionalProperties: false
@@ -5102,11 +5199,11 @@ class TextRewriterTask extends StreamingAiTask {
5102
5199
  var textRewriter = (input, config) => {
5103
5200
  return new TextRewriterTask({}, config).run(input);
5104
5201
  };
5105
- Workflow35.prototype.textRewriter = CreateWorkflow35(TextRewriterTask);
5202
+ Workflow36.prototype.textRewriter = CreateWorkflow36(TextRewriterTask);
5106
5203
 
5107
5204
  // src/task/TextTranslationTask.ts
5108
- import { CreateWorkflow as CreateWorkflow36, Workflow as Workflow36 } from "@workglow/task-graph";
5109
- var modelSchema25 = TypeModel("model:TextTranslationTask");
5205
+ import { CreateWorkflow as CreateWorkflow37, Workflow as Workflow37 } from "@workglow/task-graph";
5206
+ var modelSchema26 = TypeModel("model:TextTranslationTask");
5110
5207
  var translationTextSchema = {
5111
5208
  type: "string",
5112
5209
  title: "Text",
@@ -5133,7 +5230,7 @@ var TextTranslationInputSchema = {
5133
5230
  minLength: 2,
5134
5231
  maxLength: 2
5135
5232
  }),
5136
- model: modelSchema25
5233
+ model: modelSchema26
5137
5234
  },
5138
5235
  required: ["text", "source_lang", "target_lang", "model"],
5139
5236
  additionalProperties: false
@@ -5168,13 +5265,13 @@ class TextTranslationTask extends StreamingAiTask {
5168
5265
  var textTranslation = (input, config) => {
5169
5266
  return new TextTranslationTask({}, config).run(input);
5170
5267
  };
5171
- Workflow36.prototype.textTranslation = CreateWorkflow36(TextTranslationTask);
5268
+ Workflow37.prototype.textTranslation = CreateWorkflow37(TextTranslationTask);
5172
5269
 
5173
5270
  // src/task/TopicSegmenterTask.ts
5174
5271
  import {
5175
- CreateWorkflow as CreateWorkflow37,
5272
+ CreateWorkflow as CreateWorkflow38,
5176
5273
  Task as Task14,
5177
- Workflow as Workflow37
5274
+ Workflow as Workflow38
5178
5275
  } from "@workglow/task-graph";
5179
5276
  var SegmentationMethod = {
5180
5277
  HEURISTIC: "heuristic",
@@ -5455,15 +5552,15 @@ class TopicSegmenterTask extends Task14 {
5455
5552
  var topicSegmenter = (input, config) => {
5456
5553
  return new TopicSegmenterTask({}, config).run(input);
5457
5554
  };
5458
- Workflow37.prototype.topicSegmenter = CreateWorkflow37(TopicSegmenterTask);
5555
+ Workflow38.prototype.topicSegmenter = CreateWorkflow38(TopicSegmenterTask);
5459
5556
 
5460
5557
  // src/task/UnloadModelTask.ts
5461
- import { CreateWorkflow as CreateWorkflow38, Workflow as Workflow38 } from "@workglow/task-graph";
5462
- var modelSchema26 = TypeModel("model");
5558
+ import { CreateWorkflow as CreateWorkflow39, Workflow as Workflow39 } from "@workglow/task-graph";
5559
+ var modelSchema27 = TypeModel("model");
5463
5560
  var UnloadModelInputSchema = {
5464
5561
  type: "object",
5465
5562
  properties: {
5466
- model: modelSchema26
5563
+ model: modelSchema27
5467
5564
  },
5468
5565
  required: ["model"],
5469
5566
  additionalProperties: false
@@ -5471,7 +5568,7 @@ var UnloadModelInputSchema = {
5471
5568
  var UnloadModelOutputSchema = {
5472
5569
  type: "object",
5473
5570
  properties: {
5474
- model: modelSchema26
5571
+ model: modelSchema27
5475
5572
  },
5476
5573
  required: ["model"],
5477
5574
  additionalProperties: false
@@ -5493,10 +5590,10 @@ class UnloadModelTask extends AiTask {
5493
5590
  var unloadModel = (input, config) => {
5494
5591
  return new UnloadModelTask({}, config).run(input);
5495
5592
  };
5496
- Workflow38.prototype.unloadModel = CreateWorkflow38(UnloadModelTask);
5593
+ Workflow39.prototype.unloadModel = CreateWorkflow39(UnloadModelTask);
5497
5594
 
5498
5595
  // src/task/VectorQuantizeTask.ts
5499
- import { CreateWorkflow as CreateWorkflow39, Task as Task15, Workflow as Workflow39 } from "@workglow/task-graph";
5596
+ import { CreateWorkflow as CreateWorkflow40, Task as Task15, Workflow as Workflow40 } from "@workglow/task-graph";
5500
5597
  import {
5501
5598
  normalizeNumberArray,
5502
5599
  TensorType,
@@ -5676,10 +5773,10 @@ class VectorQuantizeTask extends Task15 {
5676
5773
  var vectorQuantize = (input, config) => {
5677
5774
  return new VectorQuantizeTask({}, config).run(input);
5678
5775
  };
5679
- Workflow39.prototype.vectorQuantize = CreateWorkflow39(VectorQuantizeTask);
5776
+ Workflow40.prototype.vectorQuantize = CreateWorkflow40(VectorQuantizeTask);
5680
5777
 
5681
5778
  // src/task/VectorSimilarityTask.ts
5682
- import { CreateWorkflow as CreateWorkflow40, GraphAsTask, Workflow as Workflow40 } from "@workglow/task-graph";
5779
+ import { CreateWorkflow as CreateWorkflow41, GraphAsTask, Workflow as Workflow41 } from "@workglow/task-graph";
5683
5780
  import {
5684
5781
  cosineSimilarity,
5685
5782
  hammingSimilarity,
@@ -5785,7 +5882,7 @@ class VectorSimilarityTask extends GraphAsTask {
5785
5882
  var similarity = (input, config) => {
5786
5883
  return new VectorSimilarityTask({}, config).run(input);
5787
5884
  };
5788
- Workflow40.prototype.similarity = CreateWorkflow40(VectorSimilarityTask);
5885
+ Workflow41.prototype.similarity = CreateWorkflow41(VectorSimilarityTask);
5789
5886
 
5790
5887
  // src/task/index.ts
5791
5888
  var registerAiTasks = () => {
@@ -5815,6 +5912,7 @@ var registerAiTasks = () => {
5815
5912
  QueryExpanderTask,
5816
5913
  RerankerTask,
5817
5914
  StructuralParserTask,
5915
+ StructuredGenerationTask,
5818
5916
  TextChunkerTask,
5819
5917
  TextClassificationTask,
5820
5918
  TextEmbeddingTask,
@@ -5850,6 +5948,7 @@ export {
5850
5948
  textEmbedding,
5851
5949
  textClassification,
5852
5950
  textChunker,
5951
+ structuredGeneration,
5853
5952
  structuralParser,
5854
5953
  similarity,
5855
5954
  setGlobalModelRepository,
@@ -5924,6 +6023,9 @@ export {
5924
6023
  TextClassificationOutputSchema,
5925
6024
  TextClassificationInputSchema,
5926
6025
  TextChunkerTask,
6026
+ StructuredGenerationTask,
6027
+ StructuredGenerationOutputSchema,
6028
+ StructuredGenerationInputSchema,
5927
6029
  StructuralParserTask,
5928
6030
  StreamingAiTask,
5929
6031
  SimilarityFn,
@@ -5991,4 +6093,4 @@ export {
5991
6093
  AiJob
5992
6094
  };
5993
6095
 
5994
- //# debugId=8EB68A2DA4788C9664756E2164756E21
6096
+ //# debugId=074733AA4A9EEEC264756E2164756E21