@workglow/ai 0.0.70 → 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.
@@ -0,0 +1,212 @@
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
+ import { DeReplicateFromSchema } from "./base/AiTaskSchemas";
10
+ export declare const TextNamedEntityRecognitionInputSchema: {
11
+ readonly type: "object";
12
+ readonly properties: {
13
+ readonly text: {
14
+ readonly "x-replicate": true;
15
+ readonly format?: string | undefined;
16
+ readonly oneOf: readonly [{
17
+ type: "string";
18
+ title: string;
19
+ description: string;
20
+ }, {
21
+ readonly type: "array";
22
+ readonly items: {
23
+ type: "string";
24
+ title: string;
25
+ description: string;
26
+ };
27
+ }];
28
+ readonly title: string | undefined;
29
+ readonly description: string | undefined;
30
+ };
31
+ readonly blockList: {
32
+ readonly type: "array";
33
+ readonly items: {
34
+ readonly type: "string";
35
+ };
36
+ readonly title: "Block List";
37
+ readonly description: "The entity types to exclude from results";
38
+ readonly "x-ui-group": "Configuration";
39
+ readonly "x-ui-group-open": false;
40
+ };
41
+ readonly model: {
42
+ readonly "x-replicate": true;
43
+ readonly format?: string | undefined;
44
+ readonly oneOf: readonly [{
45
+ readonly oneOf: readonly [{
46
+ readonly title: "Model";
47
+ readonly description: `The model ${string}`;
48
+ } & {
49
+ readonly format: import(".").TypeModelSemantic;
50
+ readonly type: "string";
51
+ }, {
52
+ readonly type: "object";
53
+ readonly properties: {
54
+ readonly model_id: {
55
+ readonly type: "string";
56
+ };
57
+ readonly tasks: {
58
+ readonly type: "array";
59
+ readonly items: {
60
+ readonly type: "string";
61
+ };
62
+ };
63
+ readonly title: {
64
+ readonly type: "string";
65
+ };
66
+ readonly description: {
67
+ readonly type: "string";
68
+ };
69
+ readonly provider: {
70
+ readonly type: "string";
71
+ };
72
+ readonly providerConfig: {
73
+ readonly type: "object";
74
+ readonly default: {};
75
+ };
76
+ readonly metadata: {
77
+ readonly type: "object";
78
+ readonly default: {};
79
+ };
80
+ };
81
+ readonly required: readonly ["model_id", "tasks", "provider", "title", "description", "providerConfig", "metadata"];
82
+ readonly format: "model";
83
+ readonly additionalProperties: false;
84
+ } & {
85
+ readonly format: import(".").TypeModelSemantic;
86
+ }];
87
+ } & {
88
+ readonly format: import(".").TypeModelSemantic;
89
+ }, {
90
+ readonly type: "array";
91
+ readonly items: {
92
+ readonly oneOf: readonly [{
93
+ readonly title: "Model";
94
+ readonly description: `The model ${string}`;
95
+ } & {
96
+ readonly format: import(".").TypeModelSemantic;
97
+ readonly type: "string";
98
+ }, {
99
+ readonly type: "object";
100
+ readonly properties: {
101
+ readonly model_id: {
102
+ readonly type: "string";
103
+ };
104
+ readonly tasks: {
105
+ readonly type: "array";
106
+ readonly items: {
107
+ readonly type: "string";
108
+ };
109
+ };
110
+ readonly title: {
111
+ readonly type: "string";
112
+ };
113
+ readonly description: {
114
+ readonly type: "string";
115
+ };
116
+ readonly provider: {
117
+ readonly type: "string";
118
+ };
119
+ readonly providerConfig: {
120
+ readonly type: "object";
121
+ readonly default: {};
122
+ };
123
+ readonly metadata: {
124
+ readonly type: "object";
125
+ readonly default: {};
126
+ };
127
+ };
128
+ readonly required: readonly ["model_id", "tasks", "provider", "title", "description", "providerConfig", "metadata"];
129
+ readonly format: "model";
130
+ readonly additionalProperties: false;
131
+ } & {
132
+ readonly format: import(".").TypeModelSemantic;
133
+ }];
134
+ } & {
135
+ readonly format: import(".").TypeModelSemantic;
136
+ };
137
+ }];
138
+ readonly title: string | undefined;
139
+ readonly description: string | undefined;
140
+ };
141
+ };
142
+ readonly required: readonly ["text", "model"];
143
+ readonly additionalProperties: false;
144
+ };
145
+ export declare const TextNamedEntityRecognitionOutputSchema: {
146
+ readonly type: "object";
147
+ readonly properties: {
148
+ readonly entities: {
149
+ readonly type: "array";
150
+ readonly items: {
151
+ readonly type: "object";
152
+ readonly properties: {
153
+ readonly entity: {
154
+ readonly type: "string";
155
+ readonly title: "Entity";
156
+ readonly description: "The type of the named entity";
157
+ };
158
+ readonly score: {
159
+ readonly type: "number";
160
+ readonly title: "Score";
161
+ readonly description: "The confidence score for this entity";
162
+ };
163
+ readonly word: {
164
+ readonly type: "string";
165
+ readonly title: "Word";
166
+ readonly description: "The extracted text of the named entity";
167
+ };
168
+ };
169
+ readonly required: readonly ["entity", "score", "word"];
170
+ readonly additionalProperties: false;
171
+ };
172
+ readonly title: "Entities";
173
+ readonly description: "The extracted named entities with their types, scores, and text";
174
+ };
175
+ };
176
+ readonly required: readonly ["entities"];
177
+ readonly additionalProperties: false;
178
+ };
179
+ export type TextNamedEntityRecognitionTaskInput = FromSchema<typeof TextNamedEntityRecognitionInputSchema>;
180
+ export type TextNamedEntityRecognitionTaskOutput = FromSchema<typeof TextNamedEntityRecognitionOutputSchema>;
181
+ export type TextNamedEntityRecognitionTaskExecuteInput = DeReplicateFromSchema<typeof TextNamedEntityRecognitionInputSchema>;
182
+ export type TextNamedEntityRecognitionTaskExecuteOutput = DeReplicateFromSchema<typeof TextNamedEntityRecognitionOutputSchema>;
183
+ /**
184
+ * Extracts named entities from text using language models
185
+ */
186
+ export declare class TextNamedEntityRecognitionTask extends AiTask<TextNamedEntityRecognitionTaskInput, TextNamedEntityRecognitionTaskOutput> {
187
+ static type: string;
188
+ static category: string;
189
+ static title: string;
190
+ static description: string;
191
+ static inputSchema(): DataPortSchema;
192
+ static outputSchema(): DataPortSchema;
193
+ }
194
+ /**
195
+ * Convenience function to run named entity recognition tasks.
196
+ * Creates and executes a TextNamedEntityRecognitionTask with the provided input.
197
+ * @param input The input parameters for named entity recognition (text and model)
198
+ * @returns Promise resolving to the extracted named entities with types, scores, and text
199
+ */
200
+ export declare const TextNamedEntityRecognition: (input: TextNamedEntityRecognitionTaskInput, config?: JobQueueTaskConfig) => Promise<{
201
+ entities: {
202
+ score: number;
203
+ entity: string;
204
+ word: string;
205
+ }[];
206
+ }>;
207
+ declare module "@workglow/task-graph" {
208
+ interface Workflow {
209
+ TextNamedEntityRecognition: CreateWorkflow<TextNamedEntityRecognitionTaskInput, TextNamedEntityRecognitionTaskOutput, JobQueueTaskConfig>;
210
+ }
211
+ }
212
+ //# sourceMappingURL=TextNamedEntityRecognitionTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextNamedEntityRecognitionTask.d.ts","sourceRoot":"","sources":["../../src/task/TextNamedEntityRecognitionTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAA0B,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAiC,MAAM,sBAAsB,CAAC;AAI5F,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBf,CAAC;AAEpC,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiChB,CAAC;AAEpC,MAAM,MAAM,mCAAmC,GAAG,UAAU,CAC1D,OAAO,qCAAqC,CAC7C,CAAC;AACF,MAAM,MAAM,oCAAoC,GAAG,UAAU,CAC3D,OAAO,sCAAsC,CAC9C,CAAC;AACF,MAAM,MAAM,0CAA0C,GAAG,qBAAqB,CAC5E,OAAO,qCAAqC,CAC7C,CAAC;AACF,MAAM,MAAM,2CAA2C,GAAG,qBAAqB,CAC7E,OAAO,sCAAsC,CAC9C,CAAC;AAEF;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,MAAM,CACxD,mCAAmC,EACnC,oCAAoC,CACrC;IACC,OAAc,IAAI,SAAoC;IACtD,OAAc,QAAQ,SAAmB;IACzC,OAAc,KAAK,SAAmC;IACtD,OAAc,WAAW,SAA6D;WACxE,WAAW,IAAI,cAAc;WAG7B,YAAY,IAAI,cAAc;CAG7C;AAID;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GACrC,OAAO,mCAAmC,EAC1C,SAAS,kBAAkB;;;;;;EAG5B,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,0BAA0B,EAAE,cAAc,CACxC,mCAAmC,EACnC,oCAAoC,EACpC,kBAAkB,CACnB,CAAC;KACH;CACF"}
@@ -9,8 +9,10 @@ export * from "./DocumentSplitterTask";
9
9
  export * from "./DownloadModelTask";
