@workglow/ai 0.0.108 → 0.0.110

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 (38) hide show
  1. package/dist/browser.js +181 -118
  2. package/dist/browser.js.map +23 -22
  3. package/dist/bun.js +181 -118
  4. package/dist/bun.js.map +23 -22
  5. package/dist/node.js +181 -118
  6. package/dist/node.js.map +23 -22
  7. package/dist/provider/AiProvider.d.ts +4 -0
  8. package/dist/provider/AiProvider.d.ts.map +1 -1
  9. package/dist/task/CountTokensTask.d.ts +25 -7
  10. package/dist/task/CountTokensTask.d.ts.map +1 -1
  11. package/dist/task/DocumentEnricherTask.d.ts.map +1 -1
  12. package/dist/task/ModelInfoTask.d.ts +211 -0
  13. package/dist/task/ModelInfoTask.d.ts.map +1 -0
  14. package/dist/task/RerankerTask.d.ts.map +1 -1
  15. package/dist/task/TextClassificationTask.d.ts +59 -21
  16. package/dist/task/TextClassificationTask.d.ts.map +1 -1
  17. package/dist/task/TextFillMaskTask.d.ts +70 -26
  18. package/dist/task/TextFillMaskTask.d.ts.map +1 -1
  19. package/dist/task/TextGenerationTask.d.ts +27 -8
  20. package/dist/task/TextGenerationTask.d.ts.map +1 -1
  21. package/dist/task/TextLanguageDetectionTask.d.ts +59 -21
  22. package/dist/task/TextLanguageDetectionTask.d.ts.map +1 -1
  23. package/dist/task/TextNamedEntityRecognitionTask.d.ts +70 -26
  24. package/dist/task/TextNamedEntityRecognitionTask.d.ts.map +1 -1
  25. package/dist/task/TextQuestionAnswerTask.d.ts +39 -11
  26. package/dist/task/TextQuestionAnswerTask.d.ts.map +1 -1
  27. package/dist/task/TextRewriterTask.d.ts +27 -8
  28. package/dist/task/TextRewriterTask.d.ts.map +1 -1
  29. package/dist/task/TextSummaryTask.d.ts +27 -8
  30. package/dist/task/TextSummaryTask.d.ts.map +1 -1
  31. package/dist/task/TextTranslationTask.d.ts +27 -8
  32. package/dist/task/TextTranslationTask.d.ts.map +1 -1
  33. package/dist/task/ToolCallingTask.d.ts +45 -13
  34. package/dist/task/ToolCallingTask.d.ts.map +1 -1
  35. package/dist/task/base/AiTask.d.ts.map +1 -1
  36. package/dist/task/index.d.ts +3 -1
  37. package/dist/task/index.d.ts.map +1 -1
  38. package/package.json +17 -16
