@workglow/ai 0.0.71 → 0.0.72

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 (31) hide show
  1. package/dist/browser.js +779 -218
  2. package/dist/browser.js.map +15 -8
  3. package/dist/bun.js +779 -218
  4. package/dist/bun.js.map +15 -8
  5. package/dist/node.js +779 -218
  6. package/dist/node.js.map +15 -8
  7. package/dist/task/BackgroundRemovalTask.d.ts +351 -0
  8. package/dist/task/BackgroundRemovalTask.d.ts.map +1 -0
  9. package/dist/task/ImageClassificationTask.d.ts +410 -0
  10. package/dist/task/ImageClassificationTask.d.ts.map +1 -0
  11. package/dist/task/ImageEmbeddingTask.d.ts +503 -0
  12. package/dist/task/ImageEmbeddingTask.d.ts.map +1 -0
  13. package/dist/task/ImageSegmentationTask.d.ts +423 -0
  14. package/dist/task/ImageSegmentationTask.d.ts.map +1 -0
  15. package/dist/task/ImageToTextTask.d.ts +355 -0
  16. package/dist/task/ImageToTextTask.d.ts.map +1 -0
  17. package/dist/task/ObjectDetectionTask.d.ts +476 -0
  18. package/dist/task/ObjectDetectionTask.d.ts.map +1 -0
  19. package/dist/task/{TextClassifierTask.d.ts → TextClassificationTask.d.ts} +23 -12
  20. package/dist/task/TextClassificationTask.d.ts.map +1 -0
  21. package/dist/task/TextFillMaskTask.d.ts.map +1 -1
  22. package/dist/task/TextNamedEntityRecognitionTask.d.ts.map +1 -1
  23. package/dist/task/base/AiTask.d.ts.map +1 -1
  24. package/dist/task/base/AiTaskSchemas.d.ts +153 -0
  25. package/dist/task/base/AiTaskSchemas.d.ts.map +1 -1
  26. package/dist/task/base/AiVisionTask.d.ts +33 -0
  27. package/dist/task/base/AiVisionTask.d.ts.map +1 -0
  28. package/dist/task/index.d.ts +7 -1
  29. package/dist/task/index.d.ts.map +1 -1
  30. package/package.json +9 -9
  31. package/dist/task/TextClassifierTask.d.ts.map +0 -1
package/dist/bun.js CHANGED
@@ -447,6 +447,249 @@ class DocumentConverterText extends DocumentConverter {
447
447
  return new Document(this.text, this.metadata);
448
448
  }
449
449
  }
450
+ // src/task/BackgroundRemovalTask.ts
451
+ import { CreateWorkflow, TaskRegistry, Workflow } from "@workglow/task-graph";
452
+
453
+ // src/task/base/AiTaskSchemas.ts
454
+ import {
455
+ FromSchemaDefaultOptions
456
+ } from "@workglow/util";
457
+ var TypedArrayType = null;
458
+ var TypedArraySchemaOptions = {
459
+ ...FromSchemaDefaultOptions,
460
+ deserialize: [
461
+ {
462
+ pattern: { format: "TypedArray" },
463
+ output: TypedArrayType
464
+ }
465
+ ]
466
+ };
467
+ var TypedArraySchema = (annotations = {}) => ({
468
+ oneOf: [
469
+ {
470
+ type: "array",
471
+ items: { type: "number", format: "Float64" },
472
+ title: "Float64Array",
473
+ description: "A 64-bit floating point array",
474
+ format: "Float64Array"
475
+ },
476
+ {
477
+ type: "array",
478
+ items: { type: "number", format: "Float32" },
479
+ title: "Float32Array",
480
+ description: "A 32-bit floating point array",
481
+ format: "Float32Array"
482
+ },
483
+ {
484
+ type: "array",
485
+ items: { type: "number", format: "Int32" },
486
+ title: "Int32Array",
487
+ description: "A 32-bit integer array",
488
+ format: "Int32Array"
489
+ },
490
+ {
491
+ type: "array",
492
+ items: { type: "number", format: "Int16" },
493
+ title: "Int16Array",
494
+ description: "A 16-bit integer array",
495
+ format: "Int16Array"
496
+ },
497
+ {
498
+ type: "array",
499
+ items: { type: "number", format: "Int8" },
500
+ title: "Int8Array"
501
+ },
502
+ {
503
+ type: "array",
504
+ items: { type: "number", format: "Uint8" },
505
+ title: "Uint8Array",
506
+ description: "A 8-bit unsigned integer array",
507
+ format: "Uint8Array"
508
+ },
509
+ {
510
+ type: "array",
511
+ items: { type: "number", format: "Uint16" },
512
+ title: "Uint16Array",
513
+ description: "A 16-bit unsigned integer array",
514
+ format: "Uint16Array"
515
+ },
516
+ {
517
+ type: "array",
518
+ items: { type: "number", format: "Uint32" },
519
+ title: "Uint32Array",
520
+ description: "A 32-bit unsigned integer array",
521
+ format: "Uint32Array"
522
+ },
523
+ {
524
+ type: "array",
525
+ items: { type: "number", format: "Uint8Clamped" },
526
+ title: "Uint8ClampedArray",
527
+ description: "A 8-bit unsigned integer array with values clamped to 0-255",
528
+ format: "Uint8ClampedArray"
529
+ }
530
+ ],
531
+ format: "TypedArray",
532
+ ...annotations
533
+ });
534
+ var TypeLanguage = (annotations = {}) => ({
535
+ type: "string",
536
+ title: "Language",
537
+ description: "The language to use",
538
+ maxLength: 2,
539
+ minLength: 2,
540
+ ...annotations
541
+ });
542
+ function TypeModelAsString(semantic = "model", options = {}) {
543
+ if (semantic !== "model" && !semantic.startsWith("model:")) {
544
+ throw new Error("Invalid semantic value");
545
+ }
546
+ const taskName = semantic.startsWith("model:") ? semantic.slice(6).replace(/Task$/, "").replaceAll(/[A-Z]/g, (char) => " " + char.toLowerCase()).trim() : null;
547
+ return {
548
+ title: "Model",
549
+ description: `The model ${taskName ? `for ${taskName} ` : "to use"}`,
550
+ ...options,
551
+ format: semantic,
552
+ type: "string"
553
+ };
554
+ }
555
+ function TypeModelByDetail(semantic = "model", options = {}) {
556
+ if (semantic !== "model" && !semantic.startsWith("model:")) {
557
+ throw new Error("Invalid semantic value");
558
+ }
559
+ return {
560
+ ...ModelSchema,
561
+ ...options,
562
+ format: semantic
563
+ };
564
+ }
565
+ function TypeModel(semantic = "model", options = {}) {
566
+ return {
567
+ oneOf: [TypeModelAsString(semantic, options), TypeModelByDetail(semantic, options)],
568
+ ...options,
569
+ format: semantic
570
+ };
571
+ }
572
+ var TypeReplicateArray = (type, annotations = {}) => ({
573
+ oneOf: [type, { type: "array", items: type }],
574
+ title: type.title,
575
+ description: type.description,
576
+ ...type.format ? { format: type.format } : {},
577
+ ...annotations,
578
+ "x-replicate": true
579
+ });
580
+ var TypeImageInput = {
581
+ oneOf: [
582
+ {
583
+ type: "string",
584
+ title: "Image Data",
585
+ description: "Image as data-uri"
586
+ },
587
+ {
588
+ type: "object",
589
+ additionalProperties: false,
590
+ properties: {
591
+ data: {
592
+ oneOf: [
593
+ {
594
+ type: "object",
595
+ format: "image:ImageBitmap",
596
+ title: "ImageBitmap"
597
+ },
598
+ {
599
+ type: "object",
600
+ format: "image:OffscreenCanvas",
601
+ title: "OffscreenCanvas"
602
+ },
603
+ {
604
+ type: "object",
605
+ format: "image:VideoFrame",
606
+ title: "VideoFrame"
607
+ },
608
+ {
609
+ type: "object",
610
+ properties: {
611
+ data: {
612
+ type: "array",
613
+ items: { type: "number", format: "Uint8Clamped" },
614
+ format: "Uint8ClampedArray",
615
+ title: "Data",
616
+ description: "Data of the image"
617
+ },
618
+ width: { type: "number", title: "Width", description: "Width of the image" },
619
+ height: { type: "number", title: "Height", description: "Height of the image" },
620
+ channels: {
621
+ type: "number",
622
+ title: "Channels",
623
+ description: "Channels of the image"
624
+ },
625
+ rawChannels: {
626
+ type: "number",
627
+ title: "Raw Channels",
628
+ description: "Raw channels of the image"
629
+ }
630
+ },
631
+ additionalProperties: false,
632
+ required: ["data", "width", "height", "channels"],
633
+ format: "image:ImageBinary",
634
+ title: "ImageBinary"
635
+ }
636
+ ]
637
+ },
638
+ width: { type: "number", title: "Width", description: "Width of the image" },
639
+ height: { type: "number", title: "Height", description: "Height of the image" },
640
+ channels: {
641
+ type: "number",
642
+ title: "Channels",
643
+ description: "Channels of the image",
644
+ minimum: 1,
645
+ maximum: 4
646
+ }
647
+ },
648
+ required: ["data", "width", "height", "channels"]
649
+ }
650
+ ],
651
+ title: "Image",
652
+ description: "Image as URL or base64-encoded data"
653
+ };
654
+ var TypeAudioInput = {
655
+ type: "string",
656
+ title: "Audio",
657
+ description: "Audio as data-uri, or Blob"
658
+ };
659
+ var TypeBoundingBox = {
660
+ type: "object",
661
+ properties: {
662
+ x: { type: "number", title: "X coordinate", description: "Left edge of the bounding box" },
663
+ y: { type: "number", title: "Y coordinate", description: "Top edge of the bounding box" },
664
+ width: { type: "number", title: "Width", description: "Width of the bounding box" },
665
+ height: { type: "number", title: "Height", description: "Height of the bounding box" }
666
+ },
667
+ required: ["x", "y", "width", "height"],
668
+ additionalProperties: false,
669
+ title: "Bounding Box",
670
+ description: "Bounding box coordinates"
671
+ };
672
+ var TypeCategory = {
673
+ type: "object",
674
+ properties: {
675
+ label: { type: "string", title: "Label", description: "Category label" },
676
+ score: {
677
+ type: "number",
678
+ title: "Confidence Score",
679
+ description: "Confidence score between 0 and 1",
680
+ minimum: 0,
681
+ maximum: 1
682
+ }
683
+ },
684
+ required: ["label", "score"],
685
+ additionalProperties: false,
686
+ title: "Category",
687
+ description: "Classification category with label and score"
688
+ };
689
+
690
+ // src/task/base/AiVisionTask.ts
691
+ import { convertImageDataToUseableForm } from "@workglow/util";
692
+
450
693
  // src/task/base/AiTask.ts
