@workglow/ai 0.0.69 → 0.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -828,16 +828,10 @@ var TextClassifierInputSchema = {
828
828
  description: "The text to classify"
829
829
  }),
830
830
  maxCategories: {
831
- oneOf: [
832
- {
833
- type: "number",
834
- minimum: 1,
835
- maximum: 1000
836
- },
837
- {
838
- type: "null"
839
- }
840
- ],
831
+ type: "number",
832
+ minimum: 1,
833
+ maximum: 1000,
834
+ default: 5,
841
835
  title: "Max Categories",
842
836
  description: "The maximum number of categories to return"
843
837
  },
@@ -938,18 +932,86 @@ var TextEmbedding = async (input, config) => {
938
932
  return new TextEmbeddingTask(input, config).run();
939
933
  };
940
934
  Workflow4.prototype.TextEmbedding = CreateWorkflow4(TextEmbeddingTask);
941
- // src/task/TextGenerationTask.ts
935
+ // src/task/TextFillMaskTask.ts
942
936
  import { CreateWorkflow as CreateWorkflow5, TaskRegistry as TaskRegistry5, Workflow as Workflow5 } from "@workglow/task-graph";
937
+ var modelSchema4 = TypeReplicateArray(TypeModel("model:TextFillMaskTask"));
938
+ var TextFillMaskInputSchema = {
939
+ type: "object",
940
+ properties: {
941
+ text: TypeReplicateArray({
942
+ type: "string",
943
+ title: "Text",
944
+ description: "The text with a mask token to fill"
945
+ }),
946
+ model: modelSchema4
947
+ },
948
+ required: ["text", "model"],
949
+ additionalProperties: false
950
+ };
951
+ var TextFillMaskOutputSchema = {
952
+ type: "object",
953
+ properties: {
954
+ predictions: {
955
+ type: "array",
956
+ items: {
957
+ type: "object",
958
+ properties: {
959
+ entity: {
960
+ type: "string",
961
+ title: "Entity",
962
+ description: "The token that was predicted to fill the mask"
963
+ },
964
+ score: {
965
+ type: "number",
966
+ title: "Score",
967
+ description: "The confidence score for this prediction"
968
+ },
969
+ sequence: {
970
+ type: "string",
971
+ title: "Sequence",
972
+ description: "The complete text with the mask filled"
973
+ }
974
+ },
975
+ required: ["entity", "score", "sequence"],
976
+ additionalProperties: false
977
+ },
978
+ title: "Predictions",
979
+ description: "The predicted tokens to fill the mask with their scores and complete sequences"
980
+ }
981
+ },
982
+ required: ["predictions"],
983
+ additionalProperties: false
984
+ };
985
+
986
+ class TextFillMaskTask extends AiTask {
987
+ static type = "TextFillMaskTask";
988
+ static category = "AI Text Model";
989
+ static title = "Text Fill Mask";
990
+ static description = "Fills masked tokens in text using language models";
991
+ static inputSchema() {
992
+ return TextFillMaskInputSchema;
993
+ }
994
+ static outputSchema() {
995
+ return TextFillMaskOutputSchema;
996
+ }
997
+ }
998
+ TaskRegistry5.registerTask(TextFillMaskTask);
999
+ var TextFillMask = (input, config) => {
1000
+ return new TextFillMaskTask(input, config).run();
1001
+ };
1002
+ Workflow5.prototype.TextFillMask = CreateWorkflow5(TextFillMaskTask);
1003
+ // src/task/TextGenerationTask.ts
1004
+ import { CreateWorkflow as CreateWorkflow6, TaskRegistry as TaskRegistry6, Workflow as Workflow6 } from "@workglow/task-graph";
943
1005
  var generatedTextSchema = {
944
1006
  type: "string",
945
1007
  title: "Text",
946
1008
  description: "The generated text"
947
1009
  };