@@ -64,6 +64,10 @@ export interface AiProviderRegisterOptions {
64
64
  export declare abstract class AiProvider<TModelConfig extends ModelConfig = ModelConfig> {
65
65
  /** Unique provider identifier (e.g., "HF_TRANSFORMERS_ONNX") */
66
66
  abstract readonly name: string;
67
+ /** Whether this provider runs models locally (on the same machine). */
68
+ abstract readonly isLocal: boolean;
69
+ /** Whether this provider can run in a browser environment. */
70
+ abstract readonly supportsBrowser: boolean;
67
71
  /**
68
72
  * List of task type names this provider supports.
69
73
  * This is lightweight metadata -- no heavy library imports needed.
@@ -1 +1 @@
1
- {"version":3,"file":"AiProvider.d.ts","sourceRoot":"","sources":["../../src/provider/AiProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,sBAAsB,CAAC;AAE9B;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,IAAI,EAAE,cAAc,CAAC;IACrB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,KAAK,CAAC,EAAE;QACN,wDAAwD;QACxD,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,uEAAuE;QACvE,UAAU,CAAC,EAAE,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,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;OAGG;cACa,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGhE"}
@@ -10,9 +10,18 @@ export declare const CountTokensInputSchema: {
10
10
  readonly type: "object";
11
11
  readonly properties: {
12
12
  readonly text: {
13
- readonly type: "string";
14
- readonly title: "Text";
15
- readonly description: "The text to count tokens for";
13
+ readonly anyOf: readonly [{
14
+ readonly type: "string";
15
+ readonly title: "Text";
16
+ readonly description: "The text to count tokens for";
17
+ }, {
18
+ readonly type: "array";
19
+ readonly items: {
20
+ readonly type: "string";
21
+ readonly title: "Text";
22
+ readonly description: "The text to count tokens for";
23
+ };
24
+ }];
16
25
  };
17
26
  readonly model: {
18
27
  readonly oneOf: readonly [{
@@ -79,9 +88,18 @@ export declare const CountTokensOutputSchema: {
79
88
  readonly type: "object";
80
89
  readonly properties: {
81
90
  readonly count: {
82
- readonly type: "number";
83
- readonly title: "Token Count";
84
- readonly description: "The number of tokens in the text";
91
+ readonly anyOf: readonly [{
92
+ readonly type: "number";
93
+ readonly title: "Token Count";
94
+ readonly description: "The number of tokens in the text";
95
+ }, {
96
+ readonly type: "array";
97
+ readonly items: {
98
+ readonly type: "number";
99
+ readonly title: "Token Count";
100
+ readonly description: "The number of tokens in the text";
101
+ };
102
+ }];
85
103
  };
86
104
  };
87
105
  readonly required: readonly ["count"];
@@ -111,7 +129,7 @@ export declare class CountTokensTask extends AiTask<CountTokensTaskInput, CountT
111
129
  * @returns Promise resolving to the token count
112
130
  */
113
131
  export declare const countTokens: (input: CountTokensTaskInput, config?: JobQueueTaskConfig) => Promise<{
114
- count: number;
132
+ count: number | number[];
115
133
  }>;
116
134
  declare module "@workglow/task-graph" {
117
135
  interface Workflow {
@@ -1 +1 @@
1
- {"version":3,"file":"CountTokensTask.d.ts","sourceRoot":"","sources":["../../src/task/CountTokensTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE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gB,EAAE,cAAc,CAC9B,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,CACnB,CAAC;KACH;CACF"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { CreateWorkflow, JobQueueTaskConfig } from "@workglow/task-graph";
7
+ import { DataPortSchema, FromSchema } from "@workglow/util";
8
+ import { AiTask } from "./base/AiTask";
9
+ declare const ModelInfoInputSchema: {
10
+ readonly type: "object";
11
+ readonly properties: {
12
+ readonly model: {
13
+ readonly oneOf: readonly [{
14
+ readonly title: "Model";
15
+ readonly description: `The model ${string}`;
16
+ } & {
17
+ readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
18
+ readonly type: "string";
19
+ }, {
20
+ readonly type: "object";
21
+ readonly properties: {
22
+ readonly model_id: {
23
+ readonly type: "string";
24
+ };
25
+ readonly tasks: {
26
+ readonly type: "array";
27
+ readonly items: {
28
+ readonly type: "string";
29
+ };
30
+ readonly "x-ui-editor": "multiselect";
31
+ };
32
+ readonly title: {
33
+ readonly type: "string";
34
+ };
35
+ readonly description: {
36
+ readonly type: "string";
37
+ readonly "x-ui-editor": "textarea";
38
+ };
39
+ readonly provider: {
40
+ readonly type: "string";
41
+ };
42
+ readonly provider_config: {
43
+ readonly type: "object";
44
+ readonly properties: {
45
+ readonly credential_key: {
46
+ readonly type: "string";
47
+ readonly format: "credential";
48
+ readonly "x-ui-hidden": true;
49
+ };
50
+ };
51
+ readonly additionalProperties: true;
52
+ readonly default: {};
53
+ };
54
+ readonly metadata: {
55
+ readonly type: "object";
56
+ readonly default: {};
57
+ readonly "x-ui-hidden": true;
58
+ };
59
+ };
60
+ readonly required: readonly ["provider", "provider_config"];
61
+ readonly format: "model";
62
+ readonly additionalProperties: true;
63
+ } & {
64
+ readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
65
+ }];
66
+ } & {
67
+ readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
68
+ };
69
+ readonly detail: {
70
+ readonly type: "string";
71
+ readonly enum: readonly ["cached_status", "files", "files_with_metadata"];
72
+ readonly default: "files_with_metadata";
73
+ };
74
+ };
75
+ readonly required: readonly ["model"];
76
+ readonly additionalProperties: false;
77
+ };
78
+ declare const ModelInfoOutputSchema: {
79
+ readonly type: "object";
80
+ readonly properties: {
81
+ readonly model: {
82
+ readonly oneOf: readonly [{
83
+ readonly title: "Model";
84
+ readonly description: `The model ${string}`;
85
+ } & {
86
+ readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
87
+ readonly type: "string";
88
+ }, {
89
+ readonly type: "object";
90
+ readonly properties: {
91
+ readonly model_id: {
92
+ readonly type: "string";
93
+ };
94
+ readonly tasks: {
95
+ readonly type: "array";
96
+ readonly items: {
97
+ readonly type: "string";
98
+ };
99
+ readonly "x-ui-editor": "multiselect";
100
+ };
101
+ readonly title: {
102
+ readonly type: "string";
103
+ };
104
+ readonly description: {
105
+ readonly type: "string";
106
+ readonly "x-ui-editor": "textarea";
107
+ };
108
+ readonly provider: {
109
+ readonly type: "string";
110
+ };
111
+ readonly provider_config: {
112
+ readonly type: "object";
113
+ readonly properties: {
114
+ readonly credential_key: {
115
+ readonly type: "string";
116
+ readonly format: "credential";
117
+ readonly "x-ui-hidden": true;
118
+ };
119
+ };
120
+ readonly additionalProperties: true;
121
+ readonly default: {};
122
+ };
123
+ readonly metadata: {
124
+ readonly type: "object";
125
+ readonly default: {};
126
+ readonly "x-ui-hidden": true;
127
+ };
128
+ };
129
+ readonly required: readonly ["provider", "provider_config"];
130
+ readonly format: "model";
131
+ readonly additionalProperties: true;
132
+ } & {
133
+ readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
134
+ }];
135
+ } & {
136
+ readonly format: import("./base/AiTaskSchemas").TypeModelSemantic;
137
+ };
138
+ readonly is_local: {
139
+ readonly type: "boolean";
140
+ };
141
+ readonly is_remote: {
142
+ readonly type: "boolean";
143
+ };
144
+ readonly supports_browser: {
145
+ readonly type: "boolean";
146
+ };
147
+ readonly supports_node: {
148
+ readonly type: "boolean";
149
+ };
150
+ readonly is_cached: {
151
+ readonly type: "boolean";
152
+ };
153
+ readonly is_loaded: {
154
+ readonly type: "boolean";
155
+ };
156
+ readonly file_sizes: {};
157
+ };
158
+ readonly required: readonly ["model", "is_local", "is_remote", "supports_browser", "supports_node", "is_cached", "is_loaded", "file_sizes"];
159
+ readonly additionalProperties: false;
160
+ };
161
+ export type ModelInfoTaskInput = FromSchema<typeof ModelInfoInputSchema>;
162
+ export type ModelInfoTaskOutput = FromSchema<typeof ModelInfoOutputSchema>;
163
+ /**
164
+ * Retrieve runtime metadata about a model: locality, browser support, cache status, and file sizes.
165
+ */
166
+ export declare class ModelInfoTask extends AiTask<ModelInfoTaskInput, ModelInfoTaskOutput, JobQueueTaskConfig> {
167
+ static type: string;
168
+ static category: string;
169
+ static title: string;
170
+ static description: string;
171
+ static inputSchema(): DataPortSchema;
172
+ static outputSchema(): DataPortSchema;
173
+ static cacheable: boolean;
174
+ }
175
+ /**
176
+ * Retrieve runtime metadata about a model.
177
+ *
178
+ * @param input - Input containing the model to query
179
+ * @returns Promise resolving to model info including locality and cache status
180
+ */
181
+ export declare const modelInfo: (input: ModelInfoTaskInput, config?: JobQueueTaskConfig) => Promise<{
182
+ model: string | {
183
+ [x: string]: unknown;
184
+ title?: string | undefined;
185
+ description?: string | undefined;
186
+ model_id?: string | undefined;
187
+ tasks?: string[] | undefined;
188
+ metadata?: {
189
+ [x: string]: unknown;
190
+ } | undefined;
191
+ provider: string;
192
+ provider_config: {
193
+ [x: string]: unknown;
194
+ credential_key?: string | undefined;
195
+ };
196
+ };
197
+ is_local: boolean;
198
+ is_remote: boolean;
199
+ supports_browser: boolean;
200
+ supports_node: boolean;
201
+ is_cached: boolean;
202
+ is_loaded: boolean;
203
+ file_sizes: unknown;
204
+ }>;
205
+ declare module "@workglow/task-graph" {
206
+ interface Workflow {
207
+ modelInfo: CreateWorkflow<ModelInfoTaskInput, ModelInfoTaskOutput, JobQueueTaskConfig>;
208
+ }
209
+ }
210
+ export {};
211
+ //# sourceMappingURL=ModelInfoTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelInfoTask.d.ts","sourceRoot":"","sources":["../../src/task/ModelInfoTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAY,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvC,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYS,CAAC;AAEpC,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBQ,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACzE,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE3E;;GAEG;AACH,qBAAa,aAAc,SAAQ,MAAM,CACvC,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,CACnB;IACC,OAAc,IAAI,SAAmB;IACrC,OAAc,QAAQ,SAAY;IAClC,OAAc,KAAK,SAAgB;IACnC,OAAc,WAAW,SACsE;WACjF,WAAW,IAAI,cAAc;WAG7B,YAAY,IAAI,cAAc;IAG5C,OAAc,SAAS,UAAS;CACjC;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,kBAAkB,EAAE,SAAS,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;EAE/E,CAAC;AAEF,OAAO,QAA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AC/B,OAAO,CAAC,yBAAyB,CAAC,CAAgB;WAEpC,WAAW,IAAI,cAAc;WAI7B,YAAY,IAAI,cAAc;IAItC,OAAO,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;YA4ChF,kBAAkB;IAyChC,OAAO,CAAC,wBAAwB;IAqBhC;;OAEG;IACH,OAAO,CAAC,YAAY;IAuDpB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;CAqB7B;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,EAAE,SAAS,kBAAkB;;;;;;;;EAE7E,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,QAAQ,EAAE,cAAc,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;KACrF;CACF"}
@@ -10,9 +10,18 @@ export declare const TextClassificationInputSchema: {
10
10
  readonly type: "object";
11
11
  readonly properties: {
12
12
  readonly text: {
13
- readonly type: "string";
14
- readonly title: "Text";
15
- readonly description: "The text to classify";
13
+ readonly anyOf: readonly [{
14
+ readonly type: "string";
15
+ readonly title: "Text";
16
+ readonly description: "The text to classify";
17
+ }, {
18
+ readonly type: "array";
19
+ readonly items: {
20
+ readonly type: "string";
21
+ readonly title: "Text";
22
+ readonly description: "The text to classify";
23
+ };
24
+ }];
16
25
  };
17
26
  readonly candidateLabels: {
18
27
  readonly type: "array";
@@ -97,26 +106,52 @@ export declare const TextClassificationOutputSchema: {
97
106
  readonly type: "object";
98
107
  readonly properties: {
99
108
  readonly categories: {
100
- readonly type: "array";
101
- readonly items: {
102
- readonly type: "object";
103
- readonly properties: {
104
- readonly label: {
105
- readonly type: "string";
106
- readonly title: "Label";
107
- readonly description: "The name of the category";
109
+ readonly anyOf: readonly [{
110
+ readonly type: "array";
111
+ readonly items: {
112
+ readonly type: "object";
113
+ readonly properties: {
114
+ readonly label: {
115
+ readonly type: "string";
116
+ readonly title: "Label";
117
+ readonly description: "The name of the category";
118
+ };
119
+ readonly score: {
120
+ readonly type: "number";
121
+ readonly title: "Score";
122
+ readonly description: "The confidence score for this category";
123
+ };
108
124
  };
109
- readonly score: {
110
- readonly type: "number";
111
- readonly title: "Score";
112
- readonly description: "The confidence score for this category";
125
+ readonly required: readonly ["label", "score"];
126
+ readonly additionalProperties: false;
127
+ };
128
+ readonly title: "Categories";
129
+ readonly description: "The classification categories with their scores";
130
+ }, {
131
+ readonly type: "array";
132
+ readonly items: {
133
+ readonly type: "array";
134
+ readonly items: {
135
+ readonly type: "object";
136
+ readonly properties: {
137
+ readonly label: {
138
+ readonly type: "string";
139
+ readonly title: "Label";
140
+ readonly description: "The name of the category";
141
+ };
142
+ readonly score: {
143
+ readonly type: "number";
144
+ readonly title: "Score";
145
+ readonly description: "The confidence score for this category";
146
+ };
147
+ };
148
+ readonly required: readonly ["label", "score"];
149
+ readonly additionalProperties: false;
113
150
  };
151
+ readonly title: "Categories";
152
+ readonly description: "The classification categories with their scores";
114
153
  };
115
- readonly required: readonly ["label", "score"];
116
- readonly additionalProperties: false;
117
- };
118
- readonly title: "Categories";
119
- readonly description: "The classification categories with their scores";
154
+ }];
120
155
  };
121
156
  };
122
157
  readonly required: readonly ["categories"];
@@ -146,7 +181,10 @@ export declare const textClassification: (input: TextClassificationTaskInput, co
146
181
  categories: {
147
182
  score: number;
148
183
  label: string;
149
- }[];
184
+ }[] | {
185
+ score: number;
186
+ label: string;
187
+ }[][];
150
188
  }>;
151
189
  declare module "@workglow/task-graph" {
152
190
  interface Workflow {
@@ -1 +1 @@
1
- {"version":3,"file":"TextClassificationTask.d.ts","sourceRoot":"","sources":["../../src/task/TextClassificationTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAY,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BP,CAAC;AAEpC,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BR,CAAC;AAEpC,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAC3F,MAAM,MAAM,4BAA4B,GAAG,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAE7F;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,MAAM,CAChD,2BAA2B,EAC3B,4BAA4B,CAC7B;IACC,OAAc,IAAI,SAA4B;IAC9C,OAAc,QAAQ,SAAmB;IACzC,OAAc,KAAK,SAAqB;IACxC,OAAc,WAAW,SACwG;WACnH,WAAW,IAAI,cAAc;WAG7B,YAAY,IAAI,cAAc;CAG7C;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,2BAA2B,EAClC,SAAS,kBAAkB;;;;;;;;EAG5B,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,kBAAkB,EAAE,cAAc,CAChC,2BAA2B,EAC3B,4BAA4B,EAC5B,kBAAkB,CACnB,CAAC;KACH;CACF"}
@@ -10,9 +10,18 @@ export declare const TextFillMaskInputSchema: {
10
10
  readonly type: "object";
11
11
  readonly properties: {
12
12
  readonly text: {
13
- readonly type: "string";
14
- readonly title: "Text";
15
- readonly description: "The text with a mask token to fill";
13
+ readonly anyOf: readonly [{
14
+ readonly type: "string";
15
+ readonly title: "Text";
16
+ readonly description: "The text with a mask token to fill";
17
+ }, {
18
+ readonly type: "array";
19
+ readonly items: {
20
+ readonly type: "string";
21
+ readonly title: "Text";
22
+ readonly description: "The text with a mask token to fill";
23
+ };
24
+ }];
16
25
  };
17
26
  readonly model: {
18
27
  readonly oneOf: readonly [{
@@ -79,31 +88,62 @@ export declare const TextFillMaskOutputSchema: {
79
88
  readonly type: "object";
80
89
  readonly properties: {
81
90
  readonly predictions: {
82
- readonly type: "array";
83
- readonly items: {
84
- readonly type: "object";
85
- readonly properties: {
86
- readonly entity: {
87
- readonly type: "string";
88
- readonly title: "Entity";
89
- readonly description: "The token that was predicted to fill the mask";
90
- };
91
- readonly score: {
92
- readonly type: "number";
93
- readonly title: "Score";
94
- readonly description: "The confidence score for this prediction";
91
+ readonly anyOf: readonly [{
92
+ readonly type: "array";
93
+ readonly items: {
94
+ readonly type: "object";
95
+ readonly properties: {
96
+ readonly entity: {
97
+ readonly type: "string";
98
+ readonly title: "Entity";
99
+ readonly description: "The token that was predicted to fill the mask";
100
+ };
101
+ readonly score: {
102
+ readonly type: "number";
103
+ readonly title: "Score";
104
+ readonly description: "The confidence score for this prediction";
105
+ };
106
+ readonly sequence: {
107
+ readonly type: "string";
108
+ readonly title: "Sequence";
109
+ readonly description: "The complete text with the mask filled";
110
+ };
95
111
  };
96
- readonly sequence: {
97
- readonly type: "string";
98
- readonly title: "Sequence";
99
- readonly description: "The complete text with the mask filled";
112
+ readonly required: readonly ["entity", "score", "sequence"];
113
+ readonly additionalProperties: false;
114
+ };
115
+ readonly title: "Predictions";
116
+ readonly description: "The predicted tokens to fill the mask with their scores and complete sequences";
117
+ }, {
118
+ readonly type: "array";
119
+ readonly items: {
120
+ readonly type: "array";
121
+ readonly items: {
122
+ readonly type: "object";
123
+ readonly properties: {
124
+ readonly entity: {
125
+ readonly type: "string";
126
+ readonly title: "Entity";
127
+ readonly description: "The token that was predicted to fill the mask";
128
+ };
129
+ readonly score: {
130
+ readonly type: "number";
131
+ readonly title: "Score";
132
+ readonly description: "The confidence score for this prediction";
133
+ };
134
+ readonly sequence: {
135
+ readonly type: "string";
136
+ readonly title: "Sequence";
137
+ readonly description: "The complete text with the mask filled";
138
+ };
139
+ };
140
+ readonly required: readonly ["entity", "score", "sequence"];
141
+ readonly additionalProperties: false;
100
142
  };
143
+ readonly title: "Predictions";
144
+ readonly description: "The predicted tokens to fill the mask with their scores and complete sequences";
101
145
  };
102
- readonly required: readonly ["entity", "score", "sequence"];
103
- readonly additionalProperties: false;
104
- };
105
- readonly title: "Predictions";
106
- readonly description: "The predicted tokens to fill the mask with their scores and complete sequences";
146
+ }];
107
147
  };
108
148
  };
109
149
  readonly required: readonly ["predictions"];
@@ -133,7 +173,11 @@ export declare const textFillMask: (input: TextFillMaskTaskInput, config?: JobQu
133
173
  score: number;
134
174
  entity: string;
135
175
  sequence: string;
136
- }[];
176
+ }[] | {
177
+ score: number;
178
+ entity: string;
179
+ sequence: string;
180
+ }[][];
137
181
  }>;
138
182
  declare module "@workglow/task-graph" {
139
183
  interface Workflow {
@@ -1 +1 @@
1
- {"version":3,"file":"TextFillMaskTask.d.ts","sourceRoot":"","sources":["../../src/task/TextFillMaskTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAY,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYD,CAAC;AAEpC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCF,CAAC;AAEpC,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC/E,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEjF;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,CAAC;IACzF,OAAc,IAAI,SAAsB;IACxC,OAAc,QAAQ,SAAmB;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WAG7B,YAAY,IAAI,cAAc;CAG7C;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,qBAAqB,EAAE,SAAS,kBAAkB;;;;;;;;;;EAErF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,YAAY,EAAE,cAAc,CAAC,qBAAqB,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,CAAC;KACjG;CACF"}
@@ -67,9 +67,18 @@ export declare const TextGenerationInputSchema: {
67
67
  readonly format: import(".").TypeModelSemantic;
68
68
  };
69
69
  readonly prompt: {
70
- readonly type: "string";
71
- readonly title: "Prompt";
72
- readonly description: "The prompt to generate text from";
70
+ readonly anyOf: readonly [{
71
+ readonly type: "string";
72
+ readonly title: "Prompt";
73
+ readonly description: "The prompt to generate text from";
74
+ }, {
75
+ readonly type: "array";
76
+ readonly items: {
77
+ readonly type: "string";
78
+ readonly title: "Prompt";
79
+ readonly description: "The prompt to generate text from";
80
+ };
81
+ }];
73
82
  };
74
83
  readonly maxTokens: {
75
84
  readonly type: "number";
@@ -119,10 +128,20 @@ export declare const TextGenerationOutputSchema: {
119
128
  readonly type: "object";
120
129
  readonly properties: {
121
130
  readonly text: {
122
- readonly type: "string";
123
- readonly title: "Text";
124
- readonly description: "The generated text";
125
- readonly "x-stream": "append";
131
+ readonly anyOf: readonly [{
132
+ readonly type: "string";
133
+ readonly title: "Text";
134
+ readonly description: "The generated text";
135
+ readonly "x-stream": "append";
136
+ }, {
137
+ readonly type: "array";
138
+ readonly items: {
139
+ readonly type: "string";
140
+ readonly title: "Text";
141
+ readonly description: "The generated text";
142
+ readonly "x-stream": "append";
143
+ };
144
+ }];
126
145
  };
127
146
  };
128
147
  readonly required: readonly ["text"];
@@ -142,7 +161,7 @@ export declare class TextGenerationTask extends StreamingAiTask<TextGenerationTa
142
161
  * Task for generating text using a language model
143
162
  */
144
163
  export declare const textGeneration: (input: TextGenerationTaskInput, config?: JobQueueTaskConfig) => Promise<{
145
- text: string;
164
+ text: string | string[];
146
165
  }>;
147
166
  declare module "@workglow/task-graph" {
148
167
  interface Workflow {
@@ -1 +1 @@
1
- {"version":3,"file":"TextGenerationTask.d.ts","sourceRoot":"","sources":["../../src/task/TextGenerationTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAY,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAWzD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDH,CAAC;AAEpC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;CAOJ,CAAC;AAEpC,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACnF,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAErF,qBAAa,kBAAmB,SAAQ,eAAe,CACrD,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,CACnB;IACC,OAAc,IAAI,SAAwB;IAC1C,OAAc,QAAQ,SAAmB;IACzC,OAAc,KAAK,SAAqB;IACxC,OAAc,WAAW,SAC2D;WACtE,WAAW,IAAI,cAAc;WAG7B,YAAY,IAAI,cAAc;CAG7C;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,uBAAuB,EAAE,SAAS,kBAAkB;;EAEzF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,cAAc,EAAE,cAAc,CAC5B,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,CACnB,CAAC;KACH;CACF"}
1
+ {"version":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