@workglow/ai-provider 0.0.89 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -45
- package/dist/anthropic/AnthropicProvider.d.ts +39 -0
- package/dist/anthropic/AnthropicProvider.d.ts.map +1 -0
- package/dist/anthropic/Anthropic_Worker.d.ts +7 -0
- package/dist/anthropic/Anthropic_Worker.d.ts.map +1 -0
- package/dist/anthropic/common/Anthropic_Constants.d.ts +7 -0
- package/dist/anthropic/common/Anthropic_Constants.d.ts.map +1 -0
- package/dist/anthropic/common/Anthropic_JobRunFns.d.ts +16 -0
- package/dist/anthropic/common/Anthropic_JobRunFns.d.ts.map +1 -0
- package/dist/anthropic/common/Anthropic_ModelSchema.d.ts +167 -0
- package/dist/anthropic/common/Anthropic_ModelSchema.d.ts.map +1 -0
- package/dist/anthropic/index.d.ts +11 -0
- package/dist/anthropic/index.d.ts.map +1 -0
- package/dist/anthropic/index.js +257 -0
- package/dist/anthropic/index.js.map +14 -0
- package/dist/google-gemini/Gemini_Worker.d.ts +7 -0
- package/dist/google-gemini/Gemini_Worker.d.ts.map +1 -0
- package/dist/google-gemini/GoogleGeminiProvider.d.ts +36 -0
- package/dist/google-gemini/GoogleGeminiProvider.d.ts.map +1 -0
- package/dist/google-gemini/common/Gemini_Constants.d.ts +7 -0
- package/dist/google-gemini/common/Gemini_Constants.d.ts.map +1 -0
- package/dist/google-gemini/common/Gemini_JobRunFns.d.ts +17 -0
- package/dist/google-gemini/common/Gemini_JobRunFns.d.ts.map +1 -0
- package/dist/google-gemini/common/Gemini_ModelSchema.d.ts +164 -0
- package/dist/google-gemini/common/Gemini_ModelSchema.d.ts.map +1 -0
- package/dist/google-gemini/index.d.ts +11 -0
- package/dist/google-gemini/index.d.ts.map +1 -0
- package/dist/google-gemini/index.js +300 -0
- package/dist/google-gemini/index.js.map +14 -0
- package/dist/hf-transformers/HFT_Worker.d.ts +7 -0
- package/dist/hf-transformers/HFT_Worker.d.ts.map +1 -0
- package/dist/hf-transformers/HuggingFaceTransformersProvider.d.ts +41 -0
- package/dist/hf-transformers/HuggingFaceTransformersProvider.d.ts.map +1 -0
- package/dist/hf-transformers/common/HFT_JobRunFns.d.ts +1218 -1
- package/dist/hf-transformers/common/HFT_JobRunFns.d.ts.map +1 -1
- package/dist/hf-transformers/index.d.ts +2 -3
- package/dist/hf-transformers/index.d.ts.map +1 -1
- package/dist/hf-transformers/index.js +1130 -0
- package/dist/hf-transformers/index.js.map +15 -0
- package/dist/index.d.ts +23 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +729 -865
- package/dist/index.js.map +20 -12
- package/dist/provider-ollama/OllamaProvider.d.ts +39 -0
- package/dist/provider-ollama/OllamaProvider.d.ts.map +1 -0
- package/dist/provider-ollama/Ollama_Worker.d.ts +7 -0
- package/dist/provider-ollama/Ollama_Worker.d.ts.map +1 -0
- package/dist/provider-ollama/common/Ollama_Constants.d.ts +8 -0
- package/dist/provider-ollama/common/Ollama_Constants.d.ts.map +1 -0
- package/dist/provider-ollama/common/Ollama_JobRunFns.d.ts +17 -0
- package/dist/provider-ollama/common/Ollama_JobRunFns.d.ts.map +1 -0
- package/dist/provider-ollama/common/Ollama_ModelSchema.d.ts +137 -0
- package/dist/provider-ollama/common/Ollama_ModelSchema.d.ts.map +1 -0
- package/dist/provider-ollama/index.d.ts +11 -0
- package/dist/provider-ollama/index.d.ts.map +1 -0
- package/dist/provider-ollama/index.js +274 -0
- package/dist/provider-ollama/index.js.map +14 -0
- package/dist/provider-openai/OpenAI_Worker.d.ts +7 -0
- package/dist/provider-openai/OpenAI_Worker.d.ts.map +1 -0
- package/dist/provider-openai/OpenAiProvider.d.ts +40 -0
- package/dist/provider-openai/OpenAiProvider.d.ts.map +1 -0
- package/dist/provider-openai/common/OpenAI_Constants.d.ts +7 -0
- package/dist/provider-openai/common/OpenAI_Constants.d.ts.map +1 -0
- package/dist/provider-openai/common/OpenAI_JobRunFns.d.ts +17 -0
- package/dist/provider-openai/common/OpenAI_JobRunFns.d.ts.map +1 -0
- package/dist/provider-openai/common/OpenAI_ModelSchema.d.ts +161 -0
- package/dist/provider-openai/common/OpenAI_ModelSchema.d.ts.map +1 -0
- package/dist/provider-openai/index.d.ts +11 -0
- package/dist/provider-openai/index.d.ts.map +1 -0
- package/dist/provider-openai/index.js +283 -0
- package/dist/provider-openai/index.js.map +14 -0
- package/dist/tf-mediapipe/TFMP_Worker.d.ts +7 -0
- package/dist/tf-mediapipe/TFMP_Worker.d.ts.map +1 -0
- package/dist/tf-mediapipe/TensorFlowMediaPipeProvider.d.ts +39 -0
- package/dist/tf-mediapipe/TensorFlowMediaPipeProvider.d.ts.map +1 -0
- package/dist/tf-mediapipe/common/TFMP_JobRunFns.d.ts +842 -0
- package/dist/tf-mediapipe/common/TFMP_JobRunFns.d.ts.map +1 -1
- package/dist/tf-mediapipe/index.d.ts +2 -3
- package/dist/tf-mediapipe/index.d.ts.map +1 -1
- package/dist/tf-mediapipe/index.js +674 -0
- package/dist/tf-mediapipe/index.js.map +14 -0
- package/package.json +87 -22
- package/dist/hf-transformers/registry/HFT_Client_RegisterJobFns.d.ts +0 -17
- package/dist/hf-transformers/registry/HFT_Client_RegisterJobFns.d.ts.map +0 -1
- package/dist/hf-transformers/registry/HFT_Inline_RegisterJobFns.d.ts +0 -16
- package/dist/hf-transformers/registry/HFT_Inline_RegisterJobFns.d.ts.map +0 -1
- package/dist/hf-transformers/registry/HFT_Worker_RegisterJobFns.d.ts +0 -8
- package/dist/hf-transformers/registry/HFT_Worker_RegisterJobFns.d.ts.map +0 -1
- package/dist/openai/provider/OpenAI_TaskRun.d.ts +0 -2
- package/dist/openai/provider/OpenAI_TaskRun.d.ts.map +0 -1
- package/dist/tf-mediapipe/registry/TFMP_Client_RegisterJobFns.d.ts +0 -17
- package/dist/tf-mediapipe/registry/TFMP_Client_RegisterJobFns.d.ts.map +0 -1
- package/dist/tf-mediapipe/registry/TFMP_Inline_RegisterJobFns.d.ts +0 -16
- package/dist/tf-mediapipe/registry/TFMP_Inline_RegisterJobFns.d.ts.map +0 -1
- package/dist/tf-mediapipe/registry/TFMP_Worker_RegisterJobFns.d.ts +0 -8
- package/dist/tf-mediapipe/registry/TFMP_Worker_RegisterJobFns.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -41,11 +41,16 @@ npm install @mediapipe/tasks-text @mediapipe/tasks-vision @mediapipe/tasks-audio
|
|
|
41
41
|
### 1. Basic Setup
|
|
42
42
|
|
|
43
43
|
```typescript
|
|
44
|
-
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
import {
|
|
45
|
+
HFT_TASKS,
|
|
46
|
+
HuggingFaceTransformersProvider,
|
|
47
|
+
TFMP_TASKS,
|
|
48
|
+
TensorFlowMediaPipeProvider,
|
|
49
|
+
} from "@workglow/ai-provider";
|
|
50
|
+
|
|
51
|
+
// Register AI providers (inline mode requires task maps via constructor)
|
|
52
|
+
await new HuggingFaceTransformersProvider(HFT_TASKS).register({ mode: "inline" });
|
|
53
|
+
await new TensorFlowMediaPipeProvider(TFMP_TASKS).register({ mode: "inline" });
|
|
49
54
|
```
|
|
50
55
|
|
|
51
56
|
### 2. Using AI Tasks in Workflows
|
|
@@ -234,17 +239,22 @@ For better performance, especially in browser environments, run AI inference in
|
|
|
234
239
|
#### Main Thread Setup
|
|
235
240
|
|
|
236
241
|
```typescript
|
|
237
|
-
import {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
)
|
|
242
|
+
import {
|
|
243
|
+
HuggingFaceTransformersProvider,
|
|
244
|
+
TensorFlowMediaPipeProvider,
|
|
245
|
+
} from "@workglow/ai-provider";
|
|
246
|
+
|
|
247
|
+
// Register HuggingFace Transformers with worker (no task map needed on main thread)
|
|
248
|
+
await new HuggingFaceTransformersProvider().register({
|
|
249
|
+
mode: "worker",
|
|
250
|
+
worker: new Worker(new URL("./hft-worker.ts", import.meta.url), { type: "module" }),
|
|
251
|
+
});
|
|
243
252
|
|
|
244
|
-
// Register MediaPipe with worker
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
)
|
|
253
|
+
// Register MediaPipe with worker (no task map needed on main thread)
|
|
254
|
+
await new TensorFlowMediaPipeProvider().register({
|
|
255
|
+
mode: "worker",
|
|
256
|
+
worker: new Worker(new URL("./tfmp-worker.ts", import.meta.url), { type: "module" }),
|
|
257
|
+
});
|
|
248
258
|
```
|
|
249
259
|
|
|
250
260
|
#### Worker Setup Files
|
|
@@ -252,19 +262,19 @@ register_TFMP_ClientJobFns(
|
|
|
252
262
|
**hft-worker.ts:**
|
|
253
263
|
|
|
254
264
|
```typescript
|
|
255
|
-
import {
|
|
265
|
+
import { HFT_WORKER_JOBRUN_REGISTER } from "@workglow/ai-provider";
|
|
256
266
|
|
|
257
267
|
// Register HuggingFace Transformers worker functions
|
|
258
|
-
|
|
268
|
+
HFT_WORKER_JOBRUN_REGISTER();
|
|
259
269
|
```
|
|
260
270
|
|
|
261
271
|
**tfmp-worker.ts:**
|
|
262
272
|
|
|
263
273
|
```typescript
|
|
264
|
-
import {
|
|
274
|
+
import { TFMP_WORKER_JOBRUN_REGISTER } from "@workglow/ai-provider";
|
|
265
275
|
|
|
266
276
|
// Register MediaPipe worker functions
|
|
267
|
-
|
|
277
|
+
TFMP_WORKER_JOBRUN_REGISTER();
|
|
268
278
|
```
|
|
269
279
|
|
|
270
280
|
### Model Management
|
|
@@ -286,30 +296,20 @@ await downloadTask.execute();
|
|
|
286
296
|
### Custom Job Queue Configuration
|
|
287
297
|
|
|
288
298
|
```typescript
|
|
289
|
-
import {
|
|
290
|
-
JobQueueClient,
|
|
291
|
-
JobQueueServer,
|
|
292
|
-
ConcurrencyLimiter,
|
|
293
|
-
DelayLimiter,
|
|
294
|
-
} from "@workglow/job-queue";
|
|
295
|
-
import { InMemoryQueueStorage } from "@workglow/storage";
|
|
296
|
-
import { register_HFT_InlineJobFns, HF_TRANSFORMERS_ONNX } from "@workglow/ai-provider";
|
|
297
|
-
|
|
298
|
-
// Configure queue with custom limits
|
|
299
|
-
const customQueue = new JobQueueServer(HF_TRANSFORMERS_ONNX, AiJob, {
|
|
300
|
-
storage: new InMemoryQueueStorage(HF_TRANSFORMERS_ONNX),
|
|
301
|
-
queueName: HF_TRANSFORMERS_ONNX,
|
|
302
|
-
limiter: new ConcurrencyLimiter(2, 1000), // 2 concurrent jobs, 1000ms timeout
|
|
303
|
-
});
|
|
299
|
+
import { HFT_TASKS, HuggingFaceTransformersProvider } from "@workglow/ai-provider";
|
|
304
300
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
301
|
+
// Register with custom queue concurrency (provider creates queue with concurrency: 2)
|
|
302
|
+
await new HuggingFaceTransformersProvider(HFT_TASKS).register({
|
|
303
|
+
mode: "inline",
|
|
304
|
+
queue: { concurrency: 2 },
|
|
308
305
|
});
|
|
309
306
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
307
|
+
// Or skip auto-creation and use your own queue:
|
|
308
|
+
await new HuggingFaceTransformersProvider(HFT_TASKS).register({
|
|
309
|
+
mode: "inline",
|
|
310
|
+
queue: { autoCreate: false },
|
|
311
|
+
});
|
|
312
|
+
// Then register your custom queue with getTaskQueueRegistry().registerQueue(...)
|
|
313
313
|
```
|
|
314
314
|
|
|
315
315
|
### Error Handling
|
|
@@ -352,13 +352,13 @@ await task.execute();
|
|
|
352
352
|
## Complete Working Example
|
|
353
353
|
|
|
354
354
|
```typescript
|
|
355
|
-
import {
|
|
356
|
-
import { TextGenerationTask, TextEmbeddingTask
|
|
357
|
-
import { Workflow
|
|
355
|
+
import { HFT_TASKS, HuggingFaceTransformersProvider } from "@workglow/ai-provider";
|
|
356
|
+
import { TextGenerationTask, TextEmbeddingTask } from "@workglow/ai";
|
|
357
|
+
import { Workflow } from "@workglow/task-graph";
|
|
358
358
|
|
|
359
359
|
async function main() {
|
|
360
|
-
// 1. Register the AI provider
|
|
361
|
-
await
|
|
360
|
+
// 1. Register the AI provider (inline mode requires HFT_TASKS via constructor)
|
|
361
|
+
await new HuggingFaceTransformersProvider(HFT_TASKS).register({ mode: "inline" });
|
|
362
362
|
|
|
363
363
|
// 2. Create and run workflow
|
|
364
364
|
const workflow = new Workflow();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { AiProvider, type AiProviderRunFn, type AiProviderStreamFn } from "@workglow/ai";
|
|
7
|
+
import type { AnthropicModelConfig } from "./common/Anthropic_ModelSchema";
|
|
8
|
+
/**
|
|
9
|
+
* AI provider for Anthropic cloud models.
|
|
10
|
+
*
|
|
11
|
+
* Supports text generation, text rewriting, and text summarization via the
|
|
12
|
+
* Anthropic Messages API using the `@anthropic-ai/sdk` SDK.
|
|
13
|
+
*
|
|
14
|
+
* Note: Anthropic does not offer an embeddings API, so TextEmbeddingTask
|
|
15
|
+
* is not supported by this provider.
|
|
16
|
+
*
|
|
17
|
+
* Task run functions are injected via the constructor so that the SDK
|
|
18
|
+
* is only imported where actually needed (inline mode, worker server), not on
|
|
19
|
+
* the main thread in worker mode.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Worker mode (main thread) -- lightweight, no SDK import:
|
|
24
|
+
* await new AnthropicProvider().register({
|
|
25
|
+
* mode: "worker",
|
|
26
|
+
* worker: new Worker(new URL("./worker_anthropic.ts", import.meta.url), { type: "module" }),
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* // Inline mode -- caller provides the tasks:
|
|
30
|
+
* import { ANTHROPIC_TASKS } from "@workglow/ai-provider/anthropic";
|
|
31
|
+
* await new AnthropicProvider(ANTHROPIC_TASKS).register({ mode: "inline" });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class AnthropicProvider extends AiProvider<AnthropicModelConfig> {
|
|
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>>);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=AnthropicProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnthropicProvider.d.ts","sourceRoot":"","sources":["../../src/anthropic/AnthropicProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEzF,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,yEAA0E;gBAG1F,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;CAInF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Anthropic_Worker.d.ts","sourceRoot":"","sources":["../../src/anthropic/Anthropic_Worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,wBAAgB,gCAAgC,SAO/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Anthropic_Constants.d.ts","sourceRoot":"","sources":["../../../src/anthropic/common/Anthropic_Constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,SAAS,cAAc,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AiProviderRunFn, AiProviderStreamFn, TextGenerationTaskInput, TextGenerationTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
|
|
7
|
+
import type { AnthropicModelConfig } from "./Anthropic_ModelSchema";
|
|
8
|
+
export declare const Anthropic_TextGeneration: AiProviderRunFn<TextGenerationTaskInput, TextGenerationTaskOutput, AnthropicModelConfig>;
|
|
9
|
+
export declare const Anthropic_TextRewriter: AiProviderRunFn<TextRewriterTaskInput, TextRewriterTaskOutput, AnthropicModelConfig>;
|
|
10
|
+
export declare const Anthropic_TextSummary: AiProviderRunFn<TextSummaryTaskInput, TextSummaryTaskOutput, AnthropicModelConfig>;
|
|
11
|
+
export declare const Anthropic_TextGeneration_Stream: AiProviderStreamFn<TextGenerationTaskInput, TextGenerationTaskOutput, AnthropicModelConfig>;
|
|
12
|
+
export declare const Anthropic_TextRewriter_Stream: AiProviderStreamFn<TextRewriterTaskInput, TextRewriterTaskOutput, AnthropicModelConfig>;
|
|
13
|
+
export declare const Anthropic_TextSummary_Stream: AiProviderStreamFn<TextSummaryTaskInput, TextSummaryTaskOutput, AnthropicModelConfig>;
|
|
14
|
+
export declare const ANTHROPIC_TASKS: Record<string, AiProviderRunFn<any, any, AnthropicModelConfig>>;
|
|
15
|
+
export declare const ANTHROPIC_STREAM_TASKS: Record<string, AiProviderStreamFn<any, any, AnthropicModelConfig>>;
|
|
16
|
+
//# sourceMappingURL=Anthropic_JobRunFns.d.ts.map
|
|
@@ -0,0 +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,EACrB,oBAAoB,CAoBrB,CAAC;AAMF,eAAO,MAAM,+BAA+B,EAAE,kBAAkB,CAC9D,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,CAsBrB,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAC5D,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,CAqBrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,kBAAkB,CAC3D,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,CAqBrB,CAAC;AAMF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAI3F,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,MAAM,EACN,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,CAAC,CAKnD,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { FromSchema } from "@workglow/util";
|
|
7
|
+
export declare const AnthropicModelSchema: {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: {
|
|
10
|
+
readonly provider: {
|
|
11
|
+
readonly const: "ANTHROPIC";
|
|
12
|
+
readonly description: "Discriminator: Anthropic cloud provider.";
|
|
13
|
+
};
|
|
14
|
+
readonly provider_config: {
|
|
15
|
+
readonly type: "object";
|
|
16
|
+
readonly description: "Anthropic-specific configuration.";
|
|
17
|
+
readonly properties: {
|
|
18
|
+
readonly model_name: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "The Anthropic model identifier (e.g., 'claude-sonnet-4-20250514', 'claude-3-5-haiku-20241022').";
|
|
21
|
+
};
|
|
22
|
+
readonly api_key: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "Anthropic API key. Falls back to ANTHROPIC_API_KEY environment variable if not set.";
|
|
25
|
+
readonly "x-ui-hidden": true;
|
|
26
|
+
};
|
|
27
|
+
readonly base_url: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly description: "Base URL for the Anthropic API (optional).";
|
|
30
|
+
};
|
|
31
|
+
readonly max_tokens: {
|
|
32
|
+
readonly type: "integer";
|
|
33
|
+
readonly description: "Default max tokens for responses. Anthropic requires this parameter.";
|
|
34
|
+
readonly default: 1024;
|
|
35
|
+
readonly minimum: 1;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly required: readonly ["model_name"];
|
|
39
|
+
readonly additionalProperties: false;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly required: readonly ["provider", "provider_config"];
|
|
43
|
+
readonly additionalProperties: true;
|
|
44
|
+
};
|
|
45
|
+
export declare const AnthropicModelRecordSchema: {
|
|
46
|
+
readonly type: "object";
|
|
47
|
+
readonly properties: {
|
|
48
|
+
readonly provider: {
|
|
49
|
+
readonly const: "ANTHROPIC";
|
|
50
|
+
readonly description: "Discriminator: Anthropic cloud provider.";
|
|
51
|
+
};
|
|
52
|
+
readonly provider_config: {
|
|
53
|
+
readonly type: "object";
|
|
54
|
+
readonly description: "Anthropic-specific configuration.";
|
|
55
|
+
readonly properties: {
|
|
56
|
+
readonly model_name: {
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
readonly description: "The Anthropic model identifier (e.g., 'claude-sonnet-4-20250514', 'claude-3-5-haiku-20241022').";
|
|
59
|
+
};
|
|
60
|
+
readonly api_key: {
|
|
61
|
+
readonly type: "string";
|
|
62
|
+
readonly description: "Anthropic API key. Falls back to ANTHROPIC_API_KEY environment variable if not set.";
|
|
63
|
+
readonly "x-ui-hidden": true;
|
|
64
|
+
};
|
|
65
|
+
readonly base_url: {
|
|
66
|
+
readonly type: "string";
|
|
67
|
+
readonly description: "Base URL for the Anthropic API (optional).";
|
|
68
|
+
};
|
|
69
|
+
readonly max_tokens: {
|
|
70
|
+
readonly type: "integer";
|
|
71
|
+
readonly description: "Default max tokens for responses. Anthropic requires this parameter.";
|
|
72
|
+
readonly default: 1024;
|
|
73
|
+
readonly minimum: 1;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly required: readonly ["model_name"];
|
|
77
|
+
readonly additionalProperties: false;
|
|
78
|
+
};
|
|
79
|
+
readonly model_id: {
|
|
80
|
+
readonly type: "string";
|
|
81
|
+
};
|
|
82
|
+
readonly tasks: {
|
|
83
|
+
readonly type: "array";
|
|
84
|
+
readonly items: {
|
|
85
|
+
readonly type: "string";
|
|
86
|
+
};
|
|
87
|
+
readonly "x-ui-editor": "multiselect";
|
|
88
|
+
};
|
|
89
|
+
readonly title: {
|
|
90
|
+
readonly type: "string";
|
|
91
|
+
};
|
|
92
|
+
readonly description: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly "x-ui-editor": "textarea";
|
|
95
|
+
};
|
|
96
|
+
readonly metadata: {
|
|
97
|
+
readonly type: "object";
|
|
98
|
+
readonly default: {};
|
|
99
|
+
readonly "x-ui-hidden": true;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
readonly required: readonly ["model_id", "tasks", "provider", "title", "description", "provider_config", "metadata", "provider", "provider_config"];
|
|
103
|
+
readonly additionalProperties: false;
|
|
104
|
+
};
|
|
105
|
+
export type AnthropicModelRecord = FromSchema<typeof AnthropicModelRecordSchema>;
|
|
106
|
+
export declare const AnthropicModelConfigSchema: {
|
|
107
|
+
readonly type: "object";
|
|
108
|
+
readonly properties: {
|
|
109
|
+
readonly provider: {
|
|
110
|
+
readonly const: "ANTHROPIC";
|
|
111
|
+
readonly description: "Discriminator: Anthropic cloud provider.";
|
|
112
|
+
};
|
|
113
|
+
readonly provider_config: {
|
|
114
|
+
readonly type: "object";
|
|
115
|
+
readonly description: "Anthropic-specific configuration.";
|
|
116
|
+
readonly properties: {
|
|
117
|
+
readonly model_name: {
|
|
118
|
+
readonly type: "string";
|
|
119
|
+
readonly description: "The Anthropic model identifier (e.g., 'claude-sonnet-4-20250514', 'claude-3-5-haiku-20241022').";
|
|
120
|
+
};
|
|
121
|
+
readonly api_key: {
|
|
122
|
+
readonly type: "string";
|
|
123
|
+
readonly description: "Anthropic API key. Falls back to ANTHROPIC_API_KEY environment variable if not set.";
|
|
124
|
+
readonly "x-ui-hidden": true;
|
|
125
|
+
};
|
|
126
|
+
readonly base_url: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly description: "Base URL for the Anthropic API (optional).";
|
|
129
|
+
};
|
|
130
|
+
readonly max_tokens: {
|
|
131
|
+
readonly type: "integer";
|
|
132
|
+
readonly description: "Default max tokens for responses. Anthropic requires this parameter.";
|
|
133
|
+
readonly default: 1024;
|
|
134
|
+
readonly minimum: 1;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
readonly required: readonly ["model_name"];
|
|
138
|
+
readonly additionalProperties: false;
|
|
139
|
+
};
|
|
140
|
+
readonly model_id: {
|
|
141
|
+
readonly type: "string";
|
|
142
|
+
};
|
|
143
|
+
readonly tasks: {
|
|
144
|
+
readonly type: "array";
|
|
145
|
+
readonly items: {
|
|
146
|
+
readonly type: "string";
|
|
147
|
+
};
|
|
148
|
+
readonly "x-ui-editor": "multiselect";
|
|
149
|
+
};
|
|
150
|
+
readonly title: {
|
|
151
|
+
readonly type: "string";
|
|
152
|
+
};
|
|
153
|
+
readonly description: {
|
|
154
|
+
readonly type: "string";
|
|
155
|
+
readonly "x-ui-editor": "textarea";
|
|
156
|
+
};
|
|
157
|
+
readonly metadata: {
|
|
158
|
+
readonly type: "object";
|
|
159
|
+
readonly default: {};
|
|
160
|
+
readonly "x-ui-hidden": true;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
readonly required: readonly ["provider", "provider_config", "provider", "provider_config"];
|
|
164
|
+
readonly additionalProperties: false;
|
|
165
|
+
};
|
|
166
|
+
export type AnthropicModelConfig = FromSchema<typeof AnthropicModelConfigSchema>;
|
|
167
|
+
//# sourceMappingURL=Anthropic_ModelSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Anthropic_ModelSchema.d.ts","sourceRoot":"","sources":["../../../src/anthropic/common/Anthropic_ModelSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAwB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGlE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCQ,CAAC;AAE1C,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQE,CAAC;AAE1C,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEjF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQE,CAAC;AAE1C,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Steven Roussey <sroussey@gmail.com>
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export * from "./Anthropic_Worker";
|
|
7
|
+
export * from "./AnthropicProvider";
|
|
8
|
+
export * from "./common/Anthropic_Constants";
|
|
9
|
+
export * from "./common/Anthropic_JobRunFns";
|
|
10
|
+
export * from "./common/Anthropic_ModelSchema";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/anthropic/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, {
|
|
5
|
+
get: all[name],
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
set: (newValue) => all[name] = () => newValue
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
12
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
13
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
14
|
+
}) : x)(function(x) {
|
|
15
|
+
if (typeof require !== "undefined")
|
|
16
|
+
return require.apply(this, arguments);
|
|
17
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// src/anthropic/Anthropic_Worker.ts
|
|
21
|
+
import { globalServiceRegistry, parentPort, WORKER_SERVER } from "@workglow/util";
|
|
22
|
+
|
|
23
|
+
// src/anthropic/AnthropicProvider.ts
|
|
24
|
+
import { AiProvider } from "@workglow/ai";
|
|
25
|
+
|
|
26
|
+
// src/anthropic/common/Anthropic_Constants.ts
|
|
27
|
+
var ANTHROPIC = "ANTHROPIC";
|
|
28
|
+
|
|
29
|
+
// src/anthropic/AnthropicProvider.ts
|
|
30
|
+
class AnthropicProvider extends AiProvider {
|
|
31
|
+
name = ANTHROPIC;
|
|
32
|
+
taskTypes = ["TextGenerationTask", "TextRewriterTask", "TextSummaryTask"];
|
|
33
|
+
constructor(tasks, streamTasks) {
|
|
34
|
+
super(tasks, streamTasks);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/anthropic/common/Anthropic_JobRunFns.ts
|
|
39
|
+
var _sdk;
|
|
40
|
+
async function loadAnthropicSDK() {
|
|
41
|
+
if (!_sdk) {
|
|
42
|
+
try {
|
|
43
|
+
_sdk = await import("@anthropic-ai/sdk");
|
|
44
|
+
} catch {
|
|
45
|
+
throw new Error("@anthropic-ai/sdk is required for Anthropic tasks. Install it with: bun add @anthropic-ai/sdk");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return _sdk.default;
|
|
49
|
+
}
|
|
50
|
+
async function getClient(model) {
|
|
51
|
+
const Anthropic = await loadAnthropicSDK();
|
|
52
|
+
const apiKey = model?.provider_config?.api_key || (typeof process !== "undefined" ? process.env?.ANTHROPIC_API_KEY : undefined);
|
|
53
|
+
if (!apiKey) {
|
|
54
|
+
throw new Error("Missing Anthropic API key: set provider_config.api_key or the ANTHROPIC_API_KEY environment variable.");
|
|
55
|
+
}
|
|
56
|
+
return new Anthropic({
|
|
57
|
+
apiKey,
|
|
58
|
+
baseURL: model?.provider_config?.base_url || undefined,
|
|
59
|
+
dangerouslyAllowBrowser: true
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function getModelName(model) {
|
|
63
|
+
const name = model?.provider_config?.model_name;
|
|
64
|
+
if (!name) {
|
|
65
|
+
throw new Error("Missing model name in provider_config.model_name.");
|
|
66
|
+
}
|
|
67
|
+
return name;
|
|
68
|
+
}
|
|
69
|
+
function getMaxTokens(input, model) {
|
|
70
|
+
return input.maxTokens ?? model?.provider_config?.max_tokens ?? 1024;
|
|
71
|
+
}
|
|
72
|
+
var Anthropic_TextGeneration = async (input, model, update_progress, signal) => {
|
|
73
|
+
update_progress(0, "Starting Anthropic text generation");
|
|
74
|
+
const client = await getClient(model);
|
|
75
|
+
const modelName = getModelName(model);
|
|
76
|
+
const response = await client.messages.create({
|
|
77
|
+
model: modelName,
|
|
78
|
+
messages: [{ role: "user", content: input.prompt }],
|
|
79
|
+
max_tokens: getMaxTokens(input, model),
|
|
80
|
+
temperature: input.temperature,
|
|
81
|
+
top_p: input.topP
|
|
82
|
+
}, { signal });
|
|
83
|
+
const text = response.content[0]?.type === "text" ? response.content[0].text : "";
|
|
84
|
+
update_progress(100, "Completed Anthropic text generation");
|
|
85
|
+
return { text };
|
|
86
|
+
};
|
|
87
|
+
var Anthropic_TextRewriter = async (input, model, update_progress, signal) => {
|
|
88
|
+
update_progress(0, "Starting Anthropic text rewriting");
|
|
89
|
+
const client = await getClient(model);
|
|
90
|
+
const modelName = getModelName(model);
|
|
91
|
+
const response = await client.messages.create({
|
|
92
|
+
model: modelName,
|
|
93
|
+
system: input.prompt,
|
|
94
|
+
messages: [{ role: "user", content: input.text }],
|
|
95
|
+
max_tokens: getMaxTokens({}, model)
|
|
96
|
+
}, { signal });
|
|
97
|
+
const text = response.content[0]?.type === "text" ? response.content[0].text : "";
|
|
98
|
+
update_progress(100, "Completed Anthropic text rewriting");
|
|
99
|
+
return { text };
|
|
100
|
+
};
|
|
101
|
+
var Anthropic_TextSummary = async (input, model, update_progress, signal) => {
|
|
102
|
+
update_progress(0, "Starting Anthropic text summarization");
|
|
103
|
+
const client = await getClient(model);
|
|
104
|
+
const modelName = getModelName(model);
|
|
105
|
+
const response = await client.messages.create({
|
|
106
|
+
model: modelName,
|
|
107
|
+
system: "Summarize the following text concisely.",
|
|
108
|
+
messages: [{ role: "user", content: input.text }],
|
|
109
|
+
max_tokens: getMaxTokens({}, model)
|
|
110
|
+
}, { signal });
|
|
111
|
+
const text = response.content[0]?.type === "text" ? response.content[0].text : "";
|
|
112
|
+
update_progress(100, "Completed Anthropic text summarization");
|
|
113
|
+
return { text };
|
|
114
|
+
};
|
|
115
|
+
var Anthropic_TextGeneration_Stream = async function* (input, model, signal) {
|
|
116
|
+
const client = await getClient(model);
|
|
117
|
+
const modelName = getModelName(model);
|
|
118
|
+
const stream = client.messages.stream({
|
|
119
|
+
model: modelName,
|
|
120
|
+
messages: [{ role: "user", content: input.prompt }],
|
|
121
|
+
max_tokens: getMaxTokens(input, model),
|
|
122
|
+
temperature: input.temperature,
|
|
123
|
+
top_p: input.topP
|
|
124
|
+
}, { signal });
|
|
125
|
+
for await (const event of stream) {
|
|
126
|
+
if (event.type === "content_block_delta" && event.delta.type === "text_delta") {
|
|
127
|
+
yield { type: "text-delta", textDelta: event.delta.text };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
yield { type: "finish", data: {} };
|
|
131
|
+
};
|
|
132
|
+
var Anthropic_TextRewriter_Stream = async function* (input, model, signal) {
|
|
133
|
+
const client = await getClient(model);
|
|
134
|
+
const modelName = getModelName(model);
|
|
135
|
+
const stream = client.messages.stream({
|
|
136
|
+
model: modelName,
|
|
137
|
+
system: input.prompt,
|
|
138
|
+
messages: [{ role: "user", content: input.text }],
|
|
139
|
+
max_tokens: getMaxTokens({}, model)
|
|
140
|
+
}, { signal });
|
|
141
|
+
for await (const event of stream) {
|
|
142
|
+
if (event.type === "content_block_delta" && event.delta.type === "text_delta") {
|
|
143
|
+
yield { type: "text-delta", textDelta: event.delta.text };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
yield { type: "finish", data: {} };
|
|
147
|
+
};
|
|
148
|
+
var Anthropic_TextSummary_Stream = async function* (input, model, signal) {
|
|
149
|
+
const client = await getClient(model);
|
|
150
|
+
const modelName = getModelName(model);
|
|
151
|
+
const stream = client.messages.stream({
|
|
152
|
+
model: modelName,
|
|
153
|
+
system: "Summarize the following text concisely.",
|
|
154
|
+
messages: [{ role: "user", content: input.text }],
|
|
155
|
+
max_tokens: getMaxTokens({}, model)
|
|
156
|
+
}, { signal });
|
|
157
|
+
for await (const event of stream) {
|
|
158
|
+
if (event.type === "content_block_delta" && event.delta.type === "text_delta") {
|
|
159
|
+
yield { type: "text-delta", textDelta: event.delta.text };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
yield { type: "finish", data: {} };
|
|
163
|
+
};
|
|
164
|
+
var ANTHROPIC_TASKS = {
|
|
165
|
+
TextGenerationTask: Anthropic_TextGeneration,
|
|
166
|
+
TextRewriterTask: Anthropic_TextRewriter,
|
|
167
|
+
TextSummaryTask: Anthropic_TextSummary
|
|
168
|
+
};
|
|
169
|
+
var ANTHROPIC_STREAM_TASKS = {
|
|
170
|
+
TextGenerationTask: Anthropic_TextGeneration_Stream,
|
|
171
|
+
TextRewriterTask: Anthropic_TextRewriter_Stream,
|
|
172
|
+
TextSummaryTask: Anthropic_TextSummary_Stream
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// src/anthropic/Anthropic_Worker.ts
|
|
176
|
+
function ANTHROPIC_WORKER_JOBRUN_REGISTER() {
|
|
177
|
+
const workerServer = globalServiceRegistry.get(WORKER_SERVER);
|
|
178
|
+
new AnthropicProvider(ANTHROPIC_TASKS, ANTHROPIC_STREAM_TASKS).registerOnWorkerServer(workerServer);
|
|
179
|
+
parentPort.postMessage({ type: "ready" });
|
|
180
|
+
console.log("ANTHROPIC_WORKER_JOBRUN registered");
|
|
181
|
+
}
|
|
182
|
+
// src/anthropic/common/Anthropic_ModelSchema.ts
|
|
183
|
+
import { ModelConfigSchema, ModelRecordSchema } from "@workglow/ai";
|
|
184
|
+
var AnthropicModelSchema = {
|
|
185
|
+
type: "object",
|
|
186
|
+
properties: {
|
|
187
|
+
provider: {
|
|
188
|
+
const: ANTHROPIC,
|
|
189
|
+
description: "Discriminator: Anthropic cloud provider."
|
|
190
|
+
},
|
|
191
|
+
provider_config: {
|
|
192
|
+
type: "object",
|
|
193
|
+
description: "Anthropic-specific configuration.",
|
|
194
|
+
properties: {
|
|
195
|
+
model_name: {
|
|
196
|
+
type: "string",
|
|
197
|
+
description: "The Anthropic model identifier (e.g., 'claude-sonnet-4-20250514', 'claude-3-5-haiku-20241022')."
|
|
198
|
+
},
|
|
199
|
+
api_key: {
|
|
200
|
+
type: "string",
|
|
201
|
+
description: "Anthropic API key. Falls back to ANTHROPIC_API_KEY environment variable if not set.",
|
|
202
|
+
"x-ui-hidden": true
|
|
203
|
+
},
|
|
204
|
+
base_url: {
|
|
205
|
+
type: "string",
|
|
206
|
+
description: "Base URL for the Anthropic API (optional)."
|
|
207
|
+
},
|
|
208
|
+
max_tokens: {
|
|
209
|
+
type: "integer",
|
|
210
|
+
description: "Default max tokens for responses. Anthropic requires this parameter.",
|
|
211
|
+
default: 1024,
|
|
212
|
+
minimum: 1
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
required: ["model_name"],
|
|
216
|
+
additionalProperties: false
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
required: ["provider", "provider_config"],
|
|
220
|
+
additionalProperties: true
|
|
221
|
+
};
|
|
222
|
+
var AnthropicModelRecordSchema = {
|
|
223
|
+
type: "object",
|
|
224
|
+
properties: {
|
|
225
|
+
...ModelRecordSchema.properties,
|
|
226
|
+
...AnthropicModelSchema.properties
|
|
227
|
+
},
|
|
228
|
+
required: [...ModelRecordSchema.required, ...AnthropicModelSchema.required],
|
|
229
|
+
additionalProperties: false
|
|
230
|
+
};
|
|
231
|
+
var AnthropicModelConfigSchema = {
|
|
232
|
+
type: "object",
|
|
233
|
+
properties: {
|
|
234
|
+
...ModelConfigSchema.properties,
|
|
235
|
+
...AnthropicModelSchema.properties
|
|
236
|
+
},
|
|
237
|
+
required: [...ModelConfigSchema.required, ...AnthropicModelSchema.required],
|
|
238
|
+
additionalProperties: false
|
|
239
|
+
};
|
|
240
|
+
export {
|
|
241
|
+
Anthropic_TextSummary_Stream,
|
|
242
|
+
Anthropic_TextSummary,
|
|
243
|
+
Anthropic_TextRewriter_Stream,
|
|
244
|
+
Anthropic_TextRewriter,
|
|
245
|
+
Anthropic_TextGeneration_Stream,
|
|
246
|
+
Anthropic_TextGeneration,
|
|
247
|
+
AnthropicProvider,
|
|
248
|
+
AnthropicModelSchema,
|
|
249
|
+
AnthropicModelRecordSchema,
|
|
250
|
+
AnthropicModelConfigSchema,
|
|
251
|
+
ANTHROPIC_WORKER_JOBRUN_REGISTER,
|
|
252
|
+
ANTHROPIC_TASKS,
|
|
253
|
+
ANTHROPIC_STREAM_TASKS,
|
|
254
|
+
ANTHROPIC
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
//# debugId=EC2382865C58E15164756E2164756E21
|