@workglow/ai-provider 0.0.92 → 0.0.93
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/provider-ollama/Ollama_Worker.browser.d.ts +7 -0
- package/dist/provider-ollama/Ollama_Worker.browser.d.ts.map +1 -0
- package/dist/provider-ollama/index.browser.d.ts +1 -1
- package/dist/provider-ollama/index.browser.d.ts.map +1 -1
- package/dist/provider-ollama/index.browser.js +4 -164
- package/dist/provider-ollama/index.browser.js.map +4 -5
- package/package.json +11 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ollama_Worker.browser.d.ts","sourceRoot":"","sources":["../../src/provider-ollama/Ollama_Worker.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wBAAgB,6BAA6B,SAK5C"}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
export * from "./common/Ollama_Constants";
|
|
7
7
|
export * from "./common/Ollama_JobRunFns.browser";
|
|
8
8
|
export * from "./common/Ollama_ModelSchema";
|
|
9
|
-
export * from "./Ollama_Worker";
|
|
9
|
+
export * from "./Ollama_Worker.browser";
|
|
10
10
|
export * from "./OllamaProvider";
|
|
11
11
|
//# sourceMappingURL=index.browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../src/provider-ollama/index.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../src/provider-ollama/index.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC"}
|
|
@@ -216,169 +216,9 @@ var OllamaModelConfigSchema = {
|
|
|
216
216
|
required: [...ModelConfigSchema.required, ...OllamaModelSchema.required],
|
|
217
217
|
additionalProperties: false
|
|
218
218
|
};
|
|
219
|
-
// src/provider-ollama/Ollama_Worker.ts
|
|
219
|
+
// src/provider-ollama/Ollama_Worker.browser.ts
|
|
220
220
|
import { globalServiceRegistry, parentPort, WORKER_SERVER } from "@workglow/util";
|
|
221
221
|
|
|
222
|
-
// src/provider-ollama/common/Ollama_JobRunFns.ts
|
|
223
|
-
var _sdk2;
|
|
224
|
-
async function loadOllamaSDK2() {
|
|
225
|
-
if (!_sdk2) {
|
|
226
|
-
try {
|
|
227
|
-
_sdk2 = await import("ollama");
|
|
228
|
-
} catch {
|
|
229
|
-
throw new Error("ollama is required for Ollama tasks. Install it with: bun add ollama");
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return _sdk2.Ollama;
|
|
233
|
-
}
|
|
234
|
-
async function getClient2(model) {
|
|
235
|
-
const Ollama = await loadOllamaSDK2();
|
|
236
|
-
const host = model?.provider_config?.base_url || OLLAMA_DEFAULT_BASE_URL;
|
|
237
|
-
return new Ollama({ host });
|
|
238
|
-
}
|
|
239
|
-
function getModelName2(model) {
|
|
240
|
-
const name = model?.provider_config?.model_name;
|
|
241
|
-
if (!name) {
|
|
242
|
-
throw new Error("Missing model name in provider_config.model_name.");
|
|
243
|
-
}
|
|
244
|
-
return name;
|
|
245
|
-
}
|
|
246
|
-
var Ollama_TextGeneration2 = async (input, model, update_progress, signal) => {
|
|
247
|
-
update_progress(0, "Starting Ollama text generation");
|
|
248
|
-
const client = await getClient2(model);
|
|
249
|
-
const modelName = getModelName2(model);
|
|
250
|
-
const response = await client.chat({
|
|
251
|
-
model: modelName,
|
|
252
|
-
messages: [{ role: "user", content: input.prompt }],
|
|
253
|
-
options: {
|
|
254
|
-
temperature: input.temperature,
|
|
255
|
-
top_p: input.topP,
|
|
256
|
-
num_predict: input.maxTokens,
|
|
257
|
-
frequency_penalty: input.frequencyPenalty,
|
|
258
|
-
presence_penalty: input.presencePenalty
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
update_progress(100, "Completed Ollama text generation");
|
|
262
|
-
return { text: response.message.content };
|
|
263
|
-
};
|
|
264
|
-
var Ollama_TextEmbedding2 = async (input, model, update_progress, signal) => {
|
|
265
|
-
update_progress(0, "Starting Ollama text embedding");
|
|
266
|
-
const client = await getClient2(model);
|
|
267
|
-
const modelName = getModelName2(model);
|
|
268
|
-
const texts = Array.isArray(input.text) ? input.text : [input.text];
|
|
269
|
-
const response = await client.embed({
|
|
270
|
-
model: modelName,
|
|
271
|
-
input: texts
|
|
272
|
-
});
|
|
273
|
-
update_progress(100, "Completed Ollama text embedding");
|
|
274
|
-
if (Array.isArray(input.text)) {
|
|
275
|
-
return {
|
|
276
|
-
vector: response.embeddings.map((e) => new Float32Array(e))
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
return { vector: new Float32Array(response.embeddings[0]) };
|
|
280
|
-
};
|
|
281
|
-
var Ollama_TextRewriter2 = async (input, model, update_progress, signal) => {
|
|
282
|
-
update_progress(0, "Starting Ollama text rewriting");
|
|
283
|
-
const client = await getClient2(model);
|
|
284
|
-
const modelName = getModelName2(model);
|
|
285
|
-
const response = await client.chat({
|
|
286
|
-
model: modelName,
|
|
287
|
-
messages: [
|
|
288
|
-
{ role: "system", content: input.prompt },
|
|
289
|
-
{ role: "user", content: input.text }
|
|
290
|
-
]
|
|
291
|
-
});
|
|
292
|
-
update_progress(100, "Completed Ollama text rewriting");
|
|
293
|
-
return { text: response.message.content };
|
|
294
|
-
};
|
|
295
|
-
var Ollama_TextSummary2 = async (input, model, update_progress, signal) => {
|
|
296
|
-
update_progress(0, "Starting Ollama text summarization");
|
|
297
|
-
const client = await getClient2(model);
|
|
298
|
-
const modelName = getModelName2(model);
|
|
299
|
-
const response = await client.chat({
|
|
300
|
-
model: modelName,
|
|
301
|
-
messages: [
|
|
302
|
-
{ role: "system", content: "Summarize the following text concisely." },
|
|
303
|
-
{ role: "user", content: input.text }
|
|
304
|
-
]
|
|
305
|
-
});
|
|
306
|
-
update_progress(100, "Completed Ollama text summarization");
|
|
307
|
-
return { text: response.message.content };
|
|
308
|
-
};
|
|
309
|
-
var Ollama_TextGeneration_Stream2 = async function* (input, model, signal) {
|
|
310
|
-
const client = await getClient2(model);
|
|
311
|
-
const modelName = getModelName2(model);
|
|
312
|
-
const stream = await client.chat({
|
|
313
|
-
model: modelName,
|
|
314
|
-
messages: [{ role: "user", content: input.prompt }],
|
|
315
|
-
options: {
|
|
316
|
-
temperature: input.temperature,
|
|
317
|
-
top_p: input.topP,
|
|
318
|
-
num_predict: input.maxTokens,
|
|
319
|
-
frequency_penalty: input.frequencyPenalty,
|
|
320
|
-
presence_penalty: input.presencePenalty
|
|
321
|
-
},
|
|
322
|
-
stream: true
|
|
323
|
-
});
|
|
324
|
-
for await (const chunk of stream) {
|
|
325
|
-
const delta = chunk.message.content;
|
|
326
|
-
if (delta) {
|
|
327
|
-
yield { type: "text-delta", textDelta: delta };
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
yield { type: "finish", data: {} };
|
|
331
|
-
};
|
|
332
|
-
var Ollama_TextRewriter_Stream2 = async function* (input, model, signal) {
|
|
333
|
-
const client = await getClient2(model);
|
|
334
|
-
const modelName = getModelName2(model);
|
|
335
|
-
const stream = await client.chat({
|
|
336
|
-
model: modelName,
|
|
337
|
-
messages: [
|
|
338
|
-
{ role: "system", content: input.prompt },
|
|
339
|
-
{ role: "user", content: input.text }
|
|
340
|
-
],
|
|
341
|
-
stream: true
|
|
342
|
-
});
|
|
343
|
-
for await (const chunk of stream) {
|
|
344
|
-
const delta = chunk.message.content;
|
|
345
|
-
if (delta) {
|
|
346
|
-
yield { type: "text-delta", textDelta: delta };
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
yield { type: "finish", data: {} };
|
|
350
|
-
};
|
|
351
|
-
var Ollama_TextSummary_Stream2 = async function* (input, model, signal) {
|
|
352
|
-
const client = await getClient2(model);
|
|
353
|
-
const modelName = getModelName2(model);
|
|
354
|
-
const stream = await client.chat({
|
|
355
|
-
model: modelName,
|
|
356
|
-
messages: [
|
|
357
|
-
{ role: "system", content: "Summarize the following text concisely." },
|
|
358
|
-
{ role: "user", content: input.text }
|
|
359
|
-
],
|
|
360
|
-
stream: true
|
|
361
|
-
});
|
|
362
|
-
for await (const chunk of stream) {
|
|
363
|
-
const delta = chunk.message.content;
|
|
364
|
-
if (delta) {
|
|
365
|
-
yield { type: "text-delta", textDelta: delta };
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
yield { type: "finish", data: {} };
|
|
369
|
-
};
|
|
370
|
-
var OLLAMA_TASKS2 = {
|
|
371
|
-
TextGenerationTask: Ollama_TextGeneration2,
|
|
372
|
-
TextEmbeddingTask: Ollama_TextEmbedding2,
|
|
373
|
-
TextRewriterTask: Ollama_TextRewriter2,
|
|
374
|
-
TextSummaryTask: Ollama_TextSummary2
|
|
375
|
-
};
|
|
376
|
-
var OLLAMA_STREAM_TASKS2 = {
|
|
377
|
-
TextGenerationTask: Ollama_TextGeneration_Stream2,
|
|
378
|
-
TextRewriterTask: Ollama_TextRewriter_Stream2,
|
|
379
|
-
TextSummaryTask: Ollama_TextSummary_Stream2
|
|
380
|
-
};
|
|
381
|
-
|
|
382
222
|
// src/provider-ollama/OllamaProvider.ts
|
|
383
223
|
import { AiProvider } from "@workglow/ai";
|
|
384
224
|
class OllamaProvider extends AiProvider {
|
|
@@ -394,10 +234,10 @@ class OllamaProvider extends AiProvider {
|
|
|
394
234
|
}
|
|
395
235
|
}
|
|
396
236
|
|
|
397
|
-
// src/provider-ollama/Ollama_Worker.ts
|
|
237
|
+
// src/provider-ollama/Ollama_Worker.browser.ts
|
|
398
238
|
function OLLAMA_WORKER_JOBRUN_REGISTER() {
|
|
399
239
|
const workerServer = globalServiceRegistry.get(WORKER_SERVER);
|
|
400
|
-
new OllamaProvider(
|
|
240
|
+
new OllamaProvider(OLLAMA_TASKS, OLLAMA_STREAM_TASKS).registerOnWorkerServer(workerServer);
|
|
401
241
|
parentPort.postMessage({ type: "ready" });
|
|
402
242
|
console.log("OLLAMA_WORKER_JOBRUN registered");
|
|
403
243
|
}
|
|
@@ -420,4 +260,4 @@ export {
|
|
|
420
260
|
OLLAMA
|
|
421
261
|
};
|
|
422
262
|
|
|
423
|
-
//# debugId=
|
|
263
|
+
//# debugId=86DAAF17F593994E64756E2164756E21
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/provider-ollama/common/Ollama_Constants.ts", "../src/provider-ollama/common/Ollama_JobRunFns.browser.ts", "../src/provider-ollama/common/Ollama_ModelSchema.ts", "../src/provider-ollama/Ollama_Worker.
|
|
3
|
+
"sources": ["../src/provider-ollama/common/Ollama_Constants.ts", "../src/provider-ollama/common/Ollama_JobRunFns.browser.ts", "../src/provider-ollama/common/Ollama_ModelSchema.ts", "../src/provider-ollama/Ollama_Worker.browser.ts", "../src/provider-ollama/OllamaProvider.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const OLLAMA = \"OLLAMA\";\nexport const OLLAMA_DEFAULT_BASE_URL = \"http://localhost:11434\";\n",
|
|
6
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 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 { OLLAMA_DEFAULT_BASE_URL } from \"./Ollama_Constants\";\nimport type { OllamaModelConfig } from \"./Ollama_ModelSchema\";\n\nlet _sdk: typeof import(\"ollama/browser\") | undefined;\nasync function loadOllamaSDK() {\n if (!_sdk) {\n try {\n _sdk = await import(\"ollama/browser\");\n } catch {\n throw new Error(\"ollama is required for Ollama tasks. Install it with: bun add ollama\");\n }\n }\n return _sdk.Ollama;\n}\n\nasync function getClient(model: OllamaModelConfig | undefined) {\n const Ollama = await loadOllamaSDK();\n const host = model?.provider_config?.base_url || OLLAMA_DEFAULT_BASE_URL;\n return new Ollama({ host });\n}\n\nfunction getModelName(model: OllamaModelConfig | 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 Ollama_TextGeneration: AiProviderRunFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n OllamaModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Ollama text generation\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.chat({\n model: modelName,\n messages: [{ role: \"user\", content: input.prompt }],\n options: {\n temperature: input.temperature,\n top_p: input.topP,\n num_predict: input.maxTokens,\n frequency_penalty: input.frequencyPenalty,\n presence_penalty: input.presencePenalty,\n },\n });\n\n update_progress(100, \"Completed Ollama text generation\");\n return { text: response.message.content };\n};\n\nexport const Ollama_TextEmbedding: AiProviderRunFn<\n TextEmbeddingTaskInput,\n TextEmbeddingTaskOutput,\n OllamaModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Ollama text embedding\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const texts = Array.isArray(input.text) ? input.text : [input.text];\n\n const response = await client.embed({\n model: modelName,\n input: texts,\n });\n\n update_progress(100, \"Completed Ollama text embedding\");\n\n if (Array.isArray(input.text)) {\n return {\n vector: response.embeddings.map((e) => new Float32Array(e)),\n };\n }\n return { vector: new Float32Array(response.embeddings[0]) };\n};\n\nexport const Ollama_TextRewriter: AiProviderRunFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n OllamaModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Ollama text rewriting\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.chat({\n model: modelName,\n messages: [\n { role: \"system\", content: input.prompt },\n { role: \"user\", content: input.text },\n ],\n });\n\n update_progress(100, \"Completed Ollama text rewriting\");\n return { text: response.message.content };\n};\n\nexport const Ollama_TextSummary: AiProviderRunFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n OllamaModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Ollama text summarization\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.chat({\n model: modelName,\n messages: [\n { role: \"system\", content: \"Summarize the following text concisely.\" },\n { role: \"user\", content: input.text },\n ],\n });\n\n update_progress(100, \"Completed Ollama text summarization\");\n return { text: response.message.content };\n};\n\n// ========================================================================\n// Streaming implementations (append mode)\n// ========================================================================\n\nexport const Ollama_TextGeneration_Stream: AiProviderStreamFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n OllamaModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextGenerationTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = await client.chat({\n model: modelName,\n messages: [{ role: \"user\", content: input.prompt }],\n options: {\n temperature: input.temperature,\n top_p: input.topP,\n num_predict: input.maxTokens,\n frequency_penalty: input.frequencyPenalty,\n presence_penalty: input.presencePenalty,\n },\n stream: true,\n });\n\n for await (const chunk of stream) {\n const delta = chunk.message.content;\n if (delta) {\n yield { type: \"text-delta\", textDelta: delta };\n }\n }\n yield { type: \"finish\", data: {} as TextGenerationTaskOutput };\n};\n\nexport const Ollama_TextRewriter_Stream: AiProviderStreamFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n OllamaModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextRewriterTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = await client.chat({\n model: modelName,\n messages: [\n { role: \"system\", content: input.prompt },\n { role: \"user\", content: input.text },\n ],\n stream: true,\n });\n\n for await (const chunk of stream) {\n const delta = chunk.message.content;\n if (delta) {\n yield { type: \"text-delta\", textDelta: delta };\n }\n }\n yield { type: \"finish\", data: {} as TextRewriterTaskOutput };\n};\n\nexport const Ollama_TextSummary_Stream: AiProviderStreamFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n OllamaModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextSummaryTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = await client.chat({\n model: modelName,\n messages: [\n { role: \"system\", content: \"Summarize the following text concisely.\" },\n { role: \"user\", content: input.text },\n ],\n stream: true,\n });\n\n for await (const chunk of stream) {\n const delta = chunk.message.content;\n if (delta) {\n yield { type: \"text-delta\", textDelta: delta };\n }\n }\n yield { type: \"finish\", data: {} as TextSummaryTaskOutput };\n};\n\n// ========================================================================\n// Task registries\n// ========================================================================\n\nexport const OLLAMA_TASKS: Record<string, AiProviderRunFn<any, any, OllamaModelConfig>> = {\n TextGenerationTask: Ollama_TextGeneration,\n TextEmbeddingTask: Ollama_TextEmbedding,\n TextRewriterTask: Ollama_TextRewriter,\n TextSummaryTask: Ollama_TextSummary,\n};\n\nexport const OLLAMA_STREAM_TASKS: Record<\n string,\n AiProviderStreamFn<any, any, OllamaModelConfig>\n> = {\n TextGenerationTask: Ollama_TextGeneration_Stream,\n TextRewriterTask: Ollama_TextRewriter_Stream,\n TextSummaryTask: Ollama_TextSummary_Stream,\n};\n",
|
|
7
7
|
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ModelConfigSchema, ModelRecordSchema } from \"@workglow/ai\";\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\nimport { OLLAMA, OLLAMA_DEFAULT_BASE_URL } from \"./Ollama_Constants\";\n\nexport const OllamaModelSchema = {\n type: \"object\",\n properties: {\n provider: {\n const: OLLAMA,\n description: \"Discriminator: Ollama local LLM server.\",\n },\n provider_config: {\n type: \"object\",\n description: \"Ollama-specific configuration.\",\n properties: {\n model_name: {\n type: \"string\",\n description: \"The Ollama model identifier (e.g., 'llama3.2', 'nomic-embed-text').\",\n },\n base_url: {\n type: \"string\",\n description: \"Base URL for the Ollama server.\",\n default: OLLAMA_DEFAULT_BASE_URL,\n },\n },\n required: [\"model_name\"],\n additionalProperties: false,\n },\n },\n required: [\"provider\", \"provider_config\"],\n additionalProperties: true,\n} as const satisfies DataPortSchemaObject;\n\nexport const OllamaModelRecordSchema = {\n type: \"object\",\n properties: {\n ...ModelRecordSchema.properties,\n ...OllamaModelSchema.properties,\n },\n required: [...ModelRecordSchema.required, ...OllamaModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type OllamaModelRecord = FromSchema<typeof OllamaModelRecordSchema>;\n\nexport const OllamaModelConfigSchema = {\n type: \"object\",\n properties: {\n ...ModelConfigSchema.properties,\n ...OllamaModelSchema.properties,\n },\n required: [...ModelConfigSchema.required, ...OllamaModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type OllamaModelConfig = FromSchema<typeof OllamaModelConfigSchema>;\n",
|
|
8
|
-
"/**\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 { OLLAMA_STREAM_TASKS, OLLAMA_TASKS } from \"./common/Ollama_JobRunFns\";\nimport { OllamaProvider } from \"./OllamaProvider\";\n\nexport function OLLAMA_WORKER_JOBRUN_REGISTER() {\n const workerServer = globalServiceRegistry.get(WORKER_SERVER);\n new OllamaProvider(OLLAMA_TASKS, OLLAMA_STREAM_TASKS).registerOnWorkerServer(workerServer);\n parentPort.postMessage({ type: \"ready\" });\n console.log(\"OLLAMA_WORKER_JOBRUN registered\");\n}\n",
|
|
9
|
-
"/**\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 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 { OLLAMA_DEFAULT_BASE_URL } from \"./Ollama_Constants\";\nimport type { OllamaModelConfig } from \"./Ollama_ModelSchema\";\n\nlet _sdk: typeof import(\"ollama\") | undefined;\nasync function loadOllamaSDK() {\n if (!_sdk) {\n try {\n _sdk = await import(\"ollama\");\n } catch {\n throw new Error(\"ollama is required for Ollama tasks. Install it with: bun add ollama\");\n }\n }\n return _sdk.Ollama;\n}\n\nasync function getClient(model: OllamaModelConfig | undefined) {\n const Ollama = await loadOllamaSDK();\n const host = model?.provider_config?.base_url || OLLAMA_DEFAULT_BASE_URL;\n return new Ollama({ host });\n}\n\nfunction getModelName(model: OllamaModelConfig | 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 Ollama_TextGeneration: AiProviderRunFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n OllamaModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Ollama text generation\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.chat({\n model: modelName,\n messages: [{ role: \"user\", content: input.prompt }],\n options: {\n temperature: input.temperature,\n top_p: input.topP,\n num_predict: input.maxTokens,\n frequency_penalty: input.frequencyPenalty,\n presence_penalty: input.presencePenalty,\n },\n });\n\n update_progress(100, \"Completed Ollama text generation\");\n return { text: response.message.content };\n};\n\nexport const Ollama_TextEmbedding: AiProviderRunFn<\n TextEmbeddingTaskInput,\n TextEmbeddingTaskOutput,\n OllamaModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Ollama text embedding\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const texts = Array.isArray(input.text) ? input.text : [input.text];\n\n const response = await client.embed({\n model: modelName,\n input: texts,\n });\n\n update_progress(100, \"Completed Ollama text embedding\");\n\n if (Array.isArray(input.text)) {\n return {\n vector: response.embeddings.map((e) => new Float32Array(e)),\n };\n }\n return { vector: new Float32Array(response.embeddings[0]) };\n};\n\nexport const Ollama_TextRewriter: AiProviderRunFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n OllamaModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Ollama text rewriting\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.chat({\n model: modelName,\n messages: [\n { role: \"system\", content: input.prompt },\n { role: \"user\", content: input.text },\n ],\n });\n\n update_progress(100, \"Completed Ollama text rewriting\");\n return { text: response.message.content };\n};\n\nexport const Ollama_TextSummary: AiProviderRunFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n OllamaModelConfig\n> = async (input, model, update_progress, signal) => {\n update_progress(0, \"Starting Ollama text summarization\");\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const response = await client.chat({\n model: modelName,\n messages: [\n { role: \"system\", content: \"Summarize the following text concisely.\" },\n { role: \"user\", content: input.text },\n ],\n });\n\n update_progress(100, \"Completed Ollama text summarization\");\n return { text: response.message.content };\n};\n\n// ========================================================================\n// Streaming implementations (append mode)\n// ========================================================================\n\nexport const Ollama_TextGeneration_Stream: AiProviderStreamFn<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n OllamaModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextGenerationTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = await client.chat({\n model: modelName,\n messages: [{ role: \"user\", content: input.prompt }],\n options: {\n temperature: input.temperature,\n top_p: input.topP,\n num_predict: input.maxTokens,\n frequency_penalty: input.frequencyPenalty,\n presence_penalty: input.presencePenalty,\n },\n stream: true,\n });\n\n for await (const chunk of stream) {\n const delta = chunk.message.content;\n if (delta) {\n yield { type: \"text-delta\", textDelta: delta };\n }\n }\n yield { type: \"finish\", data: {} as TextGenerationTaskOutput };\n};\n\nexport const Ollama_TextRewriter_Stream: AiProviderStreamFn<\n TextRewriterTaskInput,\n TextRewriterTaskOutput,\n OllamaModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextRewriterTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = await client.chat({\n model: modelName,\n messages: [\n { role: \"system\", content: input.prompt },\n { role: \"user\", content: input.text },\n ],\n stream: true,\n });\n\n for await (const chunk of stream) {\n const delta = chunk.message.content;\n if (delta) {\n yield { type: \"text-delta\", textDelta: delta };\n }\n }\n yield { type: \"finish\", data: {} as TextRewriterTaskOutput };\n};\n\nexport const Ollama_TextSummary_Stream: AiProviderStreamFn<\n TextSummaryTaskInput,\n TextSummaryTaskOutput,\n OllamaModelConfig\n> = async function* (input, model, signal): AsyncIterable<StreamEvent<TextSummaryTaskOutput>> {\n const client = await getClient(model);\n const modelName = getModelName(model);\n\n const stream = await client.chat({\n model: modelName,\n messages: [\n { role: \"system\", content: \"Summarize the following text concisely.\" },\n { role: \"user\", content: input.text },\n ],\n stream: true,\n });\n\n for await (const chunk of stream) {\n const delta = chunk.message.content;\n if (delta) {\n yield { type: \"text-delta\", textDelta: delta };\n }\n }\n yield { type: \"finish\", data: {} as TextSummaryTaskOutput };\n};\n\n// ========================================================================\n// Task registries\n// ========================================================================\n\nexport const OLLAMA_TASKS: Record<string, AiProviderRunFn<any, any, OllamaModelConfig>> = {\n TextGenerationTask: Ollama_TextGeneration,\n TextEmbeddingTask: Ollama_TextEmbedding,\n TextRewriterTask: Ollama_TextRewriter,\n TextSummaryTask: Ollama_TextSummary,\n};\n\nexport const OLLAMA_STREAM_TASKS: Record<\n string,\n AiProviderStreamFn<any, any, OllamaModelConfig>\n> = {\n TextGenerationTask: Ollama_TextGeneration_Stream,\n TextRewriterTask: Ollama_TextRewriter_Stream,\n TextSummaryTask: Ollama_TextSummary_Stream,\n};\n",
|
|
8
|
+
"/**\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 { OLLAMA_STREAM_TASKS, OLLAMA_TASKS } from \"./common/Ollama_JobRunFns.browser\";\nimport { OllamaProvider } from \"./OllamaProvider\";\n\nexport function OLLAMA_WORKER_JOBRUN_REGISTER() {\n const workerServer = globalServiceRegistry.get(WORKER_SERVER);\n new OllamaProvider(OLLAMA_TASKS, OLLAMA_STREAM_TASKS).registerOnWorkerServer(workerServer);\n parentPort.postMessage({ type: \"ready\" });\n console.log(\"OLLAMA_WORKER_JOBRUN registered\");\n}\n",
|
|
10
9
|
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { AiProvider, type AiProviderRunFn, type AiProviderStreamFn } from \"@workglow/ai\";\nimport { OLLAMA } from \"./common/Ollama_Constants\";\nimport type { OllamaModelConfig } from \"./common/Ollama_ModelSchema\";\n\n/**\n * AI provider for Ollama local LLM server.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the Ollama API using the `ollama` SDK.\n *\n * Ollama runs locally and does not require an API key -- only a `base_url`\n * (defaults to `http://localhost:11434`).\n *\n * Task run functions are injected via the constructor so that the `ollama` SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new OllamaProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_ollama.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { OLLAMA_TASKS } from \"@workglow/ai-provider/ollama\";\n * await new OllamaProvider(OLLAMA_TASKS).register({ mode: \"inline\" });\n * ```\n */\nexport class OllamaProvider extends AiProvider<OllamaModelConfig> {\n readonly name = OLLAMA;\n\n readonly taskTypes = [\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, OllamaModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, OllamaModelConfig>>\n ) {\n super(tasks, streamTasks);\n }\n}\n"
|
|
11
10
|
],
|
|
12
|
-
"mappings": ";;;;;;;;;AAMO,IAAM,SAAS;AACf,IAAM,0BAA0B;;ACevC,IAAI;AACJ,eAAe,aAAa,GAAG;AAAA,EAC7B,IAAI,CAAC,MAAM;AAAA,IACT,IAAI;AAAA,MACF,OAAO,MAAa;AAAA,MACpB,MAAM;AAAA,MACN,MAAM,IAAI,MAAM,sEAAsE;AAAA;AAAA,EAE1F;AAAA,EACA,OAAO,KAAK;AAAA;AAGd,eAAe,SAAS,CAAC,OAAsC;AAAA,EAC7D,MAAM,SAAS,MAAM,cAAc;AAAA,EACnC,MAAM,OAAO,OAAO,iBAAiB,YAAY;AAAA,EACjD,OAAO,IAAI,OAAO,EAAE,KAAK,CAAC;AAAA;AAG5B,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,GA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|
|
15
14
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workglow/ai-provider",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.93",
|
|
5
5
|
"description": "AI provider integrations for Workglow, supporting OpenAI, Hugging Face Transformers, MediaPipe, and GGML models.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"watch": "concurrently -c 'auto' 'bun:watch-*'",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@workglow/ai": "0.0.
|
|
66
|
-
"@workglow/job-queue": "0.0.
|
|
67
|
-
"@workglow/storage": "0.0.
|
|
68
|
-
"@workglow/task-graph": "0.0.
|
|
69
|
-
"@workglow/util": "0.0.
|
|
65
|
+
"@workglow/ai": "0.0.93",
|
|
66
|
+
"@workglow/job-queue": "0.0.93",
|
|
67
|
+
"@workglow/storage": "0.0.93",
|
|
68
|
+
"@workglow/task-graph": "0.0.93",
|
|
69
|
+
"@workglow/util": "0.0.93",
|
|
70
70
|
"@sroussey/transformers": "3.8.2",
|
|
71
71
|
"@mediapipe/tasks-text": "^0.10.32",
|
|
72
72
|
"@mediapipe/tasks-vision": "^0.10.32",
|
|
@@ -129,11 +129,11 @@
|
|
|
129
129
|
"@mediapipe/tasks-text": "^0.10.32",
|
|
130
130
|
"@mediapipe/tasks-vision": "^0.10.32",
|
|
131
131
|
"@sroussey/transformers": "3.8.2",
|
|
132
|
-
"@workglow/ai": "0.0.
|
|
133
|
-
"@workglow/job-queue": "0.0.
|
|
134
|
-
"@workglow/storage": "0.0.
|
|
135
|
-
"@workglow/task-graph": "0.0.
|
|
136
|
-
"@workglow/util": "0.0.
|
|
132
|
+
"@workglow/ai": "0.0.93",
|
|
133
|
+
"@workglow/job-queue": "0.0.93",
|
|
134
|
+
"@workglow/storage": "0.0.93",
|
|
135
|
+
"@workglow/task-graph": "0.0.93",
|
|
136
|
+
"@workglow/util": "0.0.93",
|
|
137
137
|
"ollama": "^0.6.3",
|
|
138
138
|
"openai": "^6.22.0"
|
|
139
139
|
}
|