@workglow/ai 0.0.79 → 0.0.80
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/README.md +3 -3
- package/dist/browser.js +235 -183
- package/dist/browser.js.map +36 -36
- package/dist/bun.js +235 -183
- package/dist/bun.js.map +36 -36
- package/dist/job/AiJob.d.ts +2 -1
- package/dist/job/AiJob.d.ts.map +1 -1
- package/dist/model/ModelRepository.d.ts +3 -3
- package/dist/model/ModelRepository.d.ts.map +1 -1
- package/dist/model/ModelSchema.d.ts +47 -2
- package/dist/model/ModelSchema.d.ts.map +1 -1
- package/dist/node.js +235 -183
- package/dist/node.js.map +36 -36
- package/dist/provider/AiProviderRegistry.d.ts +9 -9
- package/dist/provider/AiProviderRegistry.d.ts.map +1 -1
- package/dist/task/BackgroundRemovalTask.d.ts +4 -4
- package/dist/task/DocumentSplitterTask.d.ts +2 -2
- package/dist/task/DocumentSplitterTask.d.ts.map +1 -1
- package/dist/task/DownloadModelTask.d.ts +20 -20
- package/dist/task/FaceDetectorTask.d.ts +4 -4
- package/dist/task/FaceLandmarkerTask.d.ts +4 -4
- package/dist/task/GestureRecognizerTask.d.ts +4 -4
- package/dist/task/HandLandmarkerTask.d.ts +4 -4
- package/dist/task/ImageClassificationTask.d.ts +4 -4
- package/dist/task/ImageEmbeddingTask.d.ts +4 -4
- package/dist/task/ImageSegmentationTask.d.ts +4 -4
- package/dist/task/ImageToTextTask.d.ts +4 -4
- package/dist/task/ObjectDetectionTask.d.ts +4 -4
- package/dist/task/PoseLandmarkerTask.d.ts +4 -4
- package/dist/task/TextClassificationTask.d.ts +4 -4
- package/dist/task/TextEmbeddingTask.d.ts +4 -4
- package/dist/task/TextFillMaskTask.d.ts +4 -4
- package/dist/task/TextGenerationTask.d.ts +4 -4
- package/dist/task/TextLanguageDetectionTask.d.ts +4 -4
- package/dist/task/TextNamedEntityRecognitionTask.d.ts +4 -4
- package/dist/task/TextQuestionAnswerTask.d.ts +4 -4
- package/dist/task/TextRewriterTask.d.ts +4 -4
- package/dist/task/TextSummaryTask.d.ts +4 -4
- package/dist/task/TextTranslationTask.d.ts +4 -4
- package/dist/task/UnloadModelTask.d.ts +20 -20
- package/dist/task/UnloadModelTask.d.ts.map +1 -1
- package/dist/task/VectorSimilarityTask.d.ts +2 -2
- package/dist/task/VectorSimilarityTask.d.ts.map +1 -1
- package/dist/task/base/AiTask.d.ts +11 -3
- package/dist/task/base/AiTask.d.ts.map +1 -1
- package/dist/task/base/AiTaskSchemas.d.ts +2 -2
- package/dist/task/base/AiVisionTask.d.ts +3 -3
- package/dist/task/base/AiVisionTask.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -68,7 +68,7 @@ export declare const TextFillMaskInputSchema: {
|
|
|
68
68
|
readonly default: {};
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
readonly required: readonly ["
|
|
71
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
72
72
|
readonly format: "model";
|
|
73
73
|
readonly additionalProperties: false;
|
|
74
74
|
} & {
|
|
@@ -115,7 +115,7 @@ export declare const TextFillMaskInputSchema: {
|
|
|
115
115
|
readonly default: {};
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
-
readonly required: readonly ["
|
|
118
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
119
119
|
readonly format: "model";
|
|
120
120
|
readonly additionalProperties: false;
|
|
121
121
|
} & {
|
|
@@ -187,7 +187,7 @@ export declare class TextFillMaskTask extends AiTask<TextFillMaskTaskInput, Text
|
|
|
187
187
|
* @param input The input parameters for fill mask (text with mask token and model)
|
|
188
188
|
* @returns Promise resolving to the predicted tokens with scores and complete sequences
|
|
189
189
|
*/
|
|
190
|
-
export declare const
|
|
190
|
+
export declare const textFillMask: (input: TextFillMaskTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
191
191
|
predictions: {
|
|
192
192
|
score: number;
|
|
193
193
|
entity: string;
|
|
@@ -196,7 +196,7 @@ export declare const TextFillMask: (input: TextFillMaskTaskInput, config?: JobQu
|
|
|
196
196
|
}>;
|
|
197
197
|
declare module "@workglow/task-graph" {
|
|
198
198
|
interface Workflow {
|
|
199
|
-
|
|
199
|
+
textFillMask: CreateWorkflow<TextFillMaskTaskInput, TextFillMaskTaskOutput, JobQueueTaskConfig>;
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
//# sourceMappingURL=TextFillMaskTask.d.ts.map
|
|
@@ -50,7 +50,7 @@ export declare const TextGenerationInputSchema: {
|
|
|
50
50
|
readonly default: {};
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
readonly required: readonly ["
|
|
53
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
54
54
|
readonly format: "model";
|
|
55
55
|
readonly additionalProperties: false;
|
|
56
56
|
} & {
|
|
@@ -97,7 +97,7 @@ export declare const TextGenerationInputSchema: {
|
|
|
97
97
|
readonly default: {};
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
readonly required: readonly ["
|
|
100
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
101
101
|
readonly format: "model";
|
|
102
102
|
readonly additionalProperties: false;
|
|
103
103
|
} & {
|
|
@@ -210,12 +210,12 @@ export declare class TextGenerationTask extends AiTask<TextGenerationTaskInput,
|
|
|
210
210
|
/**
|
|
211
211
|
* Task for generating text using a language model
|
|
212
212
|
*/
|
|
213
|
-
export declare const
|
|
213
|
+
export declare const textGeneration: (input: TextGenerationTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
214
214
|
text: string | string[];
|
|
215
215
|
}>;
|
|
216
216
|
declare module "@workglow/task-graph" {
|
|
217
217
|
interface Workflow {
|
|
218
|
-
|
|
218
|
+
textGeneration: CreateWorkflow<TextGenerationTaskInput, TextGenerationTaskOutput, JobQueueTaskConfig>;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
//# sourceMappingURL=TextGenerationTask.d.ts.map
|
|
@@ -76,7 +76,7 @@ export declare const TextLanguageDetectionInputSchema: {
|
|
|
76
76
|
readonly default: {};
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
-
readonly required: readonly ["
|
|
79
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
80
80
|
readonly format: "model";
|
|
81
81
|
readonly additionalProperties: false;
|
|
82
82
|
} & {
|
|
@@ -123,7 +123,7 @@ export declare const TextLanguageDetectionInputSchema: {
|
|
|
123
123
|
readonly default: {};
|
|
124
124
|
};
|
|
125
125
|
};
|
|
126
|
-
readonly required: readonly ["
|
|
126
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
127
127
|
readonly format: "model";
|
|
128
128
|
readonly additionalProperties: false;
|
|
129
129
|
} & {
|
|
@@ -190,7 +190,7 @@ export declare class TextLanguageDetectionTask extends AiTask<TextLanguageDetect
|
|
|
190
190
|
* @param input The input parameters for language detection (text and model)
|
|
191
191
|
* @returns Promise resolving to the languages with scores
|
|
192
192
|
*/
|
|
193
|
-
export declare const
|
|
193
|
+
export declare const textLanguageDetection: (input: TextLanguageDetectionTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
194
194
|
languages: {
|
|
195
195
|
score: number;
|
|
196
196
|
language: string;
|
|
@@ -198,7 +198,7 @@ export declare const TextLanguageDetection: (input: TextLanguageDetectionTaskInp
|
|
|
198
198
|
}>;
|
|
199
199
|
declare module "@workglow/task-graph" {
|
|
200
200
|
interface Workflow {
|
|
201
|
-
|
|
201
|
+
textLanguageDetection: CreateWorkflow<TextLanguageDetectionTaskInput, TextLanguageDetectionTaskOutput, JobQueueTaskConfig>;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
//# sourceMappingURL=TextLanguageDetectionTask.d.ts.map
|
|
@@ -78,7 +78,7 @@ export declare const TextNamedEntityRecognitionInputSchema: {
|
|
|
78
78
|
readonly default: {};
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
readonly required: readonly ["
|
|
81
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
82
82
|
readonly format: "model";
|
|
83
83
|
readonly additionalProperties: false;
|
|
84
84
|
} & {
|
|
@@ -125,7 +125,7 @@ export declare const TextNamedEntityRecognitionInputSchema: {
|
|
|
125
125
|
readonly default: {};
|
|
126
126
|
};
|
|
127
127
|
};
|
|
128
|
-
readonly required: readonly ["
|
|
128
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
129
129
|
readonly format: "model";
|
|
130
130
|
readonly additionalProperties: false;
|
|
131
131
|
} & {
|
|
@@ -197,7 +197,7 @@ export declare class TextNamedEntityRecognitionTask extends AiTask<TextNamedEnti
|
|
|
197
197
|
* @param input The input parameters for named entity recognition (text and model)
|
|
198
198
|
* @returns Promise resolving to the extracted named entities with types, scores, and text
|
|
199
199
|
*/
|
|
200
|
-
export declare const
|
|
200
|
+
export declare const textNamedEntityRecognition: (input: TextNamedEntityRecognitionTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
201
201
|
entities: {
|
|
202
202
|
score: number;
|
|
203
203
|
entity: string;
|
|
@@ -206,7 +206,7 @@ export declare const TextNamedEntityRecognition: (input: TextNamedEntityRecognit
|
|
|
206
206
|
}>;
|
|
207
207
|
declare module "@workglow/task-graph" {
|
|
208
208
|
interface Workflow {
|
|
209
|
-
|
|
209
|
+
textNamedEntityRecognition: CreateWorkflow<TextNamedEntityRecognitionTaskInput, TextNamedEntityRecognitionTaskOutput, JobQueueTaskConfig>;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
//# sourceMappingURL=TextNamedEntityRecognitionTask.d.ts.map
|
|
@@ -86,7 +86,7 @@ export declare const TextQuestionAnswerInputSchema: {
|
|
|
86
86
|
readonly default: {};
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
readonly required: readonly ["
|
|
89
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
90
90
|
readonly format: "model";
|
|
91
91
|
readonly additionalProperties: false;
|
|
92
92
|
} & {
|
|
@@ -133,7 +133,7 @@ export declare const TextQuestionAnswerInputSchema: {
|
|
|
133
133
|
readonly default: {};
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
|
-
readonly required: readonly ["
|
|
136
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
137
137
|
readonly format: "model";
|
|
138
138
|
readonly additionalProperties: false;
|
|
139
139
|
} & {
|
|
@@ -194,12 +194,12 @@ export declare class TextQuestionAnswerTask extends AiTask<TextQuestionAnswerTas
|
|
|
194
194
|
* @param input The input parameters for text question answer (context, question, and model)
|
|
195
195
|
* @returns Promise resolving to the generated answer(s)
|
|
196
196
|
*/
|
|
197
|
-
export declare const
|
|
197
|
+
export declare const textQuestionAnswer: (input: TextQuestionAnswerTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
198
198
|
text: string | string[];
|
|
199
199
|
}>;
|
|
200
200
|
declare module "@workglow/task-graph" {
|
|
201
201
|
interface Workflow {
|
|
202
|
-
|
|
202
|
+
textQuestionAnswer: CreateWorkflow<TextQuestionAnswerTaskInput, TextQuestionAnswerTaskOutput, JobQueueTaskConfig>;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
//# sourceMappingURL=TextQuestionAnswerTask.d.ts.map
|
|
@@ -86,7 +86,7 @@ export declare const TextRewriterInputSchema: {
|
|
|
86
86
|
readonly default: {};
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
readonly required: readonly ["
|
|
89
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
90
90
|
readonly format: "model";
|
|
91
91
|
readonly additionalProperties: false;
|
|
92
92
|
} & {
|
|
@@ -133,7 +133,7 @@ export declare const TextRewriterInputSchema: {
|
|
|
133
133
|
readonly default: {};
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
|
-
readonly required: readonly ["
|
|
136
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
137
137
|
readonly format: "model";
|
|
138
138
|
readonly additionalProperties: false;
|
|
139
139
|
} & {
|
|
@@ -183,12 +183,12 @@ export declare class TextRewriterTask extends AiTask<TextRewriterTaskInput, Text
|
|
|
183
183
|
* @param input The input parameters for text rewriting (text, prompt, and model)
|
|
184
184
|
* @returns Promise resolving to the rewritten text output(s)
|
|
185
185
|
*/
|
|
186
|
-
export declare const
|
|
186
|
+
export declare const textRewriter: (input: TextRewriterTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
187
187
|
text: string;
|
|
188
188
|
}>;
|
|
189
189
|
declare module "@workglow/task-graph" {
|
|
190
190
|
interface Workflow {
|
|
191
|
-
|
|
191
|
+
textRewriter: CreateWorkflow<TextRewriterTaskInput, TextRewriterTaskOutput, JobQueueTaskConfig>;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
//# sourceMappingURL=TextRewriterTask.d.ts.map
|
|
@@ -68,7 +68,7 @@ export declare const TextSummaryInputSchema: {
|
|
|
68
68
|
readonly default: {};
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
readonly required: readonly ["
|
|
71
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
72
72
|
readonly format: "model";
|
|
73
73
|
readonly additionalProperties: false;
|
|
74
74
|
} & {
|
|
@@ -115,7 +115,7 @@ export declare const TextSummaryInputSchema: {
|
|
|
115
115
|
readonly default: {};
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
-
readonly required: readonly ["
|
|
118
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
119
119
|
readonly format: "model";
|
|
120
120
|
readonly additionalProperties: false;
|
|
121
121
|
} & {
|
|
@@ -165,12 +165,12 @@ export declare class TextSummaryTask extends AiTask<TextSummaryTaskInput, TextSu
|
|
|
165
165
|
* @param input The input parameters for text summary (text and model)
|
|
166
166
|
* @returns Promise resolving to the summarized text output(s)
|
|
167
167
|
*/
|
|
168
|
-
export declare const
|
|
168
|
+
export declare const textSummary: (input: TextSummaryTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
169
169
|
text: string;
|
|
170
170
|
}>;
|
|
171
171
|
declare module "@workglow/task-graph" {
|
|
172
172
|
interface Workflow {
|
|
173
|
-
|
|
173
|
+
textSummary: CreateWorkflow<TextSummaryTaskInput, TextSummaryTaskOutput, JobQueueTaskConfig>;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
//# sourceMappingURL=TextSummaryTask.d.ts.map
|
|
@@ -112,7 +112,7 @@ export declare const TextTranslationInputSchema: {
|
|
|
112
112
|
readonly default: {};
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
|
-
readonly required: readonly ["
|
|
115
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
116
116
|
readonly format: "model";
|
|
117
117
|
readonly additionalProperties: false;
|
|
118
118
|
} & {
|
|
@@ -159,7 +159,7 @@ export declare const TextTranslationInputSchema: {
|
|
|
159
159
|
readonly default: {};
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
|
-
readonly required: readonly ["
|
|
162
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
163
163
|
readonly format: "model";
|
|
164
164
|
readonly additionalProperties: false;
|
|
165
165
|
} & {
|
|
@@ -227,13 +227,13 @@ export declare class TextTranslationTask extends AiTask<TextTranslationTaskInput
|
|
|
227
227
|
* @param input The input parameters for text translation (text, model, source_lang, and target_lang)
|
|
228
228
|
* @returns Promise resolving to the translated text output(s)
|
|
229
229
|
*/
|
|
230
|
-
export declare const
|
|
230
|
+
export declare const textTranslation: (input: TextTranslationTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
231
231
|
text: string | string[];
|
|
232
232
|
target_lang: string;
|
|
233
233
|
}>;
|
|
234
234
|
declare module "@workglow/task-graph" {
|
|
235
235
|
interface Workflow {
|
|
236
|
-
|
|
236
|
+
textTranslation: CreateWorkflow<TextTranslationTaskInput, TextTranslationTaskOutput, JobQueueTaskConfig>;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
//# sourceMappingURL=TextTranslationTask.d.ts.map
|
|
@@ -50,7 +50,7 @@ declare const UnloadModelInputSchema: {
|
|
|
50
50
|
readonly default: {};
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
readonly required: readonly ["
|
|
53
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
54
54
|
readonly format: "model";
|
|
55
55
|
readonly additionalProperties: false;
|
|
56
56
|
} & {
|
|
@@ -97,7 +97,7 @@ declare const UnloadModelInputSchema: {
|
|
|
97
97
|
readonly default: {};
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
readonly required: readonly ["
|
|
100
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
101
101
|
readonly format: "model";
|
|
102
102
|
readonly additionalProperties: false;
|
|
103
103
|
} & {
|
|
@@ -157,7 +157,7 @@ declare const UnloadModelOutputSchema: {
|
|
|
157
157
|
readonly default: {};
|
|
158
158
|
};
|
|
159
159
|
};
|
|
160
|
-
readonly required: readonly ["
|
|
160
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
161
161
|
readonly format: "model";
|
|
162
162
|
readonly additionalProperties: false;
|
|
163
163
|
} & {
|
|
@@ -204,7 +204,7 @@ declare const UnloadModelOutputSchema: {
|
|
|
204
204
|
readonly default: {};
|
|
205
205
|
};
|
|
206
206
|
};
|
|
207
|
-
readonly required: readonly ["
|
|
207
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
208
208
|
readonly format: "model";
|
|
209
209
|
readonly additionalProperties: false;
|
|
210
210
|
} & {
|
|
@@ -246,36 +246,36 @@ export declare class UnloadModelTask extends AiTask<UnloadModelTaskRunInput, Unl
|
|
|
246
246
|
* @param input - Input containing model(s) to unload
|
|
247
247
|
* @returns Promise resolving to the unloaded model(s)
|
|
248
248
|
*/
|
|
249
|
-
export declare const
|
|
249
|
+
export declare const unloadModel: (input: UnloadModelTaskRunInput, config?: JobQueueTaskConfig) => Promise<{
|
|
250
250
|
model: string | {
|
|
251
|
-
title
|
|
252
|
-
description
|
|
253
|
-
model_id
|
|
254
|
-
tasks
|
|
251
|
+
title?: string | undefined;
|
|
252
|
+
description?: string | undefined;
|
|
253
|
+
model_id?: string | undefined;
|
|
254
|
+
tasks?: string[] | undefined;
|
|
255
|
+
metadata?: {
|
|
256
|
+
[x: string]: unknown;
|
|
257
|
+
} | undefined;
|
|
255
258
|
provider: string;
|
|
256
259
|
providerConfig: {
|
|
257
260
|
[x: string]: unknown;
|
|
258
261
|
};
|
|
259
|
-
metadata: {
|
|
260
|
-
[x: string]: unknown;
|
|
261
|
-
};
|
|
262
262
|
} | (string | {
|
|
263
|
-
title
|
|
264
|
-
description
|
|
265
|
-
model_id
|
|
266
|
-
tasks
|
|
263
|
+
title?: string | undefined;
|
|
264
|
+
description?: string | undefined;
|
|
265
|
+
model_id?: string | undefined;
|
|
266
|
+
tasks?: string[] | undefined;
|
|
267
|
+
metadata?: {
|
|
268
|
+
[x: string]: unknown;
|
|
269
|
+
} | undefined;
|
|
267
270
|
provider: string;
|
|
268
271
|
providerConfig: {
|
|
269
272
|
[x: string]: unknown;
|
|
270
273
|
};
|
|
271
|
-
metadata: {
|
|
272
|
-
[x: string]: unknown;
|
|
273
|
-
};
|
|
274
274
|
})[];
|
|
275
275
|
}>;
|
|
276
276
|
declare module "@workglow/task-graph" {
|
|
277
277
|
interface Workflow {
|
|
278
|
-
|
|
278
|
+
unloadModel: CreateWorkflow<UnloadModelTaskRunInput, UnloadModelTaskRunOutput, JobQueueTaskConfig>;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnloadModelTask.d.ts","sourceRoot":"","sources":["../../src/task/UnloadModelTask.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,QAA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;;;;;;;;CAOM,CAAC;AAEpC,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAChF,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAClF,MAAM,MAAM,2BAA2B,GAAG,qBAAqB,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC/F,MAAM,MAAM,4BAA4B,GAAG,qBAAqB,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEjG;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,MAAM,CACzC,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,CACnB;IACC,OAAc,IAAI,SAAqB;IACvC,OAAc,QAAQ,SAAY;IAClC,OAAc,KAAK,SAAkB;IACrC,OAAc,WAAW,SAAiE;WAC5E,WAAW,IAAI,cAAc;WAG7B,YAAY,IAAI,cAAc;IAG5C,OAAc,SAAS,UAAS;CACjC;AAID;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,uBAAuB,EAAE,SAAS,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,WAAW,EAAE,cAAc,CACzB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,CACnB,CAAC;KACH;CACF"}
|
|
@@ -318,13 +318,13 @@ export declare class VectorSimilarityTask extends ArrayTask<VectorSimilarityTask
|
|
|
318
318
|
score: number[];
|
|
319
319
|
}>;
|
|
320
320
|
}
|
|
321
|
-
export declare const
|
|
321
|
+
export declare const similarity: (input: VectorSimilarityTaskInput, config?: JobQueueTaskConfig) => Promise<{
|
|
322
322
|
output: TypedArray[];
|
|
323
323
|
score: number[];
|
|
324
324
|
}>;
|
|
325
325
|
declare module "@workglow/task-graph" {
|
|
326
326
|
interface Workflow {
|
|
327
|
-
|
|
327
|
+
similarity: CreateWorkflow<VectorSimilarityTaskInput, VectorSimilarityTaskOutput, JobQueueTaskConfig>;
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
export declare function inner(arr1: TypedArray, arr2: TypedArray): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorSimilarityTask.d.ts","sourceRoot":"","sources":["../../src/task/VectorSimilarityTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"VectorSimilarityTask.d.ts","sourceRoot":"","sources":["../../src/task/VectorSimilarityTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,cAAc,EACd,kBAAkB,EAInB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAoB,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE7F,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BQ,CAAC;AAEpC,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBO,CAAC;AAEpC,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAChD,OAAO,qBAAqB,EAC5B,uBAAuB,CACxB,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,UAAU,CACjD,OAAO,sBAAsB,EAC7B,uBAAuB,CACxB,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,SAAS,CACjD,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,CACnB;IACC,MAAM,CAAC,QAAQ,CAAC,IAAI,0BAA0B;IAC9C,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAc;IACtC,MAAM,CAAC,QAAQ,CAAC,KAAK,uBAAuB;IAC5C,OAAc,WAAW,SACwD;IACjF,MAAM,CAAC,QAAQ,CAAC,SAAS,QAAQ;WAEV,WAAW,IAAI,cAAc;WAG7B,YAAY,IAAI,cAAc;IAK/C,eAAe,CACnB,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,yBAAyB,EAC7D,SAAS,EAAE,0BAA0B;;;;CAsBxC;AAID,eAAO,MAAM,UAAU,GAAI,OAAO,yBAAyB,EAAE,SAAS,kBAAkB;;;EAEvF,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,UAAU,EAAE,cAAc,CACxB,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,CACnB,CAAC;KACH;CACF;AAMD,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAGhE;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,UAGxC;AASD,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAiBxD"}
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
import { Job } from "@workglow/job-queue";
|
|
10
10
|
import { JobQueueTask, JobQueueTaskConfig, TaskInput, type TaskOutput } from "@workglow/task-graph";
|
|
11
11
|
import { AiJobInput } from "../../job/AiJob";
|
|
12
|
-
import type { ModelRecord } from "../../model/ModelSchema";
|
|
12
|
+
import type { ModelConfig, ModelRecord } from "../../model/ModelSchema";
|
|
13
13
|
export interface AiSingleTaskInput extends TaskInput {
|
|
14
|
-
model: string;
|
|
14
|
+
model: string | ModelConfig;
|
|
15
15
|
}
|
|
16
16
|
export interface AiArrayTaskInput extends TaskInput {
|
|
17
|
-
model: string |
|
|
17
|
+
model: string | ModelConfig | (string | ModelConfig)[];
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* A base class for AI related tasks that run in a job queue.
|
|
@@ -35,6 +35,14 @@ export declare class AiTask<Input extends AiArrayTaskInput = AiArrayTaskInput, O
|
|
|
35
35
|
* @returns The AiJobInput to submit to the queue
|
|
36
36
|
*/
|
|
37
37
|
protected getJobInput(input: Input): Promise<AiJobInput<Input>>;
|
|
38
|
+
/**
|
|
39
|
+
* Resolves a model configuration for the given input.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* - If `input.model` is a string, it is resolved via the global model repository.
|
|
43
|
+
* - If `input.model` is already a config object, it is used directly.
|
|
44
|
+
*/
|
|
45
|
+
protected getModelConfigForInput(input: AiSingleTaskInput): Promise<ModelConfig>;
|
|
38
46
|
/**
|
|
39
47
|
* Creates a new Job instance for direct execution (without a queue).
|
|
40
48
|
* @param input - The task input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiTask.d.ts","sourceRoot":"","sources":["../../../src/task/base/AiTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAElB,SAAS,EACT,KAAK,UAAU,EAChB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAS,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"AiTask.d.ts","sourceRoot":"","sources":["../../../src/task/base/AiTask.ts"],"names":[],"mappings":"AAAA;;;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C,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;cAiBvD,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAWvF;;;;;OAKG;IACG,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;IAsE7C,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;CA6ChD"}
|
|
@@ -150,7 +150,7 @@ export declare function TypeModelByDetail<S extends TypeModelSemantic = "model",
|
|
|
150
150
|
readonly default: {};
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
|
-
readonly required: readonly ["
|
|
153
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
154
154
|
readonly format: "model";
|
|
155
155
|
readonly additionalProperties: false;
|
|
156
156
|
} & O & {
|
|
@@ -193,7 +193,7 @@ export declare function TypeModel<S extends TypeModelSemantic = "model", O exten
|
|
|
193
193
|
readonly default: {};
|
|
194
194
|
};
|
|
195
195
|
};
|
|
196
|
-
readonly required: readonly ["
|
|
196
|
+
readonly required: readonly ["provider", "providerConfig"];
|
|
197
197
|
readonly format: "model";
|
|
198
198
|
readonly additionalProperties: false;
|
|
199
199
|
} & O & {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { JobQueueTaskConfig, TaskInput, type TaskOutput } from "@workglow/task-graph";
|
|
10
10
|
import { AiJobInput } from "../../job/AiJob";
|
|
11
|
-
import type {
|
|
11
|
+
import type { ModelConfig } from "../../model/ModelSchema";
|
|
12
12
|
import { AiTask } from "./AiTask";
|
|
13
13
|
export interface AiVisionTaskSingleInput extends TaskInput {
|
|
14
|
-
model: string;
|
|
14
|
+
model: string | ModelConfig;
|
|
15
15
|
}
|
|
16
16
|
export interface AiVisionArrayTaskInput extends TaskInput {
|
|
17
|
-
model: string |
|
|
17
|
+
model: string | ModelConfig | (string | ModelConfig)[];
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* A base class for AI related tasks that run in a job queue.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiVisionTask.d.ts","sourceRoot":"","sources":["../../../src/task/base/AiVisionTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"AiVisionTask.d.ts","sourceRoot":"","sources":["../../../src/task/base/AiVisionTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,CAAC,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC;CACxD;AAED;;;GAGG;AACH,qBAAa,YAAY,CACvB,KAAK,SAAS,sBAAsB,GAAG,sBAAsB,EAC7D,MAAM,SAAS,UAAU,GAAG,UAAU,EACtC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,CACtD,SAAQ,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IACrC,OAAc,IAAI,EAAE,MAAM,CAAkB;IAC5C;;;;;OAKG;cACsB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;CA6B/E"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workglow/ai",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.80",
|
|
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.
|
|
40
|
-
"@workglow/storage": "0.0.
|
|
41
|
-
"@workglow/task-graph": "0.0.
|
|
42
|
-
"@workglow/util": "0.0.
|
|
39
|
+
"@workglow/job-queue": "0.0.80",
|
|
40
|
+
"@workglow/storage": "0.0.80",
|
|
41
|
+
"@workglow/task-graph": "0.0.80",
|
|
42
|
+
"@workglow/util": "0.0.80"
|
|
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.
|
|
60
|
-
"@workglow/storage": "0.0.
|
|
61
|
-
"@workglow/task-graph": "0.0.
|
|
62
|
-
"@workglow/util": "0.0.
|
|
59
|
+
"@workglow/job-queue": "0.0.80",
|
|
60
|
+
"@workglow/storage": "0.0.80",
|
|
61
|
+
"@workglow/task-graph": "0.0.80",
|
|
62
|
+
"@workglow/util": "0.0.80"
|
|
63
63
|
}
|
|
64
64
|
}
|