10
10
  export * from "./TextClassifierTask";
11
11
  export * from "./TextEmbeddingTask";
12
+ export * from "./TextFillMaskTask";
12
13
  export * from "./TextGenerationTask";
13
14
  export * from "./TextLanguageDetectionTask";
15
+ export * from "./TextNamedEntityRecognitionTask";
14
16
  export * from "./TextQuestionAnswerTask";
15
17
  export * from "./TextRewriterTask";
16
18
  export * from "./TextSummaryTask";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@workglow/ai",
3
3
  "type": "module",
4
- "version": "0.0.70",
4
+ "version": "0.0.71",
5
5
  "description": "Core AI functionality for Workglow, including task execution, model management, and AI pipeline orchestration.",
6
6
  "scripts": {
7
7
  "watch": "concurrently -c 'auto' 'bun:watch-*'",
@@ -36,10 +36,10 @@
36
36
  "access": "public"
37
37
  },
38
38
  "peerDependencies": {
39
- "@workglow/job-queue": "0.0.70",
40
- "@workglow/storage": "0.0.70",
41
- "@workglow/task-graph": "0.0.70",
42
- "@workglow/util": "0.0.70"
39
+ "@workglow/job-queue": "0.0.71",
40
+ "@workglow/storage": "0.0.71",
41
+ "@workglow/task-graph": "0.0.71",
42
+ "@workglow/util": "0.0.71"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "@workglow/job-queue": {
@@ -56,9 +56,9 @@
56
56
  }
57
57
  },
58
58
  "devDependencies": {
59
- "@workglow/job-queue": "0.0.70",
60
- "@workglow/storage": "0.0.70",
61
- "@workglow/task-graph": "0.0.70",
62
- "@workglow/util": "0.0.70"
59
+ "@workglow/job-queue": "0.0.71",
60
+ "@workglow/storage": "0.0.71",
61
+ "@workglow/task-graph": "0.0.71",
62
+ "@workglow/util": "0.0.71"
63
63
  }
64
64
  }