948
- var modelSchema4 = TypeReplicateArray(TypeModel("model:TextGenerationTask"));
1010
+ var modelSchema5 = TypeReplicateArray(TypeModel("model:TextGenerationTask"));
949
1011
  var TextGenerationInputSchema = {
950
1012
  type: "object",
951
1013
  properties: {
952
- model: modelSchema4,
1014
+ model: modelSchema5,
953
1015
  prompt: TypeReplicateArray({
954
1016
  type: "string",
955
1017
  title: "Prompt",
@@ -1024,14 +1086,14 @@ class TextGenerationTask extends AiTask {
1024
1086
  return TextGenerationOutputSchema;
1025
1087
  }
1026
1088
  }
1027
- TaskRegistry5.registerTask(TextGenerationTask);
1089
+ TaskRegistry6.registerTask(TextGenerationTask);
1028
1090
  var TextGeneration = (input, config) => {
1029
1091
  return new TextGenerationTask(input, config).run();
1030
1092
  };
1031
- Workflow5.prototype.TextGeneration = CreateWorkflow5(TextGenerationTask);
1093
+ Workflow6.prototype.TextGeneration = CreateWorkflow6(TextGenerationTask);
1032
1094
  // src/task/TextLanguageDetectionTask.ts
1033
- import { CreateWorkflow as CreateWorkflow6, TaskRegistry as TaskRegistry6, Workflow as Workflow6 } from "@workglow/task-graph";
1034
- var modelSchema5 = TypeReplicateArray(TypeModel("model:TextLanguageDetectionTask"));
1095
+ import { CreateWorkflow as CreateWorkflow7, TaskRegistry as TaskRegistry7, Workflow as Workflow7 } from "@workglow/task-graph";
1096
+ var modelSchema6 = TypeReplicateArray(TypeModel("model:TextLanguageDetectionTask"));
1035
1097
  var TextLanguageDetectionInputSchema = {
1036
1098
  type: "object",
1037
1099
  properties: {
@@ -1041,20 +1103,14 @@ var TextLanguageDetectionInputSchema = {
1041
1103
  description: "The text to detect the language of"
1042
1104
  }),
1043
1105
  maxLanguages: {
1044
- oneOf: [
1045
- {
1046
- type: "number",
1047
- minimum: 1,
1048
- maximum: 1000
1049
- },
1050
- {
1051
- type: "null"
1052
- }
1053
- ],
1106
+ type: "number",
1107
+ minimum: 0,
1108
+ maximum: 100,
1109
+ default: 5,
1054
1110
  title: "Max Languages",
1055
1111
  description: "The maximum number of languages to return"
1056
1112
  },
1057
- model: modelSchema5
1113
+ model: modelSchema6
1058
1114
  },
1059
1115
  required: ["text", "model"],
1060
1116
  additionalProperties: false
@@ -1101,13 +1157,91 @@ class TextLanguageDetectionTask extends AiTask {
1101
1157
  return TextLanguageDetectionOutputSchema;
1102
1158
  }
1103
1159
  }
1104
- TaskRegistry6.registerTask(TextLanguageDetectionTask);
1160
+ TaskRegistry7.registerTask(TextLanguageDetectionTask);
1105
1161
  var TextLanguageDetection = (input, config) => {
1106
1162
  return new TextLanguageDetectionTask(input, config).run();
1107
1163
  };
1108
- Workflow6.prototype.TextLanguageDetection = CreateWorkflow6(TextLanguageDetectionTask);
1164
+ Workflow7.prototype.TextLanguageDetection = CreateWorkflow7(TextLanguageDetectionTask);
1165
+ // src/task/TextNamedEntityRecognitionTask.ts
1166
+ import { CreateWorkflow as CreateWorkflow8, TaskRegistry as TaskRegistry8, Workflow as Workflow8 } from "@workglow/task-graph";
1167
+ var modelSchema7 = TypeReplicateArray(TypeModel("model:NamedEntityRecognitionTask"));
1168
+ var TextNamedEntityRecognitionInputSchema = {
1169
+ type: "object",
1170
+ properties: {
1171
+ text: TypeReplicateArray({
1172
+ type: "string",
1173
+ title: "Text",
1174
+ description: "The text to extract named entities from"
1175
+ }),
1176
+ blockList: {
1177
+ type: "array",
1178
+ items: {
1179
+ type: "string"
1180
+ },
1181
+ title: "Block List",
1182
+ description: "The entity types to exclude from results",
1183
+ "x-ui-group": "Configuration",
1184
+ "x-ui-group-open": false
1185
+ },
1186
+ model: modelSchema7
1187
+ },
1188
+ required: ["text", "model"],
1189
+ additionalProperties: false
1190
+ };
1191
+ var TextNamedEntityRecognitionOutputSchema = {
1192
+ type: "object",
1193
+ properties: {
1194
+ entities: {
1195
+ type: "array",
1196
+ items: {
1197
+ type: "object",
1198
+ properties: {
1199
+ entity: {
1200
+ type: "string",
1201
+ title: "Entity",
1202
+ description: "The type of the named entity"
1203
+ },
1204
+ score: {
1205
+ type: "number",
1206
+ title: "Score",
1207
+ description: "The confidence score for this entity"
1208
+ },
1209
+ word: {
1210
+ type: "string",
1211
+ title: "Word",
1212
+ description: "The extracted text of the named entity"
1213
+ }
1214
+ },
1215
+ required: ["entity", "score", "word"],
1216
+ additionalProperties: false
1217
+ },
1218
+ title: "Entities",
1219
+ description: "The extracted named entities with their types, scores, and text"
1220
+ }
1221
+ },
1222
+ required: ["entities"],
1223
+ additionalProperties: false
1224
+ };
1225
+
1226
+ class TextNamedEntityRecognitionTask extends AiTask {
1227
+ static type = "TextNamedEntityRecognitionTask";
1228
+ static category = "AI Text Model";
1229
+ static title = "Text Named Entity Recognition";
1230
+ static description = "Extracts named entities from text using language models";
1231
+ static inputSchema() {
1232
+ return TextNamedEntityRecognitionInputSchema;
1233
+ }
1234
+ static outputSchema() {
1235
+ return TextNamedEntityRecognitionOutputSchema;
1236
+ }
1237
+ }
1238
+ TaskRegistry8.registerTask(TextNamedEntityRecognitionTask);
1239
+ var TextNamedEntityRecognition = (input, config) => {
1240
+ return new TextNamedEntityRecognitionTask(input, config).run();
1241
+ };
1242
+ Workflow8.prototype.TextNamedEntityRecognition = CreateWorkflow8(TextNamedEntityRecognitionTask);
1109
1243
  // src/task/TextQuestionAnswerTask.ts
1110
- import { CreateWorkflow as CreateWorkflow7, TaskRegistry as TaskRegistry7, Workflow as Workflow7 } from "@workglow/task-graph";
1244
+ import { CreateWorkflow as CreateWorkflow9, TaskRegistry as TaskRegistry9, Workflow as Workflow9 } from "@workglow/task-graph";
1111
1245
  var contextSchema = {
1112
1246
  type: "string",
1113
1247
  title: "Context",
@@ -1123,13 +1257,13 @@ var textSchema = {
1123
1257
  title: "Text",
1124
1258
  description: "The generated text"
1125
1259
  };
1126
- var modelSchema6 = TypeReplicateArray(TypeModel("model:TextQuestionAnswerTask"));
1260
+ var modelSchema8 = TypeReplicateArray(TypeModel("model:TextQuestionAnswerTask"));
1127
1261
  var TextQuestionAnswerInputSchema = {
1128
1262
  type: "object",
1129
1263
  properties: {
1130
1264
  context: TypeReplicateArray(contextSchema),
1131
1265
  question: TypeReplicateArray(questionSchema),
1132
- model: modelSchema6
1266
+ model: modelSchema8
1133
1267
  },
1134
1268
  required: ["context", "question", "model"],
1135
1269
  additionalProperties: false
@@ -1159,14 +1293,14 @@ class TextQuestionAnswerTask extends AiTask {
1159
1293
  return TextQuestionAnswerOutputSchema;
1160
1294
  }
1161
1295
  }
1162
- TaskRegistry7.registerTask(TextQuestionAnswerTask);
1296
+ TaskRegistry9.registerTask(TextQuestionAnswerTask);
1163
1297
  var TextQuestionAnswer = (input, config) => {
1164
1298
  return new TextQuestionAnswerTask(input, config).run();
1165
1299
  };
1166
- Workflow7.prototype.TextQuestionAnswer = CreateWorkflow7(TextQuestionAnswerTask);
1300
+ Workflow9.prototype.TextQuestionAnswer = CreateWorkflow9(TextQuestionAnswerTask);
1167
1301
  // src/task/TextRewriterTask.ts
1168
- import { CreateWorkflow as CreateWorkflow8, TaskRegistry as TaskRegistry8, Workflow as Workflow8 } from "@workglow/task-graph";
1169
- var modelSchema7 = TypeReplicateArray(TypeModel("model:TextRewriterTask"));
1302
+ import { CreateWorkflow as CreateWorkflow10, TaskRegistry as TaskRegistry10, Workflow as Workflow10 } from "@workglow/task-graph";
1303
+ var modelSchema9 = TypeReplicateArray(TypeModel("model:TextRewriterTask"));
1170
1304
  var TextRewriterInputSchema = {
1171
1305
  type: "object",
1172
1306
  properties: {
@@ -1180,7 +1314,7 @@ var TextRewriterInputSchema = {
1180
1314
  title: "Prompt",
1181
1315
  description: "The prompt to direct the rewriting"
1182
1316
  }),
1183
- model: modelSchema7
1317
+ model: modelSchema9
1184
1318
  },
1185
1319
  required: ["text", "prompt", "model"],
1186
1320
  additionalProperties: false
@@ -1210,14 +1344,14 @@ class TextRewriterTask extends AiTask {
1210
1344
  return TextRewriterOutputSchema;
1211
1345
  }
1212
1346
  }
1213
- TaskRegistry8.registerTask(TextRewriterTask);
1347
+ TaskRegistry10.registerTask(TextRewriterTask);
1214
1348
  var TextRewriter = (input, config) => {
1215
1349
  return new TextRewriterTask(input, config).run();
1216
1350
  };
1217
- Workflow8.prototype.TextRewriter = CreateWorkflow8(TextRewriterTask);
1351
+ Workflow10.prototype.TextRewriter = CreateWorkflow10(TextRewriterTask);
1218
1352
  // src/task/TextSummaryTask.ts
1219
- import { CreateWorkflow as CreateWorkflow9, TaskRegistry as TaskRegistry9, Workflow as Workflow9 } from "@workglow/task-graph";
1220
- var modelSchema8 = TypeReplicateArray(TypeModel("model:TextSummaryTask"));
1353
+ import { CreateWorkflow as CreateWorkflow11, TaskRegistry as TaskRegistry11, Workflow as Workflow11 } from "@workglow/task-graph";
1354
+ var modelSchema10 = TypeReplicateArray(TypeModel("model:TextSummaryTask"));
1221
1355
  var TextSummaryInputSchema = {
1222
1356
  type: "object",
1223
1357
  properties: {
@@ -1226,7 +1360,7 @@ var TextSummaryInputSchema = {
1226
1360
  title: "Text",
1227
1361
  description: "The text to summarize"
1228
1362
  }),
1229
- model: modelSchema8
1363
+ model: modelSchema10
1230
1364
  },
1231
1365
  required: ["text", "model"],
1232
1366
  additionalProperties: false
@@ -1256,14 +1390,14 @@ class TextSummaryTask extends AiTask {
1256
1390
  return TextSummaryOutputSchema;
1257
1391
  }
1258
1392
  }
1259
- TaskRegistry9.registerTask(TextSummaryTask);
1393
+ TaskRegistry11.registerTask(TextSummaryTask);
1260
1394
  var TextSummary = async (input, config) => {
1261
1395
  return new TextSummaryTask(input, config).run();
1262
1396
  };
1263
- Workflow9.prototype.TextSummary = CreateWorkflow9(TextSummaryTask);
1397
+ Workflow11.prototype.TextSummary = CreateWorkflow11(TextSummaryTask);
1264
1398
  // src/task/TextTranslationTask.ts
1265
- import { CreateWorkflow as CreateWorkflow10, TaskRegistry as TaskRegistry10, Workflow as Workflow10 } from "@workglow/task-graph";
1266
- var modelSchema9 = TypeReplicateArray(TypeModel("model:TextTranslationTask"));
1399
+ import { CreateWorkflow as CreateWorkflow12, TaskRegistry as TaskRegistry12, Workflow as Workflow12 } from "@workglow/task-graph";
1400
+ var modelSchema11 = TypeReplicateArray(TypeModel("model:TextTranslationTask"));
1267
1401
  var translationTextSchema = {
1268
1402
  type: "string",
1269
1403
  title: "Text",
@@ -1289,7 +1423,7 @@ var TextTranslationInputSchema = {
1289
1423
  minLength: 2,
1290
1424
  maxLength: 2
1291
1425
  })),
