@workglow/ai-provider 0.0.99 → 0.0.100
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/{HFT_JobRunFns-ajak33q5.js → HFT_JobRunFns-aap9x58c.js} +8 -2
- package/dist/{HFT_JobRunFns-ajak33q5.js.map → HFT_JobRunFns-aap9x58c.js.map} +1 -1
- package/dist/anthropic/AnthropicProvider.d.ts +4 -4
- package/dist/anthropic/AnthropicProvider.d.ts.map +1 -1
- package/dist/anthropic/Anthropic_Worker.d.ts.map +1 -1
- package/dist/anthropic/common/Anthropic_JobRunFns.d.ts +4 -1
- package/dist/anthropic/common/Anthropic_JobRunFns.d.ts.map +1 -1
- package/dist/anthropic/index.js +21 -3
- package/dist/anthropic/index.js.map +4 -4
- package/dist/google-gemini/Gemini_Worker.d.ts.map +1 -1
- package/dist/google-gemini/GoogleGeminiProvider.d.ts +3 -3
- package/dist/google-gemini/GoogleGeminiProvider.d.ts.map +1 -1
- package/dist/google-gemini/common/Gemini_JobRunFns.d.ts +4 -1
- package/dist/google-gemini/common/Gemini_JobRunFns.d.ts.map +1 -1
- package/dist/google-gemini/index.js +21 -4
- package/dist/google-gemini/index.js.map +4 -4
- package/dist/hf-transformers/HFT_Worker.d.ts.map +1 -1
- package/dist/hf-transformers/HuggingFaceTransformersProvider.d.ts +3 -3
- package/dist/hf-transformers/HuggingFaceTransformersProvider.d.ts.map +1 -1
- package/dist/hf-transformers/common/HFT_JobRunFns.d.ts +61 -1
- package/dist/hf-transformers/common/HFT_JobRunFns.d.ts.map +1 -1
- package/dist/hf-transformers/index.js +10 -4
- package/dist/hf-transformers/index.js.map +3 -3
- package/dist/{index-kctzvn3c.js → index-236gqvq1.js} +12 -5
- package/dist/{index-kctzvn3c.js.map → index-236gqvq1.js.map} +3 -3
- package/dist/{index-9w5hs4zc.js → index-3tvpdt0s.js} +6 -4
- package/dist/{index-9w5hs4zc.js.map → index-3tvpdt0s.js.map} +3 -3
- package/dist/{index-2pvfsjyx.js → index-8jqhbz1h.js} +101 -141
- package/dist/index-8jqhbz1h.js.map +10 -0
- package/dist/{index-rmbnv0rw.js → index-b9310x5k.js} +5 -4
- package/dist/{index-rmbnv0rw.js.map → index-b9310x5k.js.map} +3 -3
- package/dist/{index-xyavfrb8.js → index-cfd8ne0j.js} +7 -4
- package/dist/{index-xyavfrb8.js.map → index-cfd8ne0j.js.map} +3 -3
- package/dist/{index-34rcjm0y.js → index-fgp2zg78.js} +8 -5
- package/dist/{index-34rcjm0y.js.map → index-fgp2zg78.js.map} +3 -3
- package/dist/{index-wnmajxg6.js → index-h5kwbbzq.js} +7 -4
- package/dist/{index-wnmajxg6.js.map → index-h5kwbbzq.js.map} +3 -3
- package/dist/{index-tn88s0ke.js → index-w496eeda.js} +6 -4
- package/dist/{index-tn88s0ke.js.map → index-w496eeda.js.map} +3 -3
- package/dist/index.js +10 -10
- package/dist/index.js.map +3 -3
- package/dist/provider-hf-inference/HfInferenceProvider.d.ts +2 -2
- package/dist/provider-hf-inference/HfInferenceProvider.d.ts.map +1 -1
- package/dist/provider-hf-inference/index.js +1 -1
- package/dist/provider-llamacpp/LlamaCppProvider.d.ts +3 -3
- package/dist/provider-llamacpp/LlamaCppProvider.d.ts.map +1 -1
- package/dist/provider-llamacpp/LlamaCpp_Worker.d.ts.map +1 -1
- package/dist/provider-llamacpp/common/LlamaCpp_JobRunFns.d.ts +4 -1
- package/dist/provider-llamacpp/common/LlamaCpp_JobRunFns.d.ts.map +1 -1
- package/dist/provider-llamacpp/index.js +18 -3
- package/dist/provider-llamacpp/index.js.map +4 -4
- package/dist/provider-ollama/OllamaProvider.d.ts +2 -2
- package/dist/provider-ollama/OllamaProvider.d.ts.map +1 -1
- package/dist/provider-ollama/index.browser.js +6 -4
- package/dist/provider-ollama/index.browser.js.map +3 -3
- package/dist/provider-ollama/index.js +1 -1
- package/dist/provider-openai/OpenAI_Worker.d.ts.map +1 -1
- package/dist/provider-openai/OpenAiProvider.d.ts +3 -3
- package/dist/provider-openai/OpenAiProvider.d.ts.map +1 -1
- package/dist/provider-openai/common/OpenAI_JobRunFns.d.ts +10 -1
- package/dist/provider-openai/common/OpenAI_JobRunFns.d.ts.map +1 -1
- package/dist/provider-openai/index.js +51 -4
- package/dist/provider-openai/index.js.map +4 -4
- package/dist/tf-mediapipe/TensorFlowMediaPipeProvider.d.ts +2 -2
- package/dist/tf-mediapipe/TensorFlowMediaPipeProvider.d.ts.map +1 -1
- package/dist/tf-mediapipe/index.js +3 -3
- package/dist/tf-mediapipe/index.js.map +3 -3
- package/package.json +19 -14
- package/dist/index-2pvfsjyx.js.map +0 -10
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HFT_BackgroundRemoval,
|
|
3
|
+
HFT_CountTokens,
|
|
4
|
+
HFT_CountTokens_Reactive,
|
|
3
5
|
HFT_Download,
|
|
4
6
|
HFT_ImageClassification,
|
|
5
7
|
HFT_ImageEmbedding,
|
|
6
8
|
HFT_ImageSegmentation,
|
|
7
9
|
HFT_ImageToText,
|
|
8
10
|
HFT_ObjectDetection,
|
|
11
|
+
HFT_REACTIVE_TASKS,
|
|
9
12
|
HFT_STREAM_TASKS,
|
|
10
13
|
HFT_TASKS,
|
|
11
14
|
HFT_TextClassification,
|
|
@@ -25,7 +28,7 @@ import {
|
|
|
25
28
|
HFT_TextTranslation_Stream,
|
|
26
29
|
HFT_Unload,
|
|
27
30
|
clearPipelineCache
|
|
28
|
-
} from "./index-
|
|
31
|
+
} from "./index-8jqhbz1h.js";
|
|
29
32
|
import"./index-m0r2hvfz.js";
|
|
30
33
|
import"./index-jd3bbc2x.js";
|
|
31
34
|
export {
|
|
@@ -48,13 +51,16 @@ export {
|
|
|
48
51
|
HFT_TextClassification,
|
|
49
52
|
HFT_TASKS,
|
|
50
53
|
HFT_STREAM_TASKS,
|
|
54
|
+
HFT_REACTIVE_TASKS,
|
|
51
55
|
HFT_ObjectDetection,
|
|
52
56
|
HFT_ImageToText,
|
|
53
57
|
HFT_ImageSegmentation,
|
|
54
58
|
HFT_ImageEmbedding,
|
|
55
59
|
HFT_ImageClassification,
|
|
56
60
|
HFT_Download,
|
|
61
|
+
HFT_CountTokens_Reactive,
|
|
62
|
+
HFT_CountTokens,
|
|
57
63
|
HFT_BackgroundRemoval
|
|
58
64
|
};
|
|
59
65
|
|
|
60
|
-
//# debugId=
|
|
66
|
+
//# debugId=B6941F8ED96A655E64756E2164756E21
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { AiProvider, type AiProviderRunFn, type AiProviderStreamFn } from "@workglow/ai";
|
|
6
|
+
import { AiProvider, type AiProviderReactiveRunFn, type AiProviderRunFn, type AiProviderStreamFn } from "@workglow/ai";
|
|
7
7
|
import type { AnthropicModelConfig } from "./common/Anthropic_ModelSchema";
|
|
8
8
|
/**
|
|
9
9
|
* AI provider for Anthropic cloud models.
|
|
@@ -28,12 +28,12 @@ import type { AnthropicModelConfig } from "./common/Anthropic_ModelSchema";
|
|
|
28
28
|
*
|
|
29
29
|
* // Inline mode -- caller provides the tasks:
|
|
30
30
|
* import { ANTHROPIC_TASKS } from "@workglow/ai-provider/anthropic";
|
|
31
|
-
* await new AnthropicProvider(ANTHROPIC_TASKS).register({ mode: "inline" });
|
|
31
|
+
* await new AnthropicProvider(ANTHROPIC_TASKS, ANTHROPIC_STREAM_TASKS, ANTHROPIC_REACTIVE_TASKS).register({ mode: "inline" });
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export declare class AnthropicProvider extends AiProvider<AnthropicModelConfig> {
|
|
35
35
|
readonly name = "ANTHROPIC";
|
|
36
|
-
readonly taskTypes: readonly ["TextGenerationTask", "TextRewriterTask", "TextSummaryTask"];
|
|
37
|
-
constructor(tasks?: Record<string, AiProviderRunFn<any, any, AnthropicModelConfig>>, streamTasks?: Record<string, AiProviderStreamFn<any, any, AnthropicModelConfig>>);
|
|
36
|
+
readonly taskTypes: readonly ["CountTokensTask", "TextGenerationTask", "TextRewriterTask", "TextSummaryTask"];
|
|
37
|
+
constructor(tasks?: Record<string, AiProviderRunFn<any, any, AnthropicModelConfig>>, streamTasks?: Record<string, AiProviderStreamFn<any, any, AnthropicModelConfig>>, reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, AnthropicModelConfig>>);
|
|
38
38
|
}
|
|
39
39
|
//# sourceMappingURL=AnthropicProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnthropicProvider.d.ts","sourceRoot":"","sources":["../../src/anthropic/AnthropicProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"AnthropicProvider.d.ts","sourceRoot":"","sources":["../../src/anthropic/AnthropicProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,UAAU,EACV,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,oBAAoB,CAAC;IACrE,QAAQ,CAAC,IAAI,eAAa;IAE1B,QAAQ,CAAC,SAAS,4FAKP;gBAGT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAAC,EACvE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAAC,EAChF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAAC;CAI1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Anthropic_Worker.d.ts","sourceRoot":"","sources":["../../src/anthropic/Anthropic_Worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"Anthropic_Worker.d.ts","sourceRoot":"","sources":["../../src/anthropic/Anthropic_Worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,wBAAgB,gCAAgC,SAS/C"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type { AiProviderRunFn, AiProviderStreamFn, TextGenerationTaskInput, TextGenerationTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
|
|
6
|
+
import type { AiProviderReactiveRunFn, AiProviderRunFn, AiProviderStreamFn, CountTokensTaskInput, CountTokensTaskOutput, TextGenerationTaskInput, TextGenerationTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
|
|
7
7
|
import type { AnthropicModelConfig } from "./Anthropic_ModelSchema";
|
|
8
8
|
export declare const Anthropic_TextGeneration: AiProviderRunFn<TextGenerationTaskInput, TextGenerationTaskOutput, AnthropicModelConfig>;
|
|
9
9
|
export declare const Anthropic_TextRewriter: AiProviderRunFn<TextRewriterTaskInput, TextRewriterTaskOutput, AnthropicModelConfig>;
|
|
@@ -11,6 +11,9 @@ export declare const Anthropic_TextSummary: AiProviderRunFn<TextSummaryTaskInput
|
|
|
11
11
|
export declare const Anthropic_TextGeneration_Stream: AiProviderStreamFn<TextGenerationTaskInput, TextGenerationTaskOutput, AnthropicModelConfig>;
|
|
12
12
|
export declare const Anthropic_TextRewriter_Stream: AiProviderStreamFn<TextRewriterTaskInput, TextRewriterTaskOutput, AnthropicModelConfig>;
|
|
13
13
|
export declare const Anthropic_TextSummary_Stream: AiProviderStreamFn<TextSummaryTaskInput, TextSummaryTaskOutput, AnthropicModelConfig>;
|
|
14
|
+
export declare const Anthropic_CountTokens: AiProviderRunFn<CountTokensTaskInput, CountTokensTaskOutput, AnthropicModelConfig>;
|
|
15
|
+
export declare const Anthropic_CountTokens_Reactive: AiProviderReactiveRunFn<CountTokensTaskInput, CountTokensTaskOutput, AnthropicModelConfig>;
|
|
14
16
|
export declare const ANTHROPIC_TASKS: Record<string, AiProviderRunFn<any, any, AnthropicModelConfig>>;
|
|
15
17
|
export declare const ANTHROPIC_STREAM_TASKS: Record<string, AiProviderStreamFn<any, any, AnthropicModelConfig>>;
|
|
18
|
+
export declare const ANTHROPIC_REACTIVE_TASKS: Record<string, AiProviderReactiveRunFn<any, any, AnthropicModelConfig>>;
|
|
16
19
|
//# sourceMappingURL=Anthropic_JobRunFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Anthropic_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/anthropic/common/Anthropic_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAgDpE,eAAO,MAAM,wBAAwB,EAAE,eAAe,CACpD,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,CAqBrB,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,eAAe,CAClD,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,CAoBrB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,oBAAoB,EACpB,qBAAqB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B,EAAE,kBAAkB,CAC5D,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,CAqBrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,kBAAkB,CAC3D,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,CAqBrB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,CAQrB,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,uBAAuB,CAClE,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,CAGrB,CAAC;AAMF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAK3F,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,MAAM,EACN,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAKnD,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,MAAM,EACN,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAGxD,CAAC"}
|
package/dist/anthropic/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
AnthropicModelRecordSchema,
|
|
5
5
|
AnthropicModelSchema,
|
|
6
6
|
AnthropicProvider
|
|
7
|
-
} from "../index-
|
|
7
|
+
} from "../index-236gqvq1.js";
|
|
8
8
|
import {
|
|
9
9
|
__require
|
|
10
10
|
} from "../index-jd3bbc2x.js";
|
|
@@ -138,7 +138,19 @@ var Anthropic_TextSummary_Stream = async function* (input, model, signal) {
|
|
|
138
138
|
}
|
|
139
139
|
yield { type: "finish", data: {} };
|
|
140
140
|
};
|
|
141
|
+
var Anthropic_CountTokens = async (input, model, onProgress, signal) => {
|
|
142
|
+
const client = await getClient(model);
|
|
143
|
+
const result = await client.messages.countTokens({
|
|
144
|
+
model: getModelName(model),
|
|
145
|
+
messages: [{ role: "user", content: input.text }]
|
|
146
|
+
});
|
|
147
|
+
return { count: result.input_tokens };
|
|
148
|
+
};
|
|
149
|
+
var Anthropic_CountTokens_Reactive = async (input, _output, _model) => {
|
|
150
|
+
return { count: Math.ceil(input.text.length / 4) };
|
|
151
|
+
};
|
|
141
152
|
var ANTHROPIC_TASKS = {
|
|
153
|
+
CountTokensTask: Anthropic_CountTokens,
|
|
142
154
|
TextGenerationTask: Anthropic_TextGeneration,
|
|
143
155
|
TextRewriterTask: Anthropic_TextRewriter,
|
|
144
156
|
TextSummaryTask: Anthropic_TextSummary
|
|
@@ -148,11 +160,14 @@ var ANTHROPIC_STREAM_TASKS = {
|
|
|
148
160
|
TextRewriterTask: Anthropic_TextRewriter_Stream,
|
|
149
161
|
TextSummaryTask: Anthropic_TextSummary_Stream
|
|
150
162
|
};
|
|
163
|
+
var ANTHROPIC_REACTIVE_TASKS = {
|
|
164
|
+
CountTokensTask: Anthropic_CountTokens_Reactive
|
|
165
|
+
};
|
|
151
166
|
|
|
152
167
|
// src/anthropic/Anthropic_Worker.ts
|
|
153
168
|
function ANTHROPIC_WORKER_JOBRUN_REGISTER() {
|
|
154
169
|
const workerServer = globalServiceRegistry.get(WORKER_SERVER);
|
|
155
|
-
new AnthropicProvider(ANTHROPIC_TASKS, ANTHROPIC_STREAM_TASKS).registerOnWorkerServer(workerServer);
|
|
170
|
+
new AnthropicProvider(ANTHROPIC_TASKS, ANTHROPIC_STREAM_TASKS, ANTHROPIC_REACTIVE_TASKS).registerOnWorkerServer(workerServer);
|
|
156
171
|
parentPort.postMessage({ type: "ready" });
|
|
157
172
|
console.log("ANTHROPIC_WORKER_JOBRUN registered");
|
|
158
173
|
}
|
|
@@ -163,6 +178,8 @@ export {
|
|
|
163
178
|
Anthropic_TextRewriter,
|
|
164
179
|
Anthropic_TextGeneration_Stream,
|
|
165
180
|
Anthropic_TextGeneration,
|
|
181
|
+
Anthropic_CountTokens_Reactive,
|
|
182
|
+
Anthropic_CountTokens,
|
|
166
183
|
AnthropicProvider,
|
|
167
184
|
AnthropicModelSchema,
|
|
168
185
|
AnthropicModelRecordSchema,
|
|
@@ -170,7 +187,8 @@ export {
|
|
|
170
187
|
ANTHROPIC_WORKER_JOBRUN_REGISTER,
|
|
171
188
|
ANTHROPIC_TASKS,
|
|
172
189
|
ANTHROPIC_STREAM_TASKS,
|
|
190
|
+
ANTHROPIC_REACTIVE_TASKS,
|
|
173
191
|
ANTHROPIC
|
|
174
192
|
};
|
|
175
193
|
|
|
176
|
-
//# debugId=
|
|
194
|
+
//# debugId=69DBF168AC9D125164756E2164756E21
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/anthropic/Anthropic_Worker.ts", "../src/anthropic/common/Anthropic_JobRunFns.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { globalServiceRegistry, parentPort, WORKER_SERVER } from \"@workglow/util\";\nimport { AnthropicProvider } from \"./AnthropicProvider\";\nimport {
|
|
6
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n AiProviderRunFn,\n AiProviderStreamFn,\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n} from \"@workglow/ai\";\nimport type { StreamEvent } from \"@workglow/task-graph\";\nimport type { AnthropicModelConfig } from \"./Anthropic_ModelSchema\";\n\nlet _sdk: typeof import(\"@anthropic-ai/sdk\") | undefined;\nasync function loadAnthropicSDK() {\n if (!_sdk) {\n try {\n _sdk = await import(\"@anthropic-ai/sdk\");\n } catch {\n throw new Error(\n \"@anthropic-ai/sdk is required for Anthropic tasks. Install it with: bun add @anthropic-ai/sdk\"\n );\n }\n }\n return _sdk.default;\n}\n\nasync function getClient(model: AnthropicModelConfig | undefined) {\n const Anthropic = await loadAnthropicSDK();\n const apiKey =\n model?.provider_config?.api_key ||\n (typeof process !== \"undefined\" ? process.env?.ANTHROPIC_API_KEY : undefined);\n if (!apiKey) {\n throw new Error(\n \"Missing Anthropic API key: set provider_config.api_key or the ANTHROPIC_API_KEY environment variable.\"\n );\n }\n return new Anthropic({\n apiKey,\n baseURL: model?.provider_config?.base_url || undefined,\n dangerouslyAllowBrowser: true,\n });\n}\n\nfunction getModelName(model: AnthropicModelConfig | undefined): string {\n const name = model?.provider_config?.model_name;\n if (!name) {\n throw new Error(\"Missing model name in provider_config.model_name.\");\n }\n return name;\n}\n\nfunction getMaxTokens(\n input: { maxTokens?: number },\n model: AnthropicModelConfig | undefined\n): number {\n return input.maxTokens ?? model?.provider_config?.max_tokens ?? 1024;\n}\n\nexport const Anthropic_TextGeneration: AiProviderRunFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n AnthropicModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Anthropic text generation\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.messages.create(\n {\n model: modelName,\n messages: [{ role: \"user\", content: input.prompt }],\n max_tokens: getMaxTokens(input, model),\n temperature: input.temperature,\n top_p: input.topP,\n },\n { signal }\n );\n\n const text = response.content[0]?.type === \"text\" ? response.content[0].text : \"\";\n\n update_progress(100, \"Completed Anthropic text generation\");\n return { text };\n};\n\nexport const Anthropic_TextRewriter: AiProviderRunFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n AnthropicModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Anthropic text rewriting\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.messages.create(\n {\n model: modelName,\n system: input.prompt,\n messages: [{ role: \"user\", content: input.text }],\n max_tokens: getMaxTokens({}, model),\n },\n { signal }\n );\n\n const text = response.content[0]?.type === \"text\" ? response.content[0].text : \"\";\n\n update_progress(100, \"Completed Anthropic text rewriting\");\n return { text };\n};\n\nexport const Anthropic_TextSummary: AiProviderRunFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n AnthropicModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Anthropic text summarization\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.messages.create(\n {\n model: modelName,\n system: \"Summarize the following text concisely.\",\n messages: [{ role: \"user\", content: input.text }],\n max_tokens: getMaxTokens({}, model),\n },\n { signal }\n );\n\n const text = response.content[0]?.type === \"text\" ? response.content[0].text : \"\";\n\n update_progress(100, \"Completed Anthropic text summarization\");\n return { text };\n};\n\n// ========================================================================\n// Streaming implementations (append mode)\n// ========================================================================\n\nexport const Anthropic_TextGeneration_Stream: AiProviderStreamFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n AnthropicModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextGenerationTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = client.messages.stream(\n {\n model: modelName,\n messages: [{ role: \"user\", content: input.prompt }],\n max_tokens: getMaxTokens(input, model),\n temperature: input.temperature,\n top_p: input.topP,\n },\n { signal }\n );\n\n for await (const event of stream) {\n if (event.type === \"content_block_delta\" && event.delta.type === \"text_delta\") {\n yield { type: \"text-delta\", port: \"text\", textDelta: event.delta.text };\n }\n }\n yield { type: \"finish\", data: {} as TextGenerationTaskOutput };\n};\n\nexport const Anthropic_TextRewriter_Stream: AiProviderStreamFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n AnthropicModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextRewriterTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = client.messages.stream(\n {\n model: modelName,\n system: input.prompt,\n messages: [{ role: \"user\", content: input.text }],\n max_tokens: getMaxTokens({}, model),\n },\n { signal }\n );\n\n for await (const event of stream) {\n if (event.type === \"content_block_delta\" && event.delta.type === \"text_delta\") {\n yield { type: \"text-delta\", port: \"text\", textDelta: event.delta.text };\n }\n }\n yield { type: \"finish\", data: {} as TextRewriterTaskOutput };\n};\n\nexport const Anthropic_TextSummary_Stream: AiProviderStreamFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n AnthropicModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextSummaryTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = client.messages.stream(\n {\n model: modelName,\n system: \"Summarize the following text concisely.\",\n messages: [{ role: \"user\", content: input.text }],\n max_tokens: getMaxTokens({}, model),\n },\n { signal }\n );\n\n for await (const event of stream) {\n if (event.type === \"content_block_delta\" && event.delta.type === \"text_delta\") {\n yield { type: \"text-delta\", port: \"text\", textDelta: event.delta.text };\n }\n }\n yield { type: \"finish\", data: {} as TextSummaryTaskOutput };\n};\n\n// ========================================================================\n// Task registries\n// ========================================================================\n\nexport const ANTHROPIC_TASKS: Record<string, AiProviderRunFn<any, any, AnthropicModelConfig>> = {\n TextGenerationTask: Anthropic_TextGeneration,\n TextRewriterTask: Anthropic_TextRewriter,\n TextSummaryTask: Anthropic_TextSummary,\n};\n\nexport const ANTHROPIC_STREAM_TASKS: Record<\n string,\n AiProviderStreamFn<any, any, AnthropicModelConfig>\n> = {\n TextGenerationTask: Anthropic_TextGeneration_Stream,\n TextRewriterTask: Anthropic_TextRewriter_Stream,\n TextSummaryTask: Anthropic_TextSummary_Stream,\n};\n"
|
|
5
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { globalServiceRegistry, parentPort, WORKER_SERVER } from \"@workglow/util\";\nimport { AnthropicProvider } from \"./AnthropicProvider\";\nimport {\n ANTHROPIC_REACTIVE_TASKS,\n ANTHROPIC_STREAM_TASKS,\n ANTHROPIC_TASKS,\n} from \"./common/Anthropic_JobRunFns\";\n\nexport function ANTHROPIC_WORKER_JOBRUN_REGISTER() {\n const workerServer = globalServiceRegistry.get(WORKER_SERVER);\n new AnthropicProvider(\n ANTHROPIC_TASKS,\n ANTHROPIC_STREAM_TASKS,\n ANTHROPIC_REACTIVE_TASKS\n ).registerOnWorkerServer(workerServer);\n parentPort.postMessage({ type: \"ready\" });\n console.log(\"ANTHROPIC_WORKER_JOBRUN registered\");\n}\n",
|
|
6
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type {\n AiProviderReactiveRunFn,\n AiProviderRunFn,\n AiProviderStreamFn,\n CountTokensTaskInput,\n CountTokensTaskOutput,\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n} from \"@workglow/ai\";\nimport type { StreamEvent } from \"@workglow/task-graph\";\nimport type { AnthropicModelConfig } from \"./Anthropic_ModelSchema\";\n\nlet _sdk: typeof import(\"@anthropic-ai/sdk\") | undefined;\nasync function loadAnthropicSDK() {\n if (!_sdk) {\n try {\n _sdk = await import(\"@anthropic-ai/sdk\");\n } catch {\n throw new Error(\n \"@anthropic-ai/sdk is required for Anthropic tasks. Install it with: bun add @anthropic-ai/sdk\"\n );\n }\n }\n return _sdk.default;\n}\n\nasync function getClient(model: AnthropicModelConfig | undefined) {\n const Anthropic = await loadAnthropicSDK();\n const apiKey =\n model?.provider_config?.api_key ||\n (typeof process !== \"undefined\" ? process.env?.ANTHROPIC_API_KEY : undefined);\n if (!apiKey) {\n throw new Error(\n \"Missing Anthropic API key: set provider_config.api_key or the ANTHROPIC_API_KEY environment variable.\"\n );\n }\n return new Anthropic({\n apiKey,\n baseURL: model?.provider_config?.base_url || undefined,\n dangerouslyAllowBrowser: true,\n });\n}\n\nfunction getModelName(model: AnthropicModelConfig | undefined): string {\n const name = model?.provider_config?.model_name;\n if (!name) {\n throw new Error(\"Missing model name in provider_config.model_name.\");\n }\n return name;\n}\n\nfunction getMaxTokens(\n input: { maxTokens?: number },\n model: AnthropicModelConfig | undefined\n): number {\n return input.maxTokens ?? model?.provider_config?.max_tokens ?? 1024;\n}\n\nexport const Anthropic_TextGeneration: AiProviderRunFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n AnthropicModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Anthropic text generation\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.messages.create(\n {\n model: modelName,\n messages: [{ role: \"user\", content: input.prompt }],\n max_tokens: getMaxTokens(input, model),\n temperature: input.temperature,\n top_p: input.topP,\n },\n { signal }\n );\n\n const text = response.content[0]?.type === \"text\" ? response.content[0].text : \"\";\n\n update_progress(100, \"Completed Anthropic text generation\");\n return { text };\n};\n\nexport const Anthropic_TextRewriter: AiProviderRunFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n AnthropicModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Anthropic text rewriting\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.messages.create(\n {\n model: modelName,\n system: input.prompt,\n messages: [{ role: \"user\", content: input.text }],\n max_tokens: getMaxTokens({}, model),\n },\n { signal }\n );\n\n const text = response.content[0]?.type === \"text\" ? response.content[0].text : \"\";\n\n update_progress(100, \"Completed Anthropic text rewriting\");\n return { text };\n};\n\nexport const Anthropic_TextSummary: AiProviderRunFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n AnthropicModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Anthropic text summarization\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.messages.create(\n {\n model: modelName,\n system: \"Summarize the following text concisely.\",\n messages: [{ role: \"user\", content: input.text }],\n max_tokens: getMaxTokens({}, model),\n },\n { signal }\n );\n\n const text = response.content[0]?.type === \"text\" ? response.content[0].text : \"\";\n\n update_progress(100, \"Completed Anthropic text summarization\");\n return { text };\n};\n\n// ========================================================================\n// Streaming implementations (append mode)\n// ========================================================================\n\nexport const Anthropic_TextGeneration_Stream: AiProviderStreamFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n AnthropicModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextGenerationTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = client.messages.stream(\n {\n model: modelName,\n messages: [{ role: \"user\", content: input.prompt }],\n max_tokens: getMaxTokens(input, model),\n temperature: input.temperature,\n top_p: input.topP,\n },\n { signal }\n );\n\n for await (const event of stream) {\n if (event.type === \"content_block_delta\" && event.delta.type === \"text_delta\") {\n yield { type: \"text-delta\", port: \"text\", textDelta: event.delta.text };\n }\n }\n yield { type: \"finish\", data: {} as TextGenerationTaskOutput };\n};\n\nexport const Anthropic_TextRewriter_Stream: AiProviderStreamFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n AnthropicModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextRewriterTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = client.messages.stream(\n {\n model: modelName,\n system: input.prompt,\n messages: [{ role: \"user\", content: input.text }],\n max_tokens: getMaxTokens({}, model),\n },\n { signal }\n );\n\n for await (const event of stream) {\n if (event.type === \"content_block_delta\" && event.delta.type === \"text_delta\") {\n yield { type: \"text-delta\", port: \"text\", textDelta: event.delta.text };\n }\n }\n yield { type: \"finish\", data: {} as TextRewriterTaskOutput };\n};\n\nexport const Anthropic_TextSummary_Stream: AiProviderStreamFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n AnthropicModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextSummaryTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = client.messages.stream(\n {\n model: modelName,\n system: \"Summarize the following text concisely.\",\n messages: [{ role: \"user\", content: input.text }],\n max_tokens: getMaxTokens({}, model),\n },\n { signal }\n );\n\n for await (const event of stream) {\n if (event.type === \"content_block_delta\" && event.delta.type === \"text_delta\") {\n yield { type: \"text-delta\", port: \"text\", textDelta: event.delta.text };\n }\n }\n yield { type: \"finish\", data: {} as TextSummaryTaskOutput };\n};\n\nexport const Anthropic_CountTokens: AiProviderRunFn<\n CountTokensTaskInput,\n CountTokensTaskOutput,\n AnthropicModelConfig\n> = async (input, model, onProgress, signal) => {\n const client = await getClient(model);\n const result = await client.messages.countTokens({\n model: getModelName(model),\n messages: [{ role: \"user\", content: input.text }],\n });\n return { count: result.input_tokens };\n};\n\nexport const Anthropic_CountTokens_Reactive: AiProviderReactiveRunFn<\n CountTokensTaskInput,\n CountTokensTaskOutput,\n AnthropicModelConfig\n> = async (input, _output, _model) => {\n return { count: Math.ceil(input.text.length / 4) };\n};\n\n// ========================================================================\n// Task registries\n// ========================================================================\n\nexport const ANTHROPIC_TASKS: Record<string, AiProviderRunFn<any, any, AnthropicModelConfig>> = {\n CountTokensTask: Anthropic_CountTokens,\n TextGenerationTask: Anthropic_TextGeneration,\n TextRewriterTask: Anthropic_TextRewriter,\n TextSummaryTask: Anthropic_TextSummary,\n};\n\nexport const ANTHROPIC_STREAM_TASKS: Record<\n string,\n AiProviderStreamFn<any, any, AnthropicModelConfig>\n> = {\n TextGenerationTask: Anthropic_TextGeneration_Stream,\n TextRewriterTask: Anthropic_TextRewriter_Stream,\n TextSummaryTask: Anthropic_TextSummary_Stream,\n};\n\nexport const ANTHROPIC_REACTIVE_TASKS: Record<\n string,\n AiProviderReactiveRunFn<any, any, AnthropicModelConfig>\n> = {\n CountTokensTask: Anthropic_CountTokens_Reactive,\n};\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;AAMA;;;
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";;;;;;;;;;;;AAMA;;;ACgBA,IAAI;AACJ,eAAe,gBAAgB,GAAG;AAAA,EACh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AAM,2BAGT;AAAA,EACF,iBAAiB;AACnB;;;ADnQO,SAAS,gCAAgC,GAAG;AAAA,EACjD,MAAM,eAAe,sBAAsB,IAAI,aAAa;AAAA,EAC5D,IAAI,kBACF,iBACA,wBACA,wBACF,EAAE,uBAAuB,YAAY;AAAA,EACrC,WAAW,YAAY,EAAE,MAAM,QAAQ,CAAC;AAAA,EACxC,QAAQ,IAAI,oCAAoC;AAAA;",
|
|
9
|
+
"debugId": "69DBF168AC9D125164756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gemini_Worker.d.ts","sourceRoot":"","sources":["../../src/google-gemini/Gemini_Worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"Gemini_Worker.d.ts","sourceRoot":"","sources":["../../src/google-gemini/Gemini_Worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,wBAAgB,6BAA6B,SAS5C"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { AiProvider, type AiProviderRunFn, type AiProviderStreamFn } from "@workglow/ai";
|
|
6
|
+
import { AiProvider, type AiProviderReactiveRunFn, type AiProviderRunFn, type AiProviderStreamFn } from "@workglow/ai";
|
|
7
7
|
import type { GeminiModelConfig } from "./common/Gemini_ModelSchema";
|
|
8
8
|
/**
|
|
9
9
|
* AI provider for Google Gemini cloud models.
|
|
@@ -30,7 +30,7 @@ import type { GeminiModelConfig } from "./common/Gemini_ModelSchema";
|
|
|
30
30
|
*/
|
|
31
31
|
export declare class GoogleGeminiProvider extends AiProvider<GeminiModelConfig> {
|
|
32
32
|
readonly name = "GOOGLE_GEMINI";
|
|
33
|
-
readonly taskTypes: readonly ["TextGenerationTask", "TextEmbeddingTask", "TextRewriterTask", "TextSummaryTask"];
|
|
34
|
-
constructor(tasks?: Record<string, AiProviderRunFn<any, any, GeminiModelConfig>>, streamTasks?: Record<string, AiProviderStreamFn<any, any, GeminiModelConfig>>);
|
|
33
|
+
readonly taskTypes: readonly ["CountTokensTask", "TextGenerationTask", "TextEmbeddingTask", "TextRewriterTask", "TextSummaryTask"];
|
|
34
|
+
constructor(tasks?: Record<string, AiProviderRunFn<any, any, GeminiModelConfig>>, streamTasks?: Record<string, AiProviderStreamFn<any, any, GeminiModelConfig>>, reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, GeminiModelConfig>>);
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=GoogleGeminiProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleGeminiProvider.d.ts","sourceRoot":"","sources":["../../src/google-gemini/GoogleGeminiProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"GoogleGeminiProvider.d.ts","sourceRoot":"","sources":["../../src/google-gemini/GoogleGeminiProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,UAAU,EACV,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,oBAAqB,SAAQ,UAAU,CAAC,iBAAiB,CAAC;IACrE,QAAQ,CAAC,IAAI,mBAAiB;IAE9B,QAAQ,CAAC,SAAS,iHAMP;gBAGT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC,EACpE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC,EAC7E,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAAC;CAIvF"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type { AiProviderRunFn, AiProviderStreamFn, TextEmbeddingTaskInput, TextEmbeddingTaskOutput, TextGenerationTaskInput, TextGenerationTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
|
|
6
|
+
import type { AiProviderReactiveRunFn, AiProviderRunFn, AiProviderStreamFn, CountTokensTaskInput, CountTokensTaskOutput, TextEmbeddingTaskInput, TextEmbeddingTaskOutput, TextGenerationTaskInput, TextGenerationTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
|
|
7
7
|
import type { GeminiModelConfig } from "./Gemini_ModelSchema";
|
|
8
8
|
export declare const Gemini_TextGeneration: AiProviderRunFn<TextGenerationTaskInput, TextGenerationTaskOutput, GeminiModelConfig>;
|
|
9
9
|
export declare const Gemini_TextEmbedding: AiProviderRunFn<TextEmbeddingTaskInput, TextEmbeddingTaskOutput, GeminiModelConfig>;
|
|
@@ -12,6 +12,9 @@ export declare const Gemini_TextSummary: AiProviderRunFn<TextSummaryTaskInput, T
|
|
|
12
12
|
export declare const Gemini_TextGeneration_Stream: AiProviderStreamFn<TextGenerationTaskInput, TextGenerationTaskOutput, GeminiModelConfig>;
|
|
13
13
|
export declare const Gemini_TextRewriter_Stream: AiProviderStreamFn<TextRewriterTaskInput, TextRewriterTaskOutput, GeminiModelConfig>;
|
|
14
14
|
export declare const Gemini_TextSummary_Stream: AiProviderStreamFn<TextSummaryTaskInput, TextSummaryTaskOutput, GeminiModelConfig>;
|
|
15
|
+
export declare const Gemini_CountTokens: AiProviderRunFn<CountTokensTaskInput, CountTokensTaskOutput, GeminiModelConfig>;
|
|
16
|
+
export declare const Gemini_CountTokens_Reactive: AiProviderReactiveRunFn<CountTokensTaskInput, CountTokensTaskOutput, GeminiModelConfig>;
|
|
15
17
|
export declare const GEMINI_TASKS: Record<string, AiProviderRunFn<any, any, GeminiModelConfig>>;
|
|
16
18
|
export declare const GEMINI_STREAM_TASKS: Record<string, AiProviderStreamFn<any, any, GeminiModelConfig>>;
|
|
19
|
+
export declare const GEMINI_REACTIVE_TASKS: Record<string, AiProviderReactiveRunFn<any, any, GeminiModelConfig>>;
|
|
17
20
|
//# sourceMappingURL=Gemini_JobRunFns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gemini_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/google-gemini/common/Gemini_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAsC9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CAqBlB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAChD,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CAgClB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAC/C,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAiBlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAiBlB,CAAC;AAMF,eAAO,MAAM,4BAA4B,EAAE,kBAAkB,CAC3D,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CAyBlB,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CACzD,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAqBlB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CACxD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAqBlB,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"Gemini_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/google-gemini/common/Gemini_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAsC9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CAqBlB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAChD,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CAgClB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAC/C,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAiBlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAiBlB,CAAC;AAMF,eAAO,MAAM,4BAA4B,EAAE,kBAAkB,CAC3D,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CAyBlB,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CACzD,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAqBlB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CACxD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAqBlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAOlB,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,uBAAuB,CAC/D,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAGlB,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAMrF,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,MAAM,EACN,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAKhD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,MAAM,EACN,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAGrD,CAAC"}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
GeminiModelRecordSchema,
|
|
5
5
|
GeminiModelSchema,
|
|
6
6
|
GoogleGeminiProvider
|
|
7
|
-
} from "../index-
|
|
7
|
+
} from "../index-h5kwbbzq.js";
|
|
8
8
|
import {
|
|
9
9
|
__require
|
|
10
10
|
} from "../index-jd3bbc2x.js";
|
|
@@ -162,7 +162,18 @@ var Gemini_TextSummary_Stream = async function* (input, model, signal) {
|
|
|
162
162
|
}
|
|
163
163
|
yield { type: "finish", data: {} };
|
|
164
164
|
};
|
|
165
|
+
var Gemini_CountTokens = async (input, model, onProgress, signal) => {
|
|
166
|
+
const GoogleGenerativeAI = await loadGeminiSDK();
|
|
167
|
+
const genAI = new GoogleGenerativeAI(getApiKey(model));
|
|
168
|
+
const genModel = genAI.getGenerativeModel({ model: getModelName(model) });
|
|
169
|
+
const result = await genModel.countTokens(input.text);
|
|
170
|
+
return { count: result.totalTokens };
|
|
171
|
+
};
|
|
172
|
+
var Gemini_CountTokens_Reactive = async (input, _output, _model) => {
|
|
173
|
+
return { count: Math.ceil(input.text.length / 4) };
|
|
174
|
+
};
|
|
165
175
|
var GEMINI_TASKS = {
|
|
176
|
+
CountTokensTask: Gemini_CountTokens,
|
|
166
177
|
TextGenerationTask: Gemini_TextGeneration,
|
|
167
178
|
TextEmbeddingTask: Gemini_TextEmbedding,
|
|
168
179
|
TextRewriterTask: Gemini_TextRewriter,
|
|
@@ -173,11 +184,14 @@ var GEMINI_STREAM_TASKS = {
|
|
|
173
184
|
TextRewriterTask: Gemini_TextRewriter_Stream,
|
|
174
185
|
TextSummaryTask: Gemini_TextSummary_Stream
|
|
175
186
|
};
|
|
187
|
+
var GEMINI_REACTIVE_TASKS = {
|
|
188
|
+
CountTokensTask: Gemini_CountTokens_Reactive
|
|
189
|
+
};
|
|
176
190
|
// src/google-gemini/Gemini_Worker.ts
|
|
177
191
|
import { globalServiceRegistry, parentPort, WORKER_SERVER } from "@workglow/util";
|
|
178
192
|
function GEMINI_WORKER_JOBRUN_REGISTER() {
|
|
179
193
|
const workerServer = globalServiceRegistry.get(WORKER_SERVER);
|
|
180
|
-
new GoogleGeminiProvider(GEMINI_TASKS, GEMINI_STREAM_TASKS).registerOnWorkerServer(workerServer);
|
|
194
|
+
new GoogleGeminiProvider(GEMINI_TASKS, GEMINI_STREAM_TASKS, GEMINI_REACTIVE_TASKS).registerOnWorkerServer(workerServer);
|
|
181
195
|
parentPort.postMessage({ type: "ready" });
|
|
182
196
|
console.log("GEMINI_WORKER_JOBRUN registered");
|
|
183
197
|
}
|
|
@@ -190,13 +204,16 @@ export {
|
|
|
190
204
|
Gemini_TextGeneration_Stream,
|
|
191
205
|
Gemini_TextGeneration,
|
|
192
206
|
Gemini_TextEmbedding,
|
|
207
|
+
Gemini_CountTokens_Reactive,
|
|
208
|
+
Gemini_CountTokens,
|
|
193
209
|
GeminiModelSchema,
|
|
194
210
|
GeminiModelRecordSchema,
|
|
195
211
|
GeminiModelConfigSchema,
|
|
196
212
|
GOOGLE_GEMINI,
|
|
197
213
|
GEMINI_WORKER_JOBRUN_REGISTER,
|
|
198
214
|
GEMINI_TASKS,
|
|
199
|
-
GEMINI_STREAM_TASKS
|
|
215
|
+
GEMINI_STREAM_TASKS,
|
|
216
|
+
GEMINI_REACTIVE_TASKS
|
|
200
217
|
};
|
|
201
218
|
|
|
202
|
-
//# debugId=
|
|
219
|
+
//# debugId=FBF18AFAE09C510F64756E2164756E21
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/google-gemini/common/Gemini_JobRunFns.ts", "../src/google-gemini/Gemini_Worker.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { TaskType } from \"@google/generative-ai\";\nimport type {\n AiProviderRunFn,\n AiProviderStreamFn,\n TextEmbeddingTaskInput,\n TextEmbeddingTaskOutput,\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n} from \"@workglow/ai\";\nimport type { StreamEvent } from \"@workglow/task-graph\";\nimport type { GeminiModelConfig } from \"./Gemini_ModelSchema\";\n\nlet _sdk: typeof import(\"@google/generative-ai\") | undefined;\nasync function loadGeminiSDK() {\n if (!_sdk) {\n try {\n _sdk = await import(\"@google/generative-ai\");\n } catch {\n throw new Error(\n \"@google/generative-ai is required for Gemini tasks. Install it with: bun add @google/generative-ai\"\n );\n }\n }\n return _sdk.GoogleGenerativeAI;\n}\n\nfunction getApiKey(model: GeminiModelConfig | undefined): string {\n const apiKey =\n model?.provider_config?.api_key ||\n (typeof process !== \"undefined\"\n ? process.env?.GOOGLE_API_KEY || process.env?.GEMINI_API_KEY\n : undefined);\n if (!apiKey) {\n throw new Error(\n \"Missing Google API key: set provider_config.api_key or the GOOGLE_API_KEY / GEMINI_API_KEY environment variable.\"\n );\n }\n return apiKey;\n}\n\nfunction getModelName(model: GeminiModelConfig | undefined): string {\n const name = model?.provider_config?.model_name;\n if (!name) {\n throw new Error(\"Missing model name in provider_config.model_name.\");\n }\n return name;\n}\n\nexport const Gemini_TextGeneration: AiProviderRunFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n GeminiModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Gemini text generation\");\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n generationConfig: {\n maxOutputTokens: input.maxTokens,\n temperature: input.temperature,\n topP: input.topP,\n },\n });\n\n const result = await genModel.generateContent({\n contents: [{ role: \"user\", parts: [{ text: input.prompt }] }],\n });\n\n const text = result.response.text();\n update_progress(100, \"Completed Gemini text generation\");\n return { text };\n};\n\nexport const Gemini_TextEmbedding: AiProviderRunFn<\n TextEmbeddingTaskInput,\n TextEmbeddingTaskOutput,\n GeminiModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Gemini text embedding\");\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const embeddingModel = genAI.getGenerativeModel({\n model: getModelName(model),\n });\n\n const taskType =\n (model?.provider_config?.embedding_task_type as TaskType) || (\"RETRIEVAL_DOCUMENT\" as TaskType);\n\n if (Array.isArray(input.text)) {\n const result = await embeddingModel.batchEmbedContents({\n requests: input.text.map((t) => ({\n content: { role: \"user\", parts: [{ text: t }] },\n taskType,\n })),\n });\n update_progress(100, \"Completed Gemini text embedding\");\n return {\n vector: result.embeddings.map((e) => new Float32Array(e.values)),\n };\n }\n\n const result = await embeddingModel.embedContent({\n content: { role: \"user\", parts: [{ text: input.text }] },\n taskType,\n });\n\n update_progress(100, \"Completed Gemini text embedding\");\n return { vector: new Float32Array(result.embedding.values) };\n};\n\nexport const Gemini_TextRewriter: AiProviderRunFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n GeminiModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Gemini text rewriting\");\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n systemInstruction: input.prompt,\n });\n\n const result = await genModel.generateContent({\n contents: [{ role: \"user\", parts: [{ text: input.text }] }],\n });\n\n const text = result.response.text();\n update_progress(100, \"Completed Gemini text rewriting\");\n return { text };\n};\n\nexport const Gemini_TextSummary: AiProviderRunFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n GeminiModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Gemini text summarization\");\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n systemInstruction: \"Summarize the following text concisely.\",\n });\n\n const result = await genModel.generateContent({\n contents: [{ role: \"user\", parts: [{ text: input.text }] }],\n });\n\n const text = result.response.text();\n update_progress(100, \"Completed Gemini text summarization\");\n return { text };\n};\n\n// ========================================================================\n// Streaming implementations (append mode)\n// ========================================================================\n\nexport const Gemini_TextGeneration_Stream: AiProviderStreamFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n GeminiModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextGenerationTaskOutput>> {\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n generationConfig: {\n maxOutputTokens: input.maxTokens,\n temperature: input.temperature,\n topP: input.topP,\n },\n });\n\n const result = await genModel.generateContentStream(\n { contents: [{ role: \"user\", parts: [{ text: input.prompt }] }] },\n { signal }\n );\n\n for await (const chunk of result.stream) {\n const text = chunk.text();\n if (text) {\n yield { type: \"text-delta\", port: \"text\", textDelta: text };\n }\n }\n yield { type: \"finish\", data: {} as TextGenerationTaskOutput };\n};\n\nexport const Gemini_TextRewriter_Stream: AiProviderStreamFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n GeminiModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextRewriterTaskOutput>> {\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n systemInstruction: input.prompt,\n });\n\n const result = await genModel.generateContentStream(\n { contents: [{ role: \"user\", parts: [{ text: input.text }] }] },\n { signal }\n );\n\n for await (const chunk of result.stream) {\n const text = chunk.text();\n if (text) {\n yield { type: \"text-delta\", port: \"text\", textDelta: text };\n }\n }\n yield { type: \"finish\", data: {} as TextRewriterTaskOutput };\n};\n\nexport const Gemini_TextSummary_Stream: AiProviderStreamFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n GeminiModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextSummaryTaskOutput>> {\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n systemInstruction: \"Summarize the following text concisely.\",\n });\n\n const result = await genModel.generateContentStream(\n { contents: [{ role: \"user\", parts: [{ text: input.text }] }] },\n { signal }\n );\n\n for await (const chunk of result.stream) {\n const text = chunk.text();\n if (text) {\n yield { type: \"text-delta\", port: \"text\", textDelta: text };\n }\n }\n yield { type: \"finish\", data: {} as TextSummaryTaskOutput };\n};\n\n// ========================================================================\n// Task registries\n// ========================================================================\n\nexport const GEMINI_TASKS: Record<string, AiProviderRunFn<any, any, GeminiModelConfig>> = {\n TextGenerationTask: Gemini_TextGeneration,\n TextEmbeddingTask: Gemini_TextEmbedding,\n TextRewriterTask: Gemini_TextRewriter,\n TextSummaryTask: Gemini_TextSummary,\n};\n\nexport const GEMINI_STREAM_TASKS: Record<\n string,\n AiProviderStreamFn<any, any, GeminiModelConfig>\n> = {\n TextGenerationTask: Gemini_TextGeneration_Stream,\n TextRewriterTask: Gemini_TextRewriter_Stream,\n TextSummaryTask: Gemini_TextSummary_Stream,\n};\n",
|
|
6
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { globalServiceRegistry, parentPort, WORKER_SERVER } from \"@workglow/util\";\nimport {
|
|
5
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { TaskType } from \"@google/generative-ai\";\nimport type {\n AiProviderReactiveRunFn,\n AiProviderRunFn,\n AiProviderStreamFn,\n CountTokensTaskInput,\n CountTokensTaskOutput,\n TextEmbeddingTaskInput,\n TextEmbeddingTaskOutput,\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n} from \"@workglow/ai\";\nimport type { StreamEvent } from \"@workglow/task-graph\";\nimport type { GeminiModelConfig } from \"./Gemini_ModelSchema\";\n\nlet _sdk: typeof import(\"@google/generative-ai\") | undefined;\nasync function loadGeminiSDK() {\n if (!_sdk) {\n try {\n _sdk = await import(\"@google/generative-ai\");\n } catch {\n throw new Error(\n \"@google/generative-ai is required for Gemini tasks. Install it with: bun add @google/generative-ai\"\n );\n }\n }\n return _sdk.GoogleGenerativeAI;\n}\n\nfunction getApiKey(model: GeminiModelConfig | undefined): string {\n const apiKey =\n model?.provider_config?.api_key ||\n (typeof process !== \"undefined\"\n ? process.env?.GOOGLE_API_KEY || process.env?.GEMINI_API_KEY\n : undefined);\n if (!apiKey) {\n throw new Error(\n \"Missing Google API key: set provider_config.api_key or the GOOGLE_API_KEY / GEMINI_API_KEY environment variable.\"\n );\n }\n return apiKey;\n}\n\nfunction getModelName(model: GeminiModelConfig | undefined): string {\n const name = model?.provider_config?.model_name;\n if (!name) {\n throw new Error(\"Missing model name in provider_config.model_name.\");\n }\n return name;\n}\n\nexport const Gemini_TextGeneration: AiProviderRunFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n GeminiModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Gemini text generation\");\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n generationConfig: {\n maxOutputTokens: input.maxTokens,\n temperature: input.temperature,\n topP: input.topP,\n },\n });\n\n const result = await genModel.generateContent({\n contents: [{ role: \"user\", parts: [{ text: input.prompt }] }],\n });\n\n const text = result.response.text();\n update_progress(100, \"Completed Gemini text generation\");\n return { text };\n};\n\nexport const Gemini_TextEmbedding: AiProviderRunFn<\n TextEmbeddingTaskInput,\n TextEmbeddingTaskOutput,\n GeminiModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Gemini text embedding\");\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const embeddingModel = genAI.getGenerativeModel({\n model: getModelName(model),\n });\n\n const taskType =\n (model?.provider_config?.embedding_task_type as TaskType) || (\"RETRIEVAL_DOCUMENT\" as TaskType);\n\n if (Array.isArray(input.text)) {\n const result = await embeddingModel.batchEmbedContents({\n requests: input.text.map((t) => ({\n content: { role: \"user\", parts: [{ text: t }] },\n taskType,\n })),\n });\n update_progress(100, \"Completed Gemini text embedding\");\n return {\n vector: result.embeddings.map((e) => new Float32Array(e.values)),\n };\n }\n\n const result = await embeddingModel.embedContent({\n content: { role: \"user\", parts: [{ text: input.text }] },\n taskType,\n });\n\n update_progress(100, \"Completed Gemini text embedding\");\n return { vector: new Float32Array(result.embedding.values) };\n};\n\nexport const Gemini_TextRewriter: AiProviderRunFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n GeminiModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Gemini text rewriting\");\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n systemInstruction: input.prompt,\n });\n\n const result = await genModel.generateContent({\n contents: [{ role: \"user\", parts: [{ text: input.text }] }],\n });\n\n const text = result.response.text();\n update_progress(100, \"Completed Gemini text rewriting\");\n return { text };\n};\n\nexport const Gemini_TextSummary: AiProviderRunFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n GeminiModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Gemini text summarization\");\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n systemInstruction: \"Summarize the following text concisely.\",\n });\n\n const result = await genModel.generateContent({\n contents: [{ role: \"user\", parts: [{ text: input.text }] }],\n });\n\n const text = result.response.text();\n update_progress(100, \"Completed Gemini text summarization\");\n return { text };\n};\n\n// ========================================================================\n// Streaming implementations (append mode)\n// ========================================================================\n\nexport const Gemini_TextGeneration_Stream: AiProviderStreamFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n GeminiModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextGenerationTaskOutput>> {\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n generationConfig: {\n maxOutputTokens: input.maxTokens,\n temperature: input.temperature,\n topP: input.topP,\n },\n });\n\n const result = await genModel.generateContentStream(\n { contents: [{ role: \"user\", parts: [{ text: input.prompt }] }] },\n { signal }\n );\n\n for await (const chunk of result.stream) {\n const text = chunk.text();\n if (text) {\n yield { type: \"text-delta\", port: \"text\", textDelta: text };\n }\n }\n yield { type: \"finish\", data: {} as TextGenerationTaskOutput };\n};\n\nexport const Gemini_TextRewriter_Stream: AiProviderStreamFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n GeminiModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextRewriterTaskOutput>> {\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n systemInstruction: input.prompt,\n });\n\n const result = await genModel.generateContentStream(\n { contents: [{ role: \"user\", parts: [{ text: input.text }] }] },\n { signal }\n );\n\n for await (const chunk of result.stream) {\n const text = chunk.text();\n if (text) {\n yield { type: \"text-delta\", port: \"text\", textDelta: text };\n }\n }\n yield { type: \"finish\", data: {} as TextRewriterTaskOutput };\n};\n\nexport const Gemini_TextSummary_Stream: AiProviderStreamFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n GeminiModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextSummaryTaskOutput>> {\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({\n model: getModelName(model),\n systemInstruction: \"Summarize the following text concisely.\",\n });\n\n const result = await genModel.generateContentStream(\n { contents: [{ role: \"user\", parts: [{ text: input.text }] }] },\n { signal }\n );\n\n for await (const chunk of result.stream) {\n const text = chunk.text();\n if (text) {\n yield { type: \"text-delta\", port: \"text\", textDelta: text };\n }\n }\n yield { type: \"finish\", data: {} as TextSummaryTaskOutput };\n};\n\nexport const Gemini_CountTokens: AiProviderRunFn<\n CountTokensTaskInput,\n CountTokensTaskOutput,\n GeminiModelConfig\n> = async (input, model, onProgress, signal) => {\n const GoogleGenerativeAI = await loadGeminiSDK();\n const genAI = new GoogleGenerativeAI(getApiKey(model));\n const genModel = genAI.getGenerativeModel({ model: getModelName(model) });\n const result = await genModel.countTokens(input.text);\n return { count: result.totalTokens };\n};\n\nexport const Gemini_CountTokens_Reactive: AiProviderReactiveRunFn<\n CountTokensTaskInput,\n CountTokensTaskOutput,\n GeminiModelConfig\n> = async (input, _output, _model) => {\n return { count: Math.ceil(input.text.length / 4) };\n};\n\n// ========================================================================\n// Task registries\n// ========================================================================\n\nexport const GEMINI_TASKS: Record<string, AiProviderRunFn<any, any, GeminiModelConfig>> = {\n CountTokensTask: Gemini_CountTokens,\n TextGenerationTask: Gemini_TextGeneration,\n TextEmbeddingTask: Gemini_TextEmbedding,\n TextRewriterTask: Gemini_TextRewriter,\n TextSummaryTask: Gemini_TextSummary,\n};\n\nexport const GEMINI_STREAM_TASKS: Record<\n string,\n AiProviderStreamFn<any, any, GeminiModelConfig>\n> = {\n TextGenerationTask: Gemini_TextGeneration_Stream,\n TextRewriterTask: Gemini_TextRewriter_Stream,\n TextSummaryTask: Gemini_TextSummary_Stream,\n};\n\nexport const GEMINI_REACTIVE_TASKS: Record<\n string,\n AiProviderReactiveRunFn<any, any, GeminiModelConfig>\n> = {\n CountTokensTask: Gemini_CountTokens_Reactive,\n};\n",
|
|
6
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { globalServiceRegistry, parentPort, WORKER_SERVER } from \"@workglow/util\";\nimport {\n GEMINI_REACTIVE_TASKS,\n GEMINI_STREAM_TASKS,\n GEMINI_TASKS,\n} from \"./common/Gemini_JobRunFns\";\nimport { GoogleGeminiProvider } from \"./GoogleGeminiProvider\";\n\nexport function GEMINI_WORKER_JOBRUN_REGISTER() {\n const workerServer = globalServiceRegistry.get(WORKER_SERVER);\n new GoogleGeminiProvider(\n GEMINI_TASKS,\n GEMINI_STREAM_TASKS,\n GEMINI_REACTIVE_TASKS\n ).registerOnWorkerServer(workerServer);\n parentPort.postMessage({ type: \"ready\" });\n console.log(\"GEMINI_WORKER_JOBRUN registered\");\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";;;;;;;;;;;AAyBA,IAAI;AACJ,eAAe,aAAa,GAAG;AAAA,EAC7B,IAAI,CAAC,MAAM;AAAA,IACT,IAAI;AAAA,MACF,OAAO,MAAa;AAAA,MACpB,MAAM;AAAA,MACN,MAAM,IAAI,MACR,oGACF;AAAA;AAAA,EAEJ;AAAA,EACA,OAAO,KAAK;AAAA;AAGd,SAAS,SAAS,CAAC,OAA8C;AAAA,EAC/D,MAAM,SACJ,OAAO,iBAAiB,YACvB,OAAO,YAAY,cAChB,QAAQ,KAAK,kBAAkB,QAAQ,KAAK,iBAC5C;AAAA,EACN,IAAI,CAAC,QAAQ;AAAA,IACX,MAAM,IAAI,MACR,kHACF;AAAA,EACF;AAAA,EACA,OAAO;AAAA;AAGT,SAAS,YAAY,CAAC,OAA8C;AAAA,EAClE,MAAM,OAAO,OAAO,iBAAiB;AAAA,EACrC,IAAI,CAAC,MAAM;AAAA,IACT,MAAM,IAAI,MAAM,mDAAmD;AAAA,EACrE;AAAA,EACA,OAAO;AAAA;AAGF,IAAM,wBAIT,OAAO,OAAO,OAAO,iBAAiB,WAAW;AAAA,EACnD,gBAAgB,GAAG,iCAAiC;AAAA,EACpD,MAAM,qBAAqB,MAAM,cAAc;AAAA,EAC/C,MAAM,QAAQ,IAAI,mBAAmB,UAAU,KAAK,CAAC;AAAA,EACrD,MAAM,WAAW,MAAM,mBAAmB;AAAA,IACxC,OAAO,aAAa,KAAK;AAAA,IACzB,kBAAkB;AAAA,MAChB,iBAAiB,MAAM;AAAA,MACvB,aAAa,MAAM;AAAA,MACnB,MAAM,MA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pC,OAAO,EAAE,OAAO,KAAK,KAAK,MAAM,KAAK,SAAS,CAAC,EAAE;AAAA;AAO5C,IAAM,eAA6E;AAAA,EACxF,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,iBAAiB;AACnB;AAEO,IAAM,sBAGT;AAAA,EACF,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB,iBAAiB;AACnB;AAEO,IAAM,wBAGT;AAAA,EACF,iBAAiB;AACnB;;ACtSA;AAQO,SAAS,6BAA6B,GAAG;AAAA,EAC9C,MAAM,eAAe,sBAAsB,IAAI,aAAa;AAAA,EAC5D,IAAI,qBACF,cACA,qBACA,qBACF,EAAE,uBAAuB,YAAY;AAAA,EACrC,WAAW,YAAY,EAAE,MAAM,QAAQ,CAAC;AAAA,EACxC,QAAQ,IAAI,iCAAiC;AAAA;",
|
|
9
|
+
"debugId": "FBF18AFAE09C510F64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HFT_Worker.d.ts","sourceRoot":"","sources":["../../src/hf-transformers/HFT_Worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wBAAgB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"HFT_Worker.d.ts","sourceRoot":"","sources":["../../src/hf-transformers/HFT_Worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wBAAgB,0BAA0B,SASzC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { AiProvider, type AiProviderRegisterOptions, type AiProviderRunFn, type AiProviderStreamFn } from "@workglow/ai";
|
|
6
|
+
import { AiProvider, type AiProviderReactiveRunFn, type AiProviderRegisterOptions, type AiProviderRunFn, type AiProviderStreamFn } from "@workglow/ai";
|
|
7
7
|
import type { HfTransformersOnnxModelConfig } from "./common/HFT_ModelSchema";
|
|
8
8
|
/**
|
|
9
9
|
* AI provider for HuggingFace Transformers ONNX models.
|
|
@@ -33,8 +33,8 @@ import type { HfTransformersOnnxModelConfig } from "./common/HFT_ModelSchema";
|
|
|
33
33
|
*/
|
|
34
34
|
export declare class HuggingFaceTransformersProvider extends AiProvider<HfTransformersOnnxModelConfig> {
|
|
35
35
|
readonly name = "HF_TRANSFORMERS_ONNX";
|
|
36
|
-
readonly taskTypes: readonly ["DownloadModelTask", "UnloadModelTask", "TextEmbeddingTask", "TextGenerationTask", "TextQuestionAnswerTask", "TextLanguageDetectionTask", "TextClassificationTask", "TextFillMaskTask", "TextNamedEntityRecognitionTask", "TextRewriterTask", "TextSummaryTask", "TextTranslationTask", "ImageSegmentationTask", "ImageToTextTask", "BackgroundRemovalTask", "ImageEmbeddingTask", "ImageClassificationTask", "ObjectDetectionTask"];
|
|
37
|
-
constructor(tasks?: Record<string, AiProviderRunFn<any, any, HfTransformersOnnxModelConfig>>, streamTasks?: Record<string, AiProviderStreamFn<any, any, HfTransformersOnnxModelConfig>>);
|
|
36
|
+
readonly taskTypes: readonly ["DownloadModelTask", "UnloadModelTask", "CountTokensTask", "TextEmbeddingTask", "TextGenerationTask", "TextQuestionAnswerTask", "TextLanguageDetectionTask", "TextClassificationTask", "TextFillMaskTask", "TextNamedEntityRecognitionTask", "TextRewriterTask", "TextSummaryTask", "TextTranslationTask", "ImageSegmentationTask", "ImageToTextTask", "BackgroundRemovalTask", "ImageEmbeddingTask", "ImageClassificationTask", "ObjectDetectionTask"];
|
|
37
|
+
constructor(tasks?: Record<string, AiProviderRunFn<any, any, HfTransformersOnnxModelConfig>>, streamTasks?: Record<string, AiProviderStreamFn<any, any, HfTransformersOnnxModelConfig>>, reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, HfTransformersOnnxModelConfig>>);
|
|
38
38
|
protected onInitialize(options: AiProviderRegisterOptions): Promise<void>;
|
|
39
39
|
dispose(): Promise<void>;
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HuggingFaceTransformersProvider.d.ts","sourceRoot":"","sources":["../../src/hf-transformers/HuggingFaceTransformersProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,UAAU,EACV,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,+BAAgC,SAAQ,UAAU,CAAC,6BAA6B,CAAC;IAC5F,QAAQ,CAAC,IAAI,0BAAwB;IAErC,QAAQ,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"HuggingFaceTransformersProvider.d.ts","sourceRoot":"","sources":["../../src/hf-transformers/HuggingFaceTransformersProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,UAAU,EACV,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,+BAAgC,SAAQ,UAAU,CAAC,6BAA6B,CAAC;IAC5F,QAAQ,CAAC,IAAI,0BAAwB;IAErC,QAAQ,CAAC,SAAS,ocAoBP;gBAGT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAAC,EAChF,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAAC,EACzF,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAAC;cAKzE,YAAY,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAMxC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import type { AiProviderRunFn, AiProviderStreamFn, BackgroundRemovalTaskInput, BackgroundRemovalTaskOutput, DownloadModelTaskRunInput, DownloadModelTaskRunOutput, ImageClassificationTaskInput, ImageClassificationTaskOutput, ImageEmbeddingTaskInput, ImageEmbeddingTaskOutput, ImageSegmentationTaskInput, ImageSegmentationTaskOutput, ImageToTextTaskInput, ImageToTextTaskOutput, ObjectDetectionTaskInput, ObjectDetectionTaskOutput, TextClassificationTaskInput, TextClassificationTaskOutput, TextEmbeddingTaskInput, TextEmbeddingTaskOutput, TextFillMaskTaskInput, TextFillMaskTaskOutput, TextGenerationTaskInput, TextGenerationTaskOutput, TextLanguageDetectionTaskInput, TextLanguageDetectionTaskOutput, TextNamedEntityRecognitionTaskInput, TextNamedEntityRecognitionTaskOutput, TextQuestionAnswerTaskInput, TextQuestionAnswerTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput, TextTranslationTaskInput, TextTranslationTaskOutput, UnloadModelTaskRunInput, UnloadModelTaskRunOutput } from "@workglow/ai";
|
|
6
|
+
import type { AiProviderReactiveRunFn, AiProviderRunFn, AiProviderStreamFn, BackgroundRemovalTaskInput, BackgroundRemovalTaskOutput, CountTokensTaskInput, CountTokensTaskOutput, DownloadModelTaskRunInput, DownloadModelTaskRunOutput, ImageClassificationTaskInput, ImageClassificationTaskOutput, ImageEmbeddingTaskInput, ImageEmbeddingTaskOutput, ImageSegmentationTaskInput, ImageSegmentationTaskOutput, ImageToTextTaskInput, ImageToTextTaskOutput, ObjectDetectionTaskInput, ObjectDetectionTaskOutput, TextClassificationTaskInput, TextClassificationTaskOutput, TextEmbeddingTaskInput, TextEmbeddingTaskOutput, TextFillMaskTaskInput, TextFillMaskTaskOutput, TextGenerationTaskInput, TextGenerationTaskOutput, TextLanguageDetectionTaskInput, TextLanguageDetectionTaskOutput, TextNamedEntityRecognitionTaskInput, TextNamedEntityRecognitionTaskOutput, TextQuestionAnswerTaskInput, TextQuestionAnswerTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput, TextTranslationTaskInput, TextTranslationTaskOutput, UnloadModelTaskRunInput, UnloadModelTaskRunOutput } from "@workglow/ai";
|
|
7
7
|
import { TypedArray } from "@workglow/util";
|
|
8
8
|
import { HfTransformersOnnxModelConfig } from "./HFT_ModelSchema";
|
|
9
9
|
/**
|
|
@@ -85,6 +85,8 @@ export declare const HFT_TextRewriter_Stream: AiProviderStreamFn<TextRewriterTas
|
|
|
85
85
|
export declare const HFT_TextSummary_Stream: AiProviderStreamFn<TextSummaryTaskInput, TextSummaryTaskOutput, HfTransformersOnnxModelConfig>;
|
|
86
86
|
export declare const HFT_TextQuestionAnswer_Stream: AiProviderStreamFn<TextQuestionAnswerTaskInput, TextQuestionAnswerTaskOutput, HfTransformersOnnxModelConfig>;
|
|
87
87
|
export declare const HFT_TextTranslation_Stream: AiProviderStreamFn<TextTranslationTaskInput, TextTranslationTaskOutput, HfTransformersOnnxModelConfig>;
|
|
88
|
+
export declare const HFT_CountTokens: AiProviderRunFn<CountTokensTaskInput, CountTokensTaskOutput, HfTransformersOnnxModelConfig>;
|
|
89
|
+
export declare const HFT_CountTokens_Reactive: AiProviderReactiveRunFn<CountTokensTaskInput, CountTokensTaskOutput, HfTransformersOnnxModelConfig>;
|
|
88
90
|
/**
|
|
89
91
|
* All HuggingFace Transformers task run functions, keyed by task type name.
|
|
90
92
|
* Pass this to `new HuggingFaceTransformersProvider(HFT_TASKS)` when the
|
|
@@ -229,6 +231,63 @@ export declare const HFT_TASKS: {
|
|
|
229
231
|
model_path: string;
|
|
230
232
|
};
|
|
231
233
|
}>;
|
|
234
|
+
readonly CountTokensTask: AiProviderRunFn<{
|
|
235
|
+
model: string | {
|
|
236
|
+
[x: string]: unknown;
|
|
237
|
+
title?: string | undefined;
|
|
238
|
+
description?: string | undefined;
|
|
239
|
+
model_id?: string | undefined;
|
|
240
|
+
tasks?: string[] | undefined;
|
|
241
|
+
metadata?: {
|
|
242
|
+
[x: string]: unknown;
|
|
243
|
+
} | undefined;
|
|
244
|
+
provider: string;
|
|
245
|
+
provider_config: {
|
|
246
|
+
[x: string]: unknown;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
text: string;
|
|
250
|
+
}, {
|
|
251
|
+
count: number;
|
|
252
|
+
}, {
|
|
253
|
+
title?: string | undefined;
|
|
254
|
+
description?: string | undefined;
|
|
255
|
+
model_id?: string | undefined;
|
|
256
|
+
tasks?: string[] | undefined;
|
|
257
|
+
metadata?: {
|
|
258
|
+
[x: string]: unknown;
|
|
259
|
+
} | undefined;
|
|
260
|
+
provider: "HF_TRANSFORMERS_ONNX";
|
|
261
|
+
provider_config: {
|
|
262
|
+
normalize?: boolean | undefined;
|
|
263
|
+
dtype?: "auto" | "fp32" | "fp16" | "q8" | "int8" | "uint8" | "q4" | "bnb4" | "q4f16" | undefined;
|
|
264
|
+
device?: "cpu" | "gpu" | "webgpu" | "wasm" | "metal" | undefined;
|
|
265
|
+
execution_providers?: string[] | undefined;
|
|
266
|
+
intra_op_num_threads?: number | undefined;
|
|
267
|
+
inter_op_num_threads?: number | undefined;
|
|
268
|
+
use_external_data_format?: boolean | undefined;
|
|
269
|
+
pooling?: "mean" | "last_token" | "cls" | undefined;
|
|
270
|
+
language_style?: string | undefined;
|
|
271
|
+
mrl?: boolean | undefined;
|
|
272
|
+
pipeline: "feature-extraction";
|
|
273
|
+
model_path: string;
|
|
274
|
+
native_dimensions: number;
|
|
275
|
+
} | {
|
|
276
|
+
normalize?: boolean | undefined;
|
|
277
|
+
dtype?: "auto" | "fp32" | "fp16" | "q8" | "int8" | "uint8" | "q4" | "bnb4" | "q4f16" | undefined;
|
|
278
|
+
device?: "cpu" | "gpu" | "webgpu" | "wasm" | "metal" | undefined;
|
|
279
|
+
execution_providers?: string[] | undefined;
|
|
280
|
+
intra_op_num_threads?: number | undefined;
|
|
281
|
+
inter_op_num_threads?: number | undefined;
|
|
282
|
+
use_external_data_format?: boolean | undefined;
|
|
283
|
+
native_dimensions?: number | undefined;
|
|
284
|
+
pooling?: "mean" | "last_token" | "cls" | undefined;
|
|
285
|
+
language_style?: string | undefined;
|
|
286
|
+
mrl?: boolean | undefined;
|
|
287
|
+
pipeline: "fill-mask" | "token-classification" | "text-generation" | "text2text-generation" | "text-classification" | "summarization" | "translation" | "zero-shot-classification" | "question-answering" | "background-removal" | "image-segmentation" | "depth-estimation" | "image-classification" | "image-to-image" | "object-detection" | "image-feature-extraction" | "audio-classification" | "automatic-speech-recognition" | "text-to-speech" | "document-question-answering" | "image-to-text" | "zero-shot-audio-classification" | "zero-shot-image-classification" | "zero-shot-object-detection";
|
|
288
|
+
model_path: string;
|
|
289
|
+
};
|
|
290
|
+
}>;
|
|
232
291
|
readonly TextEmbeddingTask: AiProviderRunFn<{
|
|
233
292
|
model: string | {
|
|
234
293
|
[x: string]: unknown;
|
|
@@ -1296,4 +1355,5 @@ export declare const HFT_TASKS: {
|
|
|
1296
1355
|
* Pass this as the second argument to `new HuggingFaceTransformersProvider(HFT_TASKS, HFT_STREAM_TASKS)`.
|
|
1297
1356
|
*/
|
|
1298
1357
|
export declare const HFT_STREAM_TASKS: Record<string, AiProviderStreamFn<any, any, HfTransformersOnnxModelConfig>>;
|
|
1358
|
+
export declare const HFT_REACTIVE_TASKS: Record<string, AiProviderReactiveRunFn<any, any, HfTransformersOnnxModelConfig>>;
|
|
1299
1359
|
//# sourceMappingURL=HFT_JobRunFns.d.ts.map
|