451
694
  import {
452
695
  JobQueueTask,
@@ -566,139 +809,84 @@ class AiTask extends JobQueueTask {
566
809
  return input;
567
810
  }
568
811
  }
569
- // src/task/base/AiTaskSchemas.ts
570
- import {
571
- FromSchemaDefaultOptions
572
- } from "@workglow/util";
573
- var TypedArrayType = null;
574
- var TypedArraySchemaOptions = {
575
- ...FromSchemaDefaultOptions,
576
- deserialize: [
577
- {
578
- pattern: { format: "TypedArray" },
579
- output: TypedArrayType
580
- }
581
- ]
582
- };
583
- var TypedArraySchema = (annotations = {}) => ({
584
- oneOf: [
585
- {
586
- type: "array",
587
- items: { type: "number", format: "Float64" },
588
- title: "Float64Array",
589
- description: "A 64-bit floating point array",
590
- format: "Float64Array"
591
- },
592
- {
593
- type: "array",
594
- items: { type: "number", format: "Float32" },
595
- title: "Float32Array",
596
- description: "A 32-bit floating point array",
597
- format: "Float32Array"
598
- },
599
- {
600
- type: "array",
601
- items: { type: "number", format: "Int32" },
602
- title: "Int32Array",
603
- description: "A 32-bit integer array",
604
- format: "Int32Array"
605
- },
606
- {
607
- type: "array",
608
- items: { type: "number", format: "Int16" },
609
- title: "Int16Array",
610
- description: "A 16-bit integer array",
611
- format: "Int16Array"
612
- },
613
- {
614
- type: "array",
615
- items: { type: "number", format: "Int8" },
616
- title: "Int8Array"
617
- },
618
- {
619
- type: "array",
620
- items: { type: "number", format: "Uint8" },
621
- title: "Uint8Array",
622
- description: "A 8-bit unsigned integer array",
623
- format: "Uint8Array"
624
- },
625
- {
626
- type: "array",
627
- items: { type: "number", format: "Uint16" },
628
- title: "Uint16Array",
629
- description: "A 16-bit unsigned integer array",
630
- format: "Uint16Array"
631
- },
632
- {
633
- type: "array",
634
- items: { type: "number", format: "Uint32" },
635
- title: "Uint32Array",
636
- description: "A 32-bit unsigned integer array",
637
- format: "Uint32Array"
638
- },
639
- {
640
- type: "array",
641
- items: { type: "number", format: "Uint8Clamped" },
642
- title: "Uint8ClampedArray",
643
- description: "A 8-bit unsigned integer array with values clamped to 0-255",
644
- format: "Uint8ClampedArray"
812
+
813
+ // src/task/base/AiVisionTask.ts
814
+ class AiVisionTask extends AiTask {
815
+ static type = "AiVisionTask";
816
+ async getJobInput(input) {
817
+ const jobInput = await super.getJobInput(input);
818
+ const registeredQueue = await this.resolveQueue(input);
819
+ const queueName = registeredQueue?.server.queueName;
820
+ const supports = ["Blob"];
821
+ if (input.image) {
822
+ if ("OffscreenCanvas" in globalThis) {
823
+ supports.push("OffscreenCanvas");
824
+ } else if (queueName === "TENSORFLOW_MEDIAPIPE" && "ImageBitmap" in globalThis) {
825
+ supports.push("ImageBitmap");
826
+ } else if (queueName === "TENSORFLOW_MEDIAPIPE" && "VideoFrame" in globalThis) {
827
+ supports.push("VideoFrame");
828
+ }
829
+ const image = await convertImageDataToUseableForm(input.image, supports);
830
+ jobInput.taskInput.image = image;
645
831
  }
646
- ],
647
- format: "TypedArray",
648
- ...annotations
649
- });
650
- var TypeLanguage = (annotations = {}) => ({
651
- type: "string",
652
- title: "Language",
653
- description: "The language to use",
654
- maxLength: 2,
655
- minLength: 2,
656
- ...annotations
657
- });
658
- function TypeModelAsString(semantic = "model", options = {}) {
659
- if (semantic !== "model" && !semantic.startsWith("model:")) {
660
- throw new Error("Invalid semantic value");
832
+ return jobInput;
661
833
  }
662
- const taskName = semantic.startsWith("model:") ? semantic.slice(6).replace(/Task$/, "").replaceAll(/[A-Z]/g, (char) => " " + char.toLowerCase()).trim() : null;
663
- return {
664
- title: "Model",
665
- description: `The model ${taskName ? `for ${taskName} ` : "to use"}`,
666
- ...options,
667
- format: semantic,
668
- type: "string"
669
- };
670
834
  }
671
- function TypeModelByDetail(semantic = "model", options = {}) {
672
- if (semantic !== "model" && !semantic.startsWith("model:")) {
673
- throw new Error("Invalid semantic value");
835
+
836
+ // src/task/BackgroundRemovalTask.ts
837
+ var modelSchema = TypeReplicateArray(TypeModel("model:BackgroundRemovalTask"));
838
+ var processedImageSchema = {
839
+ type: "string",
840
+ contentEncoding: "base64",
841
+ contentMediaType: "image/png",
842
+ title: "Image",
843
+ description: "Base64-encoded PNG image with transparent background"
844
+ };
845
+ var BackgroundRemovalInputSchema = {
846
+ type: "object",
847
+ properties: {
848
+ image: TypeReplicateArray(TypeImageInput),
849
+ model: modelSchema
850
+ },
851
+ required: ["image", "model"],
852
+ additionalProperties: false
853
+ };
854
+ var BackgroundRemovalOutputSchema = {
855
+ type: "object",
856
+ properties: {
857
+ image: {
858
+ oneOf: [processedImageSchema, { type: "array", items: processedImageSchema }],
859
+ title: processedImageSchema.title,
860
+ description: processedImageSchema.description
861
+ }
862
+ },
863
+ required: ["image"],
864
+ additionalProperties: false
865
+ };
866
+
867
+ class BackgroundRemovalTask extends AiVisionTask {
868
+ static type = "BackgroundRemovalTask";
869
+ static category = "AI Vision Model";
870
+ static title = "Background Removal";
871
+ static description = "Removes backgrounds from images, producing images with transparent backgrounds";
872
+ static inputSchema() {
873
+ return BackgroundRemovalInputSchema;
874
+ }
875
+ static outputSchema() {
876
+ return BackgroundRemovalOutputSchema;
674
877
  }
675
- return {
676
- ...ModelSchema,
677
- ...options,
678
- format: semantic
679
- };
680
- }
681
- function TypeModel(semantic = "model", options = {}) {
682
- return {
683
- oneOf: [TypeModelAsString(semantic, options), TypeModelByDetail(semantic, options)],
684
- ...options,
685
- format: semantic
686
- };
687
878
  }
688
- var TypeReplicateArray = (type, annotations = {}) => ({
689
- oneOf: [type, { type: "array", items: type }],
690
- title: type.title,
691
- description: type.description,
692
- ...type.format ? { format: type.format } : {},
693
- ...annotations,
694
- "x-replicate": true
695
- });
879
+ TaskRegistry.registerTask(BackgroundRemovalTask);
880
+ var BackgroundRemoval = (input, config) => {
881
+ return new BackgroundRemovalTask(input, config).run();
882
+ };
883
+ Workflow.prototype.BackgroundRemoval = CreateWorkflow(BackgroundRemovalTask);
696
884
  // src/task/DocumentSplitterTask.ts
697
885
  import {
698
- CreateWorkflow,
886
+ CreateWorkflow as CreateWorkflow2,
699
887
  Task,
700
- TaskRegistry,
701
- Workflow
888
+ TaskRegistry as TaskRegistry2,
889
+ Workflow as Workflow2
702
890
  } from "@workglow/task-graph";
703
891
  var inputSchema = {
704
892
  type: "object",
@@ -753,18 +941,18 @@ class DocumentSplitterTask extends Task {
753
941
  return { texts: this.flattenFragmentsToTexts(this.runInputData.file) };
754
942
  }
755
943
  }
756
- TaskRegistry.registerTask(DocumentSplitterTask);
944
+ TaskRegistry2.registerTask(DocumentSplitterTask);
757
945
  var DocumentSplitter = (input) => {
758
946
  return new DocumentSplitterTask(input).run();
759
947
  };
760
- Workflow.prototype.DocumentSplitter = CreateWorkflow(DocumentSplitterTask);
948
+ Workflow2.prototype.DocumentSplitter = CreateWorkflow2(DocumentSplitterTask);
761
949
  // src/task/DownloadModelTask.ts
762
- import { CreateWorkflow as CreateWorkflow2, TaskRegistry as TaskRegistry2, Workflow as Workflow2 } from "@workglow/task-graph";
763
- var modelSchema = TypeReplicateArray(TypeModel("model"));
950
+ import { CreateWorkflow as CreateWorkflow3, TaskRegistry as TaskRegistry3, Workflow as Workflow3 } from "@workglow/task-graph";
951
+ var modelSchema2 = TypeReplicateArray(TypeModel("model"));
764
952
  var DownloadModelInputSchema = {
765
953
  type: "object",
766
954
  properties: {
767
- model: modelSchema
955
+ model: modelSchema2
768
956
  },
769
957
  required: ["model"],
770
958
  additionalProperties: false
@@ -772,7 +960,7 @@ var DownloadModelInputSchema = {
772
960
  var DownloadModelOutputSchema = {
773
961
  type: "object",
774
962
  properties: {
775
- model: modelSchema
963
+ model: modelSchema2
776
964
  },
777
965
  required: ["model"],
778
966
  additionalProperties: false
@@ -812,15 +1000,350 @@ class DownloadModelTask extends AiTask {
812
1000
  }
813
1001
  }
814
1002
  }
815
- TaskRegistry2.registerTask(DownloadModelTask);
1003
+ TaskRegistry3.registerTask(DownloadModelTask);
816
1004
  var DownloadModel = (input, config) => {
817
1005
  return new DownloadModelTask(input, config).run();
818
1006
  };
819
- Workflow2.prototype.DownloadModel = CreateWorkflow2(DownloadModelTask);
820
- // src/task/TextClassifierTask.ts
821
- import { CreateWorkflow as CreateWorkflow3, TaskRegistry as TaskRegistry3, Workflow as Workflow3 } from "@workglow/task-graph";
822
- var modelSchema2 = TypeReplicateArray(TypeModel("model:TextClassifierTask"));
823
- var TextClassifierInputSchema = {
1007
+ Workflow3.prototype.DownloadModel = CreateWorkflow3(DownloadModelTask);
1008
+ // src/task/ImageClassificationTask.ts
1009
+ import { CreateWorkflow as CreateWorkflow4, TaskRegistry as TaskRegistry4, Workflow as Workflow4 } from "@workglow/task-graph";
1010
+ var modelSchema3 = TypeReplicateArray(TypeModel("model:ImageClassificationTask"));
1011
+ var ImageClassificationInputSchema = {
1012
+ type: "object",
1013
+ properties: {
1014
+ image: TypeReplicateArray(TypeImageInput),
1015
+ model: modelSchema3,
1016
+ categories: {
1017
+ type: "array",
1018
+ items: {
1019
+ type: "string"
1020
+ },
1021
+ title: "Categories",
1022
+ description: "List of candidate categories (optional, if provided uses zero-shot classification)",
1023
+ "x-ui-group": "Configuration"
1024
+ },
1025
+ maxCategories: {
1026
+ type: "number",
1027
+ minimum: 1,
1028
+ maximum: 1000,
1029
+ default: 5,
1030
+ title: "Max Categories",
1031
+ description: "The maximum number of categories to return",
1032
+ "x-ui-group": "Configuration"
1033
+ }
1034
+ },
1035
+ required: ["image", "model"],
1036
+ additionalProperties: false
1037
+ };
1038
+ var ImageClassificationOutputSchema = {
1039
+ type: "object",
1040
+ properties: {
1041
+ categories: {
1042
+ oneOf: [
1043
+ { type: "array", items: TypeCategory },
1044
+ { type: "array", items: { type: "array", items: TypeCategory } }
1045
+ ],
1046
+ title: "Categories",
1047
+ description: "The classification categories with their scores"
1048
+ }
1049
+ },
1050
+ required: ["categories"],
1051
+ additionalProperties: false
1052
+ };
1053
+
1054
+ class ImageClassificationTask extends AiVisionTask {
1055
+ static type = "ImageClassificationTask";
1056
+ static category = "AI Vision Model";
1057
+ static title = "Image Classification";
1058
+ static description = "Classifies images into categories using vision models. Supports zero-shot classification when categories are provided.";
1059
+ static inputSchema() {
1060
+ return ImageClassificationInputSchema;
1061
+ }
1062
+ static outputSchema() {
1063
+ return ImageClassificationOutputSchema;
1064
+ }
1065
+ }
1066
+ TaskRegistry4.registerTask(ImageClassificationTask);
1067
+ var ImageClassification = (input, config) => {
1068
+ return new ImageClassificationTask(input, config).run();
1069
+ };
1070
+ Workflow4.prototype.ImageClassification = CreateWorkflow4(ImageClassificationTask);
1071
+ // src/task/ImageEmbeddingTask.ts
1072
+ import { CreateWorkflow as CreateWorkflow5, TaskRegistry as TaskRegistry5, Workflow as Workflow5 } from "@workglow/task-graph";
1073
+ var modelSchema4 = TypeReplicateArray(TypeModel("model:ImageEmbeddingTask"));
1074
+ var embeddingSchema = TypedArraySchema({
1075
+ title: "Embedding",
1076
+ description: "The image embedding vector"
1077
+ });
1078
+ var ImageEmbeddingInputSchema = {
1079
+ type: "object",
1080
+ properties: {
1081
+ image: TypeReplicateArray(TypeImageInput),
1082
+ model: modelSchema4
1083
+ },
1084
+ required: ["image", "model"],
1085
+ additionalProperties: false
1086
+ };
1087
+ var ImageEmbeddingOutputSchema = {
1088
+ type: "object",
1089
+ properties: {
1090
+ vector: {
1091
+ oneOf: [embeddingSchema, { type: "array", items: embeddingSchema }],
1092
+ title: "Embedding",
1093
+ description: "The image embedding vector"
1094
+ }
1095
+ },
1096
+ required: ["vector"],
1097
+ additionalProperties: false
1098
+ };
1099
+
1100
+ class ImageEmbeddingTask extends AiVisionTask {
1101
+ static type = "ImageEmbeddingTask";
1102
+ static category = "AI Vision Model";
1103
+ static title = "Image Embedding";
1104
+ static description = "Generates embeddings from images using vision models";
1105
+ static inputSchema() {
1106
+ return ImageEmbeddingInputSchema;
1107
+ }
1108
+ static outputSchema() {
1109
+ return ImageEmbeddingOutputSchema;
1110
+ }
1111
+ }
1112
+ TaskRegistry5.registerTask(ImageEmbeddingTask);
1113
+ var ImageEmbedding = (input, config) => {
1114
+ return new ImageEmbeddingTask(input, config).run();
1115
+ };
1116
+ Workflow5.prototype.ImageEmbedding = CreateWorkflow5(ImageEmbeddingTask);
1117
+ // src/task/ImageSegmentationTask.ts
1118
+ import { CreateWorkflow as CreateWorkflow6, TaskRegistry as TaskRegistry6, Workflow as Workflow6 } from "@workglow/task-graph";
1119
+ var modelSchema5 = TypeReplicateArray(TypeModel("model:ImageSegmentationTask"));
1120
+ var ImageSegmentationInputSchema = {
1121
+ type: "object",
1122
+ properties: {
1123
+ image: TypeReplicateArray(TypeImageInput),
1124
+ model: modelSchema5,
1125
+ threshold: {
1126
+ type: "number",
1127
+ title: "Threshold",
1128
+ description: "The threshold for filtering masks by score",
1129
+ minimum: 0,
1130
+ maximum: 1,
1131
+ default: 0.5,
1132
+ "x-ui-group": "Configuration"
1133
+ },
1134
+ maskThreshold: {
1135
+ type: "number",
1136
+ title: "Mask Threshold",
1137
+ description: "Threshold to use when turning predicted masks into binary values",
1138
+ minimum: 0,
1139
+ maximum: 1,
1140
+ default: 0.5,
1141
+ "x-ui-group": "Configuration"
1142
+ }
1143
+ },
1144
+ required: ["image", "model"],
1145
+ additionalProperties: false
1146
+ };
1147
+ var segmentationMaskSchema = {
1148
+ type: "object",
1149
+ properties: {
1150
+ label: {
1151
+ type: "string",
1152
+ title: "Label",
1153
+ description: "The label of the segmented region"
1154
+ },
1155
+ score: {
1156
+ type: "number",
1157
+ title: "Score",
1158
+ description: "The confidence score for this segmentation",
1159
+ minimum: 0,
1160
+ maximum: 1
1161
+ },
1162
+ mask: {
1163
+ type: "object",
1164
+ format: "image",
1165
+ title: "Mask",
1166
+ description: "Mask image"
1167
+ }
1168
+ },
1169
+ required: ["label", "score", "mask"],
1170
+ additionalProperties: false
1171
+ };
1172
+ var ImageSegmentationOutputSchema = {
1173
+ type: "object",
1174
+ properties: {
1175
+ masks: {
1176
+ oneOf: [
1177
+ { type: "array", items: segmentationMaskSchema },
1178
+ { type: "array", items: { type: "array", items: segmentationMaskSchema } }
1179
+ ],
1180
+ title: "Segmentation Masks",
1181
+ description: "The segmented regions with their labels, scores, and masks"
1182
+ }
1183
+ },
1184
+ required: ["masks"],
1185
+ additionalProperties: false
1186
+ };
1187
+
1188
+ class ImageSegmentationTask extends AiVisionTask {
1189
+ static type = "ImageSegmentationTask";
1190
+ static category = "AI Vision Model";
1191
+ static title = "Image Segmentation";
1192
+ static description = "Segments images into regions with labels using computer vision models";
1193
+ static inputSchema() {
1194
+ return ImageSegmentationInputSchema;
1195
+ }
1196
+ static outputSchema() {
1197
+ return ImageSegmentationOutputSchema;
1198
+ }
1199
+ }
1200
+ TaskRegistry6.registerTask(ImageSegmentationTask);
1201
+ var ImageSegmentation = (input, config) => {
1202
+ return new ImageSegmentationTask(input, config).run();
1203
+ };
1204
+ Workflow6.prototype.ImageSegmentation = CreateWorkflow6(ImageSegmentationTask);
1205
+ // src/task/ImageToTextTask.ts
1206
+ import { CreateWorkflow as CreateWorkflow7, TaskRegistry as TaskRegistry7, Workflow as Workflow7 } from "@workglow/task-graph";
1207
+ var modelSchema6 = TypeReplicateArray(TypeModel("model:ImageToTextTask"));
1208
+ var generatedTextSchema = {
1209
+ type: "string",
1210
+ title: "Text",
1211
+ description: "The generated text description"
1212
+ };
1213
+ var ImageToTextInputSchema = {
1214
+ type: "object",
1215
+ properties: {
1216
+ image: TypeReplicateArray(TypeImageInput),
1217
+ model: modelSchema6,
1218
+ maxTokens: {
1219
+ type: "number",
1220
+ title: "Max Tokens",
1221
+ description: "The maximum number of tokens to generate",
1222
+ minimum: 1,
1223
+ maximum: 4096,
1224
+ "x-ui-group": "Configuration"
1225
+ }
1226
+ },
1227
+ required: ["image", "model"],
1228
+ additionalProperties: false
1229
+ };
1230
+ var ImageToTextOutputSchema = {
1231
+ type: "object",
1232
+ properties: {
1233
+ text: {
1234
+ oneOf: [generatedTextSchema, { type: "array", items: generatedTextSchema }],
1235
+ title: generatedTextSchema.title,
1236
+ description: generatedTextSchema.description
1237
+ }
1238
+ },
1239
+ required: ["text"],
1240
+ additionalProperties: false
1241
+ };
1242
+
1243
+ class ImageToTextTask extends AiVisionTask {
1244
+ static type = "ImageToTextTask";
1245
+ static category = "AI Vision Model";
1246
+ static title = "Image to Text";
1247
+ static description = "Generates text descriptions from images using vision-language models";
1248
+ static inputSchema() {
1249
+ return ImageToTextInputSchema;
1250
+ }
1251
+ static outputSchema() {
1252
+ return ImageToTextOutputSchema;
1253
+ }
1254
+ }
1255
+ TaskRegistry7.registerTask(ImageToTextTask);
1256
+ var ImageToText = (input, config) => {
1257
+ return new ImageToTextTask(input, config).run();
1258
+ };
1259
+ Workflow7.prototype.ImageToText = CreateWorkflow7(ImageToTextTask);
1260
+ // src/task/ObjectDetectionTask.ts
1261
+ import { CreateWorkflow as CreateWorkflow8, TaskRegistry as TaskRegistry8, Workflow as Workflow8 } from "@workglow/task-graph";
1262
+ var modelSchema7 = TypeReplicateArray(TypeModel("model:ObjectDetectionTask"));
1263
+ var detectionSchema = {
1264
+ type: "object",
1265
+ properties: {
1266
+ label: {
1267
+ type: "string",
1268
+ title: "Label",
1269
+ description: "The label of the detected object"
1270
+ },
1271
+ score: {
1272
+ type: "number",
1273
+ title: "Confidence Score",
1274
+ description: "The confidence score for this detection",
1275
+ minimum: 0,
1276
+ maximum: 1
1277
+ },
1278
+ box: TypeBoundingBox
1279
+ },
1280
+ required: ["label", "score", "box"],
1281
+ additionalProperties: false
1282
+ };
1283
+ var ObjectDetectionInputSchema = {
1284
+ type: "object",
1285
+ properties: {
1286
+ image: TypeReplicateArray(TypeImageInput),
1287
+ model: modelSchema7,
1288
+ labels: {
1289
+ type: "array",
1290
+ items: {
1291
+ type: "string"
1292
+ },
1293
+ title: "Labels",
1294
+ description: "List of object labels to detect (optional, if provided uses zero-shot detection)",
1295
+ "x-ui-group": "Configuration"
1296
+ },
1297
+ threshold: {
1298
+ type: "number",
1299
+ title: "Threshold",
1300
+ description: "The threshold for filtering detections by score",
1301
+ minimum: 0,
1302
+ maximum: 1,
1303
+ default: 0.5,
1304
+ "x-ui-group": "Configuration"
1305
+ }
1306
+ },
1307
+ required: ["image", "model"],
1308
+ additionalProperties: false
1309
+ };
1310
+ var ObjectDetectionOutputSchema = {
1311
+ type: "object",
1312
+ properties: {
1313
+ detections: {
1314
+ oneOf: [
1315
+ { type: "array", items: detectionSchema },
1316
+ { type: "array", items: { type: "array", items: detectionSchema } }
1317
+ ],
1318
+ title: "Detections",
1319
+ description: "The detected objects with their labels, scores, and bounding boxes"
1320
+ }
1321
+ },
1322
+ required: ["detections"],
1323
+ additionalProperties: false
1324
+ };
1325
+
1326
+ class ObjectDetectionTask extends AiVisionTask {
1327
+ static type = "ObjectDetectionTask";
1328
+ static category = "AI Vision Model";
1329
+ static title = "Object Detection";
1330
+ static description = "Detects objects in images using vision models. Supports zero-shot detection when labels are provided.";
1331
+ static inputSchema() {
1332
+ return ObjectDetectionInputSchema;
1333
+ }
1334
+ static outputSchema() {
1335
+ return ObjectDetectionOutputSchema;
1336
+ }
1337
+ }
1338
+ TaskRegistry8.registerTask(ObjectDetectionTask);
1339
+ var ObjectDetection = (input, config) => {
1340
+ return new ObjectDetectionTask(input, config).run();
1341
+ };
1342
+ Workflow8.prototype.ObjectDetection = CreateWorkflow8(ObjectDetectionTask);
1343
+ // src/task/TextClassificationTask.ts
1344
+ import { CreateWorkflow as CreateWorkflow9, TaskRegistry as TaskRegistry9, Workflow as Workflow9 } from "@workglow/task-graph";
1345
+ var modelSchema8 = TypeReplicateArray(TypeModel("model:TextClassificationTask"));
1346
+ var TextClassificationInputSchema = {
824
1347
  type: "object",
825
1348
  properties: {
826
1349
  text: TypeReplicateArray({
@@ -828,20 +1351,30 @@ var TextClassifierInputSchema = {
828
1351
  title: "Text",
829
1352
  description: "The text to classify"
830
1353
  }),
1354
+ candidateLabels: {
1355
+ type: "array",
1356
+ items: {
1357
+ type: "string"
1358
+ },
1359
+ title: "Candidate Labels",
1360
+ description: "List of candidate labels (optional, if provided uses zero-shot classification)",
1361
+ "x-ui-group": "Configuration"
1362
+ },
831
1363
  maxCategories: {
832
1364
  type: "number",
833
1365
  minimum: 1,
834
1366
  maximum: 1000,
835
1367
  default: 5,
836
1368
  title: "Max Categories",
837
- description: "The maximum number of categories to return"
1369
+ description: "The maximum number of categories to return",
1370
+ "x-ui-group": "Configuration"
838
1371
  },
839
- model: modelSchema2
1372
+ model: modelSchema8
840
1373
  },
841
1374
  required: ["text", "model"],
842
1375
  additionalProperties: false
843
1376
  };
844
- var TextClassifierOutputSchema = {
1377
+ var TextClassificationOutputSchema = {
845
1378
  type: "object",
846
1379
  properties: {
847
1380
  categories: {
@@ -871,26 +1404,26 @@ var TextClassifierOutputSchema = {
871
1404
  additionalProperties: false
872
1405
  };
873
1406
 
874
- class TextClassifierTask extends AiTask {
875
- static type = "TextClassifierTask";
1407
+ class TextClassificationTask extends AiTask {
1408
+ static type = "TextClassificationTask";
876
1409
  static category = "AI Text Model";
877
1410
  static title = "Text Classifier";
878
- static description = "Classifies text into predefined categories using language models";
1411
+ static description = "Classifies text into categories using language models. Supports zero-shot classification when candidate labels are provided.";
879
1412
  static inputSchema() {
880
- return TextClassifierInputSchema;
1413
+ return TextClassificationInputSchema;
881
1414
  }
882
1415
  static outputSchema() {
883
- return TextClassifierOutputSchema;
1416
+ return TextClassificationOutputSchema;
884
1417
  }
885
1418
  }
886
- TaskRegistry3.registerTask(TextClassifierTask);
887
- var TextClassifier = (input, config) => {
888
- return new TextClassifierTask(input, config).run();
1419
+ TaskRegistry9.registerTask(TextClassificationTask);
1420
+ var TextClassification = (input, config) => {
1421
+ return new TextClassificationTask(input, config).run();
889
1422
  };
890
- Workflow3.prototype.TextClassifier = CreateWorkflow3(TextClassifierTask);
1423
+ Workflow9.prototype.TextClassification = CreateWorkflow9(TextClassificationTask);
891
1424
  // src/task/TextEmbeddingTask.ts
892
- import { CreateWorkflow as CreateWorkflow4, TaskRegistry as TaskRegistry4, Workflow as Workflow4 } from "@workglow/task-graph";
893
- var modelSchema3 = TypeReplicateArray(TypeModel("model:TextEmbeddingTask"));
1425
+ import { CreateWorkflow as CreateWorkflow10, TaskRegistry as TaskRegistry10, Workflow as Workflow10 } from "@workglow/task-graph";
1426
+ var modelSchema9 = TypeReplicateArray(TypeModel("model:TextEmbeddingTask"));
894
1427
  var TextEmbeddingInputSchema = {
895
1428
  type: "object",
896
1429
  properties: {
@@ -899,7 +1432,7 @@ var TextEmbeddingInputSchema = {
899
1432
  title: "Text",
900
1433
  description: "The text to embed"
901
1434
  }),
902
- model: modelSchema3
1435
+ model: modelSchema9
903
1436
  },
904
1437
  required: ["text", "model"],
905
1438
  additionalProperties: false
@@ -928,14 +1461,14 @@ class TextEmbeddingTask extends AiTask {
928
1461
  return TextEmbeddingOutputSchema;
929
1462
  }
930
1463
  }
931
- TaskRegistry4.registerTask(TextEmbeddingTask);
1464
+ TaskRegistry10.registerTask(TextEmbeddingTask);
932
1465
  var TextEmbedding = async (input, config) => {
933
1466
  return new TextEmbeddingTask(input, config).run();
934
1467
  };
935
- Workflow4.prototype.TextEmbedding = CreateWorkflow4(TextEmbeddingTask);
1468
+ Workflow10.prototype.TextEmbedding = CreateWorkflow10(TextEmbeddingTask);
936
1469
  // src/task/TextFillMaskTask.ts
937
- import { CreateWorkflow as CreateWorkflow5, TaskRegistry as TaskRegistry5, Workflow as Workflow5 } from "@workglow/task-graph";
938
- var modelSchema4 = TypeReplicateArray(TypeModel("model:TextFillMaskTask"));
1470
+ import { CreateWorkflow as CreateWorkflow11, TaskRegistry as TaskRegistry11, Workflow as Workflow11 } from "@workglow/task-graph";
1471
+ var modelSchema10 = TypeReplicateArray(TypeModel("model:TextFillMaskTask"));
939
1472
  var TextFillMaskInputSchema = {
940
1473
  type: "object",
941
1474
  properties: {
@@ -944,7 +1477,7 @@ var TextFillMaskInputSchema = {
944
1477
  title: "Text",
945
1478
  description: "The text with a mask token to fill"
946
1479
  }),
947
- model: modelSchema4
1480
+ model: modelSchema10
948
1481
  },
949
1482
  required: ["text", "model"],
950
1483
  additionalProperties: false
@@ -987,8 +1520,8 @@ var TextFillMaskOutputSchema = {
987
1520
  class TextFillMaskTask extends AiTask {
988
1521
  static type = "TextFillMaskTask";
989
1522
  static category = "AI Text Model";
990
- static title = "Text Fill Mask";
991
- static description = "Fills masked tokens in text using language models";
1523
+ static title = "Fill Mask";
1524
+ static description = "Fills masked tokens in text";
992
1525
  static inputSchema() {
993
1526
  return TextFillMaskInputSchema;
994
1527
  }
@@ -996,23 +1529,23 @@ class TextFillMaskTask extends AiTask {
996
1529
  return TextFillMaskOutputSchema;
997
1530
  }
998
1531
  }
999
- TaskRegistry5.registerTask(TextFillMaskTask);
1532
+ TaskRegistry11.registerTask(TextFillMaskTask);
1000
1533
  var TextFillMask = (input, config) => {
1001
1534
  return new TextFillMaskTask(input, config).run();
1002
1535
  };
1003
- Workflow5.prototype.TextFillMask = CreateWorkflow5(TextFillMaskTask);
1536
+ Workflow11.prototype.TextFillMask = CreateWorkflow11(TextFillMaskTask);
1004
1537
  // src/task/TextGenerationTask.ts
1005
- import { CreateWorkflow as CreateWorkflow6, TaskRegistry as TaskRegistry6, Workflow as Workflow6 } from "@workglow/task-graph";
1006
- var generatedTextSchema = {
1538
+ import { CreateWorkflow as CreateWorkflow12, TaskRegistry as TaskRegistry12, Workflow as Workflow12 } from "@workglow/task-graph";
1539
+ var generatedTextSchema2 = {
1007
1540
  type: "string",
1008
1541
  title: "Text",
1009
1542
  description: "The generated text"
1010
1543
  };
1011
- var modelSchema5 = TypeReplicateArray(TypeModel("model:TextGenerationTask"));
1544
+ var modelSchema11 = TypeReplicateArray(TypeModel("model:TextGenerationTask"));
1012
1545
  var TextGenerationInputSchema = {
1013
1546
  type: "object",
1014
1547
  properties: {
1015
- model: modelSchema5,
1548
+ model: modelSchema11,
1016
1549
  prompt: TypeReplicateArray({
1017
1550
  type: "string",
1018
1551
  title: "Prompt",
@@ -1066,9 +1599,9 @@ var TextGenerationOutputSchema = {
1066
1599
  type: "object",
1067
1600
  properties: {
1068
1601
  text: {
1069
- oneOf: [generatedTextSchema, { type: "array", items: generatedTextSchema }],
1070
- title: generatedTextSchema.title,
1071
- description: generatedTextSchema.description
1602
+ oneOf: [generatedTextSchema2, { type: "array", items: generatedTextSchema2 }],
1603
+ title: generatedTextSchema2.title,
1604
+ description: generatedTextSchema2.description
1072
1605
  }
1073
1606
  },
1074
1607
  required: ["text"],
@@ -1087,14 +1620,14 @@ class TextGenerationTask extends AiTask {
1087
1620
  return TextGenerationOutputSchema;
1088
1621
  }
1089
1622
  }
1090
- TaskRegistry6.registerTask(TextGenerationTask);
1623
+ TaskRegistry12.registerTask(TextGenerationTask);
1091
1624
  var TextGeneration = (input, config) => {
1092
1625
  return new TextGenerationTask(input, config).run();
1093
1626
  };
1094
- Workflow6.prototype.TextGeneration = CreateWorkflow6(TextGenerationTask);
1627
+ Workflow12.prototype.TextGeneration = CreateWorkflow12(TextGenerationTask);
1095
1628
  // src/task/TextLanguageDetectionTask.ts
1096
- import { CreateWorkflow as CreateWorkflow7, TaskRegistry as TaskRegistry7, Workflow as Workflow7 } from "@workglow/task-graph";
1097
- var modelSchema6 = TypeReplicateArray(TypeModel("model:TextLanguageDetectionTask"));
1629
+ import { CreateWorkflow as CreateWorkflow13, TaskRegistry as TaskRegistry13, Workflow as Workflow13 } from "@workglow/task-graph";
1630
+ var modelSchema12 = TypeReplicateArray(TypeModel("model:TextLanguageDetectionTask"));
1098
1631
  var TextLanguageDetectionInputSchema = {
1099
1632
  type: "object",
1100
1633
  properties: {
@@ -1111,7 +1644,7 @@ var TextLanguageDetectionInputSchema = {
1111
1644
  title: "Max Languages",
1112
1645
  description: "The maximum number of languages to return"
1113
1646
  },
1114
- model: modelSchema6
1647
+ model: modelSchema12
1115
1648
  },
1116
1649
  required: ["text", "model"],
1117
1650
  additionalProperties: false
@@ -1158,14 +1691,14 @@ class TextLanguageDetectionTask extends AiTask {
1158
1691
  return TextLanguageDetectionOutputSchema;
1159
1692
  }
1160
1693
  }
1161
- TaskRegistry7.registerTask(TextLanguageDetectionTask);
1694
+ TaskRegistry13.registerTask(TextLanguageDetectionTask);
1162
1695
  var TextLanguageDetection = (input, config) => {
1163
1696
  return new TextLanguageDetectionTask(input, config).run();
1164
1697
  };
1165
- Workflow7.prototype.TextLanguageDetection = CreateWorkflow7(TextLanguageDetectionTask);
1698
+ Workflow13.prototype.TextLanguageDetection = CreateWorkflow13(TextLanguageDetectionTask);
1166
1699
  // src/task/TextNamedEntityRecognitionTask.ts
1167
- import { CreateWorkflow as CreateWorkflow8, TaskRegistry as TaskRegistry8, Workflow as Workflow8 } from "@workglow/task-graph";
1168
- var modelSchema7 = TypeReplicateArray(TypeModel("model:NamedEntityRecognitionTask"));
1700
+ import { CreateWorkflow as CreateWorkflow14, TaskRegistry as TaskRegistry14, Workflow as Workflow14 } from "@workglow/task-graph";
1701
+ var modelSchema13 = TypeReplicateArray(TypeModel("model:NamedEntityRecognitionTask"));
1169
1702
  var TextNamedEntityRecognitionInputSchema = {
1170
1703
  type: "object",
1171
1704
  properties: {
@@ -1184,7 +1717,7 @@ var TextNamedEntityRecognitionInputSchema = {
1184
1717
  "x-ui-group": "Configuration",
1185
1718
  "x-ui-group-open": false
1186
1719
  },
1187
- model: modelSchema7
1720
+ model: modelSchema13
1188
1721
  },
1189
1722
  required: ["text", "model"],
1190
1723
  additionalProperties: false
@@ -1227,8 +1760,8 @@ var TextNamedEntityRecognitionOutputSchema = {
1227
1760
  class TextNamedEntityRecognitionTask extends AiTask {
1228
1761
  static type = "TextNamedEntityRecognitionTask";
1229
1762
  static category = "AI Text Model";
1230
- static title = "Text Named Entity Recognition";
1231
- static description = "Extracts named entities from text using language models";
1763
+ static title = "Named Entity Recognition";
1764
+ static description = "Extracts named entities from text";
1232
1765
  static inputSchema() {
1233
1766
  return TextNamedEntityRecognitionInputSchema;
1234
1767
  }
@@ -1236,13 +1769,13 @@ class TextNamedEntityRecognitionTask extends AiTask {
1236
1769
  return TextNamedEntityRecognitionOutputSchema;
1237
1770
  }
1238
1771
  }
1239
- TaskRegistry8.registerTask(TextNamedEntityRecognitionTask);
1772
+ TaskRegistry14.registerTask(TextNamedEntityRecognitionTask);
1240
1773
  var TextNamedEntityRecognition = (input, config) => {
1241
1774
  return new TextNamedEntityRecognitionTask(input, config).run();
1242
1775
  };
1243
- Workflow8.prototype.TextNamedEntityRecognition = CreateWorkflow8(TextNamedEntityRecognitionTask);
1776
+ Workflow14.prototype.TextNamedEntityRecognition = CreateWorkflow14(TextNamedEntityRecognitionTask);
1244
1777
  // src/task/TextQuestionAnswerTask.ts
1245
- import { CreateWorkflow as CreateWorkflow9, TaskRegistry as TaskRegistry9, Workflow as Workflow9 } from "@workglow/task-graph";
1778
+ import { CreateWorkflow as CreateWorkflow15, TaskRegistry as TaskRegistry15, Workflow as Workflow15 } from "@workglow/task-graph";
1246
1779
  var contextSchema = {
1247
1780
  type: "string",
1248
1781
  title: "Context",
@@ -1258,13 +1791,13 @@ var textSchema = {
1258
1791
  title: "Text",
1259
1792
  description: "The generated text"
1260
1793
  };
1261
- var modelSchema8 = TypeReplicateArray(TypeModel("model:TextQuestionAnswerTask"));
1794
+ var modelSchema14 = TypeReplicateArray(TypeModel("model:TextQuestionAnswerTask"));
1262
1795
  var TextQuestionAnswerInputSchema = {
1263
1796
  type: "object",
1264
1797
  properties: {
1265
1798
  context: TypeReplicateArray(contextSchema),
1266
1799
  question: TypeReplicateArray(questionSchema),
1267
- model: modelSchema8
1800
+ model: modelSchema14
1268
1801
  },
1269
1802
  required: ["context", "question", "model"],
1270
1803
  additionalProperties: false
@@ -1294,14 +1827,14 @@ class TextQuestionAnswerTask extends AiTask {
1294
1827
  return TextQuestionAnswerOutputSchema;
1295
1828
  }
1296
1829
  }
1297
- TaskRegistry9.registerTask(TextQuestionAnswerTask);
1830
+ TaskRegistry15.registerTask(TextQuestionAnswerTask);
1298
1831
  var TextQuestionAnswer = (input, config) => {
1299
1832
  return new TextQuestionAnswerTask(input, config).run();
1300
1833
  };
1301
- Workflow9.prototype.TextQuestionAnswer = CreateWorkflow9(TextQuestionAnswerTask);
1834
+ Workflow15.prototype.TextQuestionAnswer = CreateWorkflow15(TextQuestionAnswerTask);
1302
1835
  // src/task/TextRewriterTask.ts
1303
- import { CreateWorkflow as CreateWorkflow10, TaskRegistry as TaskRegistry10, Workflow as Workflow10 } from "@workglow/task-graph";
1304
- var modelSchema9 = TypeReplicateArray(TypeModel("model:TextRewriterTask"));
1836
+ import { CreateWorkflow as CreateWorkflow16, TaskRegistry as TaskRegistry16, Workflow as Workflow16 } from "@workglow/task-graph";
1837
+ var modelSchema15 = TypeReplicateArray(TypeModel("model:TextRewriterTask"));
1305
1838
  var TextRewriterInputSchema = {
1306
1839
  type: "object",
1307
1840
  properties: {
@@ -1315,7 +1848,7 @@ var TextRewriterInputSchema = {
1315
1848
  title: "Prompt",
1316
1849
  description: "The prompt to direct the rewriting"
1317
1850
  }),
1318
- model: modelSchema9
1851
+ model: modelSchema15
1319
1852
  },
1320
1853
  required: ["text", "prompt", "model"],
1321
1854
  additionalProperties: false
@@ -1345,14 +1878,14 @@ class TextRewriterTask extends AiTask {
1345
1878
  return TextRewriterOutputSchema;
1346
1879
  }
1347
1880
  }
1348
- TaskRegistry10.registerTask(TextRewriterTask);
1881
+ TaskRegistry16.registerTask(TextRewriterTask);
1349
1882
  var TextRewriter = (input, config) => {
1350
1883
  return new TextRewriterTask(input, config).run();
1351
1884
  };
1352
- Workflow10.prototype.TextRewriter = CreateWorkflow10(TextRewriterTask);
1885
+ Workflow16.prototype.TextRewriter = CreateWorkflow16(TextRewriterTask);
1353
1886
  // src/task/TextSummaryTask.ts
1354
- import { CreateWorkflow as CreateWorkflow11, TaskRegistry as TaskRegistry11, Workflow as Workflow11 } from "@workglow/task-graph";
1355
- var modelSchema10 = TypeReplicateArray(TypeModel("model:TextSummaryTask"));
1887
+ import { CreateWorkflow as CreateWorkflow17, TaskRegistry as TaskRegistry17, Workflow as Workflow17 } from "@workglow/task-graph";
1888
+ var modelSchema16 = TypeReplicateArray(TypeModel("model:TextSummaryTask"));
1356
1889
  var TextSummaryInputSchema = {
1357
1890
  type: "object",
1358
1891
  properties: {
@@ -1361,7 +1894,7 @@ var TextSummaryInputSchema = {
1361
1894
  title: "Text",
1362
1895
  description: "The text to summarize"
1363
1896
  }),
1364
- model: modelSchema10
1897
+ model: modelSchema16
1365
1898
  },
1366
1899
  required: ["text", "model"],
1367
1900
  additionalProperties: false
@@ -1391,14 +1924,14 @@ class TextSummaryTask extends AiTask {
1391
1924
  return TextSummaryOutputSchema;
1392
1925
  }
1393
1926
  }
1394
- TaskRegistry11.registerTask(TextSummaryTask);
1927
+ TaskRegistry17.registerTask(TextSummaryTask);
1395
1928
  var TextSummary = async (input, config) => {
1396
1929
  return new TextSummaryTask(input, config).run();
1397
1930
  };
1398
- Workflow11.prototype.TextSummary = CreateWorkflow11(TextSummaryTask);
1931
+ Workflow17.prototype.TextSummary = CreateWorkflow17(TextSummaryTask);
1399
1932
  // src/task/TextTranslationTask.ts
1400
- import { CreateWorkflow as CreateWorkflow12, TaskRegistry as TaskRegistry12, Workflow as Workflow12 } from "@workglow/task-graph";
1401
- var modelSchema11 = TypeReplicateArray(TypeModel("model:TextTranslationTask"));
1933
+ import { CreateWorkflow as CreateWorkflow18, TaskRegistry as TaskRegistry18, Workflow as Workflow18 } from "@workglow/task-graph";
1934
+ var modelSchema17 = TypeReplicateArray(TypeModel("model:TextTranslationTask"));
1402
1935
  var translationTextSchema = {
1403
1936
  type: "string",
1404
1937
  title: "Text",
@@ -1424,7 +1957,7 @@ var TextTranslationInputSchema = {
1424
1957
  minLength: 2,
1425
1958
  maxLength: 2
1426
1959
  })),
1427
- model: modelSchema11
1960
+ model: modelSchema17
1428
1961
  },
1429
1962
  required: ["text", "source_lang", "target_lang", "model"],
1430
1963
  additionalProperties: false
@@ -1460,18 +1993,18 @@ class TextTranslationTask extends AiTask {
1460
1993
  return TextTranslationOutputSchema;
1461
1994
  }
1462
1995
  }
1463
- TaskRegistry12.registerTask(TextTranslationTask);
1996
+ TaskRegistry18.registerTask(TextTranslationTask);
1464
1997
  var TextTranslation = (input, config) => {
1465
1998
  return new TextTranslationTask(input, config).run();
1466
1999
  };
1467
- Workflow12.prototype.TextTranslation = CreateWorkflow12(TextTranslationTask);
2000
+ Workflow18.prototype.TextTranslation = CreateWorkflow18(TextTranslationTask);
1468
2001
  // src/task/UnloadModelTask.ts
1469
- import { CreateWorkflow as CreateWorkflow13, TaskRegistry as TaskRegistry13, Workflow as Workflow13 } from "@workglow/task-graph";
1470
- var modelSchema12 = TypeReplicateArray(TypeModel("model"));
2002
+ import { CreateWorkflow as CreateWorkflow19, TaskRegistry as TaskRegistry19, Workflow as Workflow19 } from "@workglow/task-graph";
2003
+ var modelSchema18 = TypeReplicateArray(TypeModel("model"));
1471
2004
  var UnloadModelInputSchema = {
1472
2005
  type: "object",
1473
2006
  properties: {
1474
- model: modelSchema12
2007
+ model: modelSchema18
1475
2008
  },
1476
2009
  required: ["model"],
1477
2010
  additionalProperties: false
@@ -1479,7 +2012,7 @@ var UnloadModelInputSchema = {
1479
2012
  var UnloadModelOutputSchema = {
1480
2013
  type: "object",
1481
2014
  properties: {
1482
- model: modelSchema12
2015
+ model: modelSchema18
1483
2016
  },
1484
2017
  required: ["model"],
1485
2018
  additionalProperties: false
@@ -1498,18 +2031,18 @@ class UnloadModelTask extends AiTask {
1498
2031
  }
1499
2032
  static cacheable = false;
1500
2033
  }
1501
- TaskRegistry13.registerTask(UnloadModelTask);
2034
+ TaskRegistry19.registerTask(UnloadModelTask);
1502
2035
  var UnloadModel = (input, config) => {
1503
2036
  return new UnloadModelTask(input, config).run();
1504
2037
  };
1505
- Workflow13.prototype.UnloadModel = CreateWorkflow13(UnloadModelTask);
2038
+ Workflow19.prototype.UnloadModel = CreateWorkflow19(UnloadModelTask);
1506
2039
  // src/task/VectorSimilarityTask.ts
1507
2040
  import {
1508
2041
  ArrayTask,
1509
- CreateWorkflow as CreateWorkflow14,
2042
+ CreateWorkflow as CreateWorkflow20,
1510
2043
  TaskError,
1511
- TaskRegistry as TaskRegistry14,
1512
- Workflow as Workflow14
2044
+ TaskRegistry as TaskRegistry20,
2045
+ Workflow as Workflow20
1513
2046
  } from "@workglow/task-graph";
1514
2047
  var SimilarityFn = {
1515
2048
  COSINE: "cosine",
@@ -1603,11 +2136,11 @@ class VectorSimilarityTask extends ArrayTask {
1603
2136
  };
1604
2137
  }
1605
2138
  }
1606
- TaskRegistry14.registerTask(VectorSimilarityTask);
2139
+ TaskRegistry20.registerTask(VectorSimilarityTask);
1607
2140
  var Similarity = (input, config) => {
1608
2141
  return new VectorSimilarityTask(input, config).run();
1609
2142
  };
1610
- Workflow14.prototype.Similarity = CreateWorkflow14(VectorSimilarityTask);
2143
+ Workflow20.prototype.Similarity = CreateWorkflow20(VectorSimilarityTask);
1611
2144
  function inner(arr1, arr2) {
1612
2145
  return 1 - arr1.reduce((acc, val, i) => acc + val * arr2[i], 0);
1613
2146
  }
@@ -1651,6 +2184,10 @@ export {
1651
2184
  TypeModelAsString,
1652
2185
  TypeModel,
1653
2186
  TypeLanguage,
2187
+ TypeImageInput,
2188
+ TypeCategory,
2189
+ TypeBoundingBox,
2190
+ TypeAudioInput,
1654
2191
  TextTranslationTask,
1655
2192
  TextTranslationOutputSchema,
1656
2193
  TextTranslationInputSchema,
@@ -1688,19 +2225,39 @@ export {
1688
2225
  TextEmbeddingOutputSchema,
1689
2226
  TextEmbeddingInputSchema,
1690
2227
  TextEmbedding,
1691
- TextClassifierTask,
1692
- TextClassifierOutputSchema,
1693
- TextClassifierInputSchema,
1694
- TextClassifier,
2228
+ TextClassificationTask,
2229
+ TextClassificationOutputSchema,
2230
+ TextClassificationInputSchema,
2231
+ TextClassification,
1695
2232
  TableFragment,
1696
2233
  SimilarityFn,
1697
2234
  Similarity,
2235
+ ObjectDetectionTask,
2236
+ ObjectDetectionOutputSchema,
2237
+ ObjectDetectionInputSchema,
2238
+ ObjectDetection,
1698
2239
  ModelSchema,
1699
2240
  ModelRepository,
1700
2241
  ModelPrimaryKeyNames,
1701
2242
  MODEL_REPOSITORY,
1702
2243
  InMemoryModelRepository,
2244
+ ImageToTextTask,
2245
+ ImageToTextOutputSchema,
2246
+ ImageToTextInputSchema,
2247
+ ImageToText,
2248
+ ImageSegmentationTask,
2249
+ ImageSegmentationOutputSchema,
2250
+ ImageSegmentationInputSchema,
2251
+ ImageSegmentation,
1703
2252
  ImageFragment,
2253
+ ImageEmbeddingTask,
2254
+ ImageEmbeddingOutputSchema,
2255
+ ImageEmbeddingInputSchema,
2256
+ ImageEmbedding,
2257
+ ImageClassificationTask,
2258
+ ImageClassificationOutputSchema,
2259
+ ImageClassificationInputSchema,
2260
+ ImageClassification,
1704
2261
  DownloadModelTask,
1705
2262
  DownloadModel,
1706
2263
  DocumentSplitterTask,
@@ -1710,9 +2267,13 @@ export {
1710
2267
  DocumentConverterMarkdown,
1711
2268
  DocumentBaseFragment,
1712
2269
  Document,
2270
+ BackgroundRemovalTask,
2271
+ BackgroundRemovalOutputSchema,
2272
+ BackgroundRemovalInputSchema,
2273
+ BackgroundRemoval,
1713
2274
  AiTask,
1714
2275
  AiProviderRegistry,
1715
2276
  AiJob
1716
2277
  };
1717
2278
 
1718
- //# debugId=9A48653B4A13DC8664756E2164756E21
2279
+ //# debugId=13F0F9F02B78D13A64756E2164756E21