1292
- model: modelSchema9
1426
+ model: modelSchema11
1293
1427
  },
1294
1428
  required: ["text", "source_lang", "target_lang", "model"],
1295
1429
  additionalProperties: false
@@ -1325,18 +1459,18 @@ class TextTranslationTask extends AiTask {
1325
1459
  return TextTranslationOutputSchema;
1326
1460
  }
1327
1461
  }
1328
- TaskRegistry10.registerTask(TextTranslationTask);
1462
+ TaskRegistry12.registerTask(TextTranslationTask);
1329
1463
  var TextTranslation = (input, config) => {
1330
1464
  return new TextTranslationTask(input, config).run();
1331
1465
  };
1332
- Workflow10.prototype.TextTranslation = CreateWorkflow10(TextTranslationTask);
1466
+ Workflow12.prototype.TextTranslation = CreateWorkflow12(TextTranslationTask);
1333
1467
  // src/task/UnloadModelTask.ts
1334
- import { CreateWorkflow as CreateWorkflow11, TaskRegistry as TaskRegistry11, Workflow as Workflow11 } from "@workglow/task-graph";
1335
- var modelSchema10 = TypeReplicateArray(TypeModel("model"));
1468
+ import { CreateWorkflow as CreateWorkflow13, TaskRegistry as TaskRegistry13, Workflow as Workflow13 } from "@workglow/task-graph";
1469
+ var modelSchema12 = TypeReplicateArray(TypeModel("model"));
1336
1470
  var UnloadModelInputSchema = {
1337
1471
  type: "object",
1338
1472
  properties: {
1339
- model: modelSchema10
1473
+ model: modelSchema12
1340
1474
  },
1341
1475
  required: ["model"],
1342
1476
  additionalProperties: false
@@ -1344,7 +1478,7 @@ var UnloadModelInputSchema = {
1344
1478
  var UnloadModelOutputSchema = {
1345
1479
  type: "object",
1346
1480
  properties: {
1347
- model: modelSchema10
1481
+ model: modelSchema12
1348
1482
  },
1349
1483
  required: ["model"],
1350
1484
  additionalProperties: false
@@ -1363,18 +1497,18 @@ class UnloadModelTask extends AiTask {
1363
1497
  }
1364
1498
  static cacheable = false;
1365
1499
  }
1366
- TaskRegistry11.registerTask(UnloadModelTask);
1500
+ TaskRegistry13.registerTask(UnloadModelTask);
1367
1501
  var UnloadModel = (input, config) => {
1368
1502
  return new UnloadModelTask(input, config).run();
1369
1503
  };
1370
- Workflow11.prototype.UnloadModel = CreateWorkflow11(UnloadModelTask);
1504
+ Workflow13.prototype.UnloadModel = CreateWorkflow13(UnloadModelTask);
1371
1505
  // src/task/VectorSimilarityTask.ts
1372
1506
  import {
1373
1507
  ArrayTask,
1374
- CreateWorkflow as CreateWorkflow12,
1508
+ CreateWorkflow as CreateWorkflow14,
1375
1509
  TaskError,
1376
- TaskRegistry as TaskRegistry12,
1377
- Workflow as Workflow12
1510
+ TaskRegistry as TaskRegistry14,
1511
+ Workflow as Workflow14
1378
1512
  } from "@workglow/task-graph";
1379
1513
  var SimilarityFn = {
1380
1514
  COSINE: "cosine",
@@ -1468,11 +1602,11 @@ class VectorSimilarityTask extends ArrayTask {
1468
1602
  };
1469
1603
  }
1470
1604
  }
1471
- TaskRegistry12.registerTask(VectorSimilarityTask);
1605
+ TaskRegistry14.registerTask(VectorSimilarityTask);
1472
1606
  var Similarity = (input, config) => {
1473
1607
  return new VectorSimilarityTask(input, config).run();
1474
1608
  };
1475
- Workflow12.prototype.Similarity = CreateWorkflow12(VectorSimilarityTask);
1609
+ Workflow14.prototype.Similarity = CreateWorkflow14(VectorSimilarityTask);
1476
1610
  function inner(arr1, arr2) {
1477
1611
  return 1 - arr1.reduce((acc, val, i) => acc + val * arr2[i], 0);
1478
1612
  }
@@ -1532,6 +1666,10 @@ export {
1532
1666
  TextQuestionAnswerOutputSchema,
1533
1667
  TextQuestionAnswerInputSchema,
1534
1668
  TextQuestionAnswer,
1669
+ TextNamedEntityRecognitionTask,
1670
+ TextNamedEntityRecognitionOutputSchema,
1671
+ TextNamedEntityRecognitionInputSchema,
1672
+ TextNamedEntityRecognition,
1535
1673
  TextLanguageDetectionTask,
1536
1674
  TextLanguageDetectionOutputSchema,
1537
1675
  TextLanguageDetectionInputSchema,
@@ -1541,6 +1679,10 @@ export {
1541
1679
  TextGenerationInputSchema,
1542
1680
  TextGeneration,
1543
1681
  TextFragment,
1682
+ TextFillMaskTask,
1683
+ TextFillMaskOutputSchema,
1684
+ TextFillMaskInputSchema,
1685
+ TextFillMask,
1544
1686
  TextEmbeddingTask,
1545
1687
  TextEmbeddingOutputSchema,
1546
1688
  TextEmbeddingInputSchema,
@@ -1572,4 +1714,4 @@ export {
1572
1714
  AiJob
1573
1715
  };
1574
1716
 
1575
- //# debugId=A1B6F27F96F1B91464756E2164756E21
1717
+ //# debugId=4EF87B775AAC634764756E2164756E21