@workglow/huggingface-transformers 0.2.33 → 0.2.35

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.
Files changed (62) hide show
  1. package/dist/ai/HuggingFaceTransformersProvider.d.ts +9 -8
  2. package/dist/ai/HuggingFaceTransformersProvider.d.ts.map +1 -1
  3. package/dist/ai/HuggingFaceTransformersQueuedProvider.d.ts +10 -8
  4. package/dist/ai/HuggingFaceTransformersQueuedProvider.d.ts.map +1 -1
  5. package/dist/ai/common/HFT_BackgroundRemoval.d.ts.map +1 -1
  6. package/dist/ai/common/HFT_Capabilities.d.ts +28 -0
  7. package/dist/ai/common/HFT_Capabilities.d.ts.map +1 -0
  8. package/dist/ai/common/HFT_CapabilitySets.d.ts +39 -0
  9. package/dist/ai/common/HFT_CapabilitySets.d.ts.map +1 -0
  10. package/dist/ai/common/HFT_Chat.d.ts +1 -2
  11. package/dist/ai/common/HFT_Chat.d.ts.map +1 -1
  12. package/dist/ai/common/HFT_CountTokens.d.ts.map +1 -1
  13. package/dist/ai/common/HFT_Download.d.ts +7 -2
  14. package/dist/ai/common/HFT_Download.d.ts.map +1 -1
  15. package/dist/ai/common/{HFT_Unload.d.ts → HFT_DownloadRemove.d.ts} +3 -3
  16. package/dist/ai/common/HFT_DownloadRemove.d.ts.map +1 -0
  17. package/dist/ai/common/HFT_ImageClassification.d.ts.map +1 -1
  18. package/dist/ai/common/HFT_ImageEmbedding.d.ts.map +1 -1
  19. package/dist/ai/common/HFT_ImageSegmentation.d.ts.map +1 -1
  20. package/dist/ai/common/HFT_ImageToText.d.ts.map +1 -1
  21. package/dist/ai/common/HFT_JobRunFns.d.ts +9 -9
  22. package/dist/ai/common/HFT_JobRunFns.d.ts.map +1 -1
  23. package/dist/ai/common/HFT_ModelInfo.d.ts.map +1 -1
  24. package/dist/ai/common/HFT_ModelSchema.d.ts +3 -3
  25. package/dist/ai/common/HFT_ObjectDetection.d.ts.map +1 -1
  26. package/dist/ai/common/HFT_Pipeline.d.ts +30 -4
  27. package/dist/ai/common/HFT_Pipeline.d.ts.map +1 -1
  28. package/dist/ai/common/HFT_Streaming.d.ts +5 -12
  29. package/dist/ai/common/HFT_Streaming.d.ts.map +1 -1
  30. package/dist/ai/common/HFT_StructuredGeneration.d.ts +1 -2
  31. package/dist/ai/common/HFT_StructuredGeneration.d.ts.map +1 -1
  32. package/dist/ai/common/HFT_TextClassification.d.ts.map +1 -1
  33. package/dist/ai/common/HFT_TextEmbedding.d.ts +4 -0
  34. package/dist/ai/common/HFT_TextEmbedding.d.ts.map +1 -1
  35. package/dist/ai/common/HFT_TextFillMask.d.ts.map +1 -1
  36. package/dist/ai/common/HFT_TextGeneration.d.ts +1 -6
  37. package/dist/ai/common/HFT_TextGeneration.d.ts.map +1 -1
  38. package/dist/ai/common/HFT_TextLanguageDetection.d.ts.map +1 -1
  39. package/dist/ai/common/HFT_TextNamedEntityRecognition.d.ts.map +1 -1
  40. package/dist/ai/common/HFT_TextQuestionAnswer.d.ts +1 -6
  41. package/dist/ai/common/HFT_TextQuestionAnswer.d.ts.map +1 -1
  42. package/dist/ai/common/HFT_TextRewriter.d.ts +1 -6
  43. package/dist/ai/common/HFT_TextRewriter.d.ts.map +1 -1
  44. package/dist/ai/common/HFT_TextSummary.d.ts +1 -6
  45. package/dist/ai/common/HFT_TextSummary.d.ts.map +1 -1
  46. package/dist/ai/common/HFT_TextTranslation.d.ts +1 -6
  47. package/dist/ai/common/HFT_TextTranslation.d.ts.map +1 -1
  48. package/dist/ai/common/HFT_ToolCalling.d.ts +1 -2
  49. package/dist/ai/common/HFT_ToolCalling.d.ts.map +1 -1
  50. package/dist/ai/index.d.ts +53 -2
  51. package/dist/ai/index.d.ts.map +1 -1
  52. package/dist/ai/registerHuggingFaceTransformersInline.d.ts.map +1 -1
  53. package/dist/ai/registerHuggingFaceTransformersWorker.d.ts.map +1 -1
  54. package/dist/ai/runtime.d.ts.map +1 -1
  55. package/dist/ai-runtime.d.ts.map +1 -1
  56. package/dist/ai-runtime.js +602 -848
  57. package/dist/ai-runtime.js.map +37 -36
  58. package/dist/ai.d.ts.map +1 -1
  59. package/dist/ai.js +1383 -183
  60. package/dist/ai.js.map +37 -8
  61. package/package.json +12 -13
  62. package/dist/ai/common/HFT_Unload.d.ts.map +0 -1
@@ -3,12 +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, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
7
7
  import type { HfTransformersOnnxModelConfig } from "./HFT_ModelSchema";
8
- /**
9
- * Core implementation for text summarization using Hugging Face Transformers.
10
- * This is shared between inline and worker implementations.
11
- */
12
8
  export declare const HFT_TextSummary: AiProviderRunFn<TextSummaryTaskInput, TextSummaryTaskOutput, HfTransformersOnnxModelConfig>;
13
- export declare const HFT_TextSummary_Stream: AiProviderStreamFn<TextSummaryTaskInput, TextSummaryTaskOutput, HfTransformersOnnxModelConfig>;
14
9
  //# sourceMappingURL=HFT_TextSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HFT_TextSummary.d.ts","sourceRoot":"","sources":["../../../src/ai/common/HFT_TextSummary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAQvE;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,CAyB9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,CA6B9B,CAAC"}
1
+ {"version":3,"file":"HFT_TextSummary.d.ts","sourceRoot":"","sources":["../../../src/ai/common/HFT_TextSummary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAIvE,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,CAoB9B,CAAC"}
@@ -3,12 +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, TextTranslationTaskInput, TextTranslationTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, TextTranslationTaskInput, TextTranslationTaskOutput } from "@workglow/ai";
7
7
  import type { HfTransformersOnnxModelConfig } from "./HFT_ModelSchema";
8
- /**
9
- * Core implementation for text translation using Hugging Face Transformers.
10
- * This is shared between inline and worker implementations.
11
- */
12
8
  export declare const HFT_TextTranslation: AiProviderRunFn<TextTranslationTaskInput, TextTranslationTaskOutput, HfTransformersOnnxModelConfig>;
13
- export declare const HFT_TextTranslation_Stream: AiProviderStreamFn<TextTranslationTaskInput, TextTranslationTaskOutput, HfTransformersOnnxModelConfig>;
14
9
  //# sourceMappingURL=HFT_TextTranslation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HFT_TextTranslation.d.ts","sourceRoot":"","sources":["../../../src/ai/common/HFT_TextTranslation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAQvE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAC/C,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,CAyB9B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CACzD,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,CA0B9B,CAAC"}
1
+ {"version":3,"file":"HFT_TextTranslation.d.ts","sourceRoot":"","sources":["../../../src/ai/common/HFT_TextTranslation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAIvE,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAC/C,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,CAsB9B,CAAC"}
@@ -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, ChatMessage, ToolCallingTaskInput, ToolCallingTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, ChatMessage, ToolCallingTaskInput, ToolCallingTaskOutput } from "@workglow/ai";
7
7
  import type { HfTransformersOnnxModelConfig } from "./HFT_ModelSchema";
8
8
  /**
9
9
  * Build structured messages for HFT's `apply_chat_template`.
@@ -15,5 +15,4 @@ import type { HfTransformersOnnxModelConfig } from "./HFT_ModelSchema";
15
15
  */
16
16
  export declare function buildHFTMessages(messages: ReadonlyArray<ChatMessage> | undefined, systemPrompt: string | undefined, prompt: unknown, toolChoice: string | undefined): Array<Record<string, unknown>>;
17
17
  export declare const HFT_ToolCalling: AiProviderRunFn<ToolCallingTaskInput, ToolCallingTaskOutput, HfTransformersOnnxModelConfig>;
18
- export declare const HFT_ToolCalling_Stream: AiProviderStreamFn<ToolCallingTaskInput, ToolCallingTaskOutput, HfTransformersOnnxModelConfig>;
19
18
  //# sourceMappingURL=HFT_ToolCalling.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HFT_ToolCalling.d.ts","sourceRoot":"","sources":["../../../src/ai/common/HFT_ToolCalling.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,cAAc,CAAC;AActB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AA4GvE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,SAAS,EAChD,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAyDhC;AA+FD,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,CA2E9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,CAoI9B,CAAC"}
1
+ {"version":3,"file":"HFT_ToolCalling.d.ts","sourceRoot":"","sources":["../../../src/ai/common/HFT_ToolCalling.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EAEtB,MAAM,cAAc,CAAC;AAatB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAwGvE;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,SAAS,EAChD,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAyDhC;AA+FD,eAAO,MAAM,eAAe,EAAE,eAAe,CAC3C,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,CAqG9B,CAAC"}
@@ -5,9 +5,60 @@
5
5
  */
6
6
  export * from "./common/HFT_Constants";
7
7
  export * from "./common/HFT_ModelSchema";
8
+ export * from "./common/HFT_OnnxDtypes";
9
+ export * from "./common/HFT_ToolMarkup";
8
10
  export * from "./HuggingFaceTransformersProvider";
9
11
  export * from "./HuggingFaceTransformersQueuedProvider";
10
12
  export * from "./registerHuggingFaceTransformers";
11
- export * from "./common/HFT_OnnxDtypes";
12
- export * from "./common/HFT_ToolMarkup";
13
+ /**
14
+ * @internal Symbols exported only for use by `@workglow/test`. Not part of the stable public API.
15
+ */
16
+ export declare const _testOnly: {
17
+ readonly HFT_RUN_FN_SPECS: {
18
+ serves: ["image.background-removal"] | ["image.classification"] | ["image.embedding"] | ["image.object-detection"] | ["image.segmentation"] | ["image.to-text"] | ["model.count-tokens"] | ["model.download"] | ["model.download-remove"] | ["model.info"] | ["model.search"] | ["text.classification"] | ["text.embedding"] | ["text.fill-mask"] | ["text.generation"] | ["text.language-detection"] | ["text.ner"] | ["text.question-answering"] | ["text.rewriter"] | ["text.summary"] | ["text.translation"] | ["text.generation", "json-mode"] | ["text.generation", "tool-use"];
19
+ }[];
20
+ readonly HFT_RUN_FNS: readonly import("@workglow/ai").AiProviderRunFnRegistration<any, any, {
21
+ capabilities?: string[] | undefined;
22
+ description?: string | undefined;
23
+ metadata?: {
24
+ [x: string]: unknown;
25
+ } | undefined;
26
+ model_id?: string | undefined;
27
+ provider: "HF_TRANSFORMERS_ONNX";
28
+ provider_config: {
29
+ device?: "cpu" | "gpu" | "metal" | "wasm" | "webgpu" | undefined;
30
+ dtype?: "auto" | "bnb4" | "fp16" | "fp32" | "int8" | "q1" | "q1f16" | "q2" | "q2f16" | "q4" | "q4f16" | "q8" | "uint8" | undefined;
31
+ execution_providers?: string[] | undefined;
32
+ inter_op_num_threads?: number | undefined;
33
+ intra_op_num_threads?: number | undefined;
34
+ language_style?: string | undefined;
35
+ model_path: string;
36
+ mrl?: boolean | undefined;
37
+ native_dimensions: number;
38
+ normalize?: boolean | undefined;
39
+ pipeline: "feature-extraction";
40
+ pooling?: "cls" | "last_token" | "mean" | undefined;
41
+ revision?: string | undefined;
42
+ seed?: number | undefined;
43
+ use_external_data_format?: boolean | undefined;
44
+ } | {
45
+ device?: "cpu" | "gpu" | "metal" | "wasm" | "webgpu" | undefined;
46
+ dtype?: "auto" | "bnb4" | "fp16" | "fp32" | "int8" | "q1" | "q1f16" | "q2" | "q2f16" | "q4" | "q4f16" | "q8" | "uint8" | undefined;
47
+ execution_providers?: string[] | undefined;
48
+ inter_op_num_threads?: number | undefined;
49
+ intra_op_num_threads?: number | undefined;
50
+ language_style?: string | undefined;
51
+ model_path: string;
52
+ mrl?: boolean | undefined;
53
+ native_dimensions?: number | undefined;
54
+ normalize?: boolean | undefined;
55
+ pipeline: "audio-classification" | "automatic-speech-recognition" | "background-removal" | "depth-estimation" | "document-question-answering" | "fill-mask" | "image-classification" | "image-feature-extraction" | "image-segmentation" | "image-to-image" | "image-to-text" | "object-detection" | "question-answering" | "summarization" | "text-classification" | "text-generation" | "text-to-speech" | "text2text-generation" | "token-classification" | "translation" | "zero-shot-audio-classification" | "zero-shot-classification" | "zero-shot-image-classification" | "zero-shot-object-detection";
56
+ pooling?: "cls" | "last_token" | "mean" | undefined;
57
+ revision?: string | undefined;
58
+ seed?: number | undefined;
59
+ use_external_data_format?: boolean | undefined;
60
+ };
61
+ title?: string | undefined;
62
+ }>[];
63
+ };
13
64
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAKlD;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGZ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"registerHuggingFaceTransformersInline.d.ts","sourceRoot":"","sources":["../../src/ai/registerHuggingFaceTransformersInline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAO9D;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,IAAI,CAAC,CAcf"}
1
+ {"version":3,"file":"registerHuggingFaceTransformersInline.d.ts","sourceRoot":"","sources":["../../src/ai/registerHuggingFaceTransformersInline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAO9D;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -1 +1 @@
1
- {"version":3,"file":"registerHuggingFaceTransformersWorker.d.ts","sourceRoot":"","sources":["../../src/ai/registerHuggingFaceTransformersWorker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,wBAAsB,qCAAqC,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB3E"}
1
+ {"version":3,"file":"registerHuggingFaceTransformersWorker.d.ts","sourceRoot":"","sources":["../../src/ai/registerHuggingFaceTransformersWorker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,wBAAsB,qCAAqC,IAAI,OAAO,CAAC,IAAI,CAAC,CAY3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/ai/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/ai/runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AAIH,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ai-runtime.d.ts","sourceRoot":"","sources":["../src/ai-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"ai-runtime.d.ts","sourceRoot":"","sources":["../src/ai-runtime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,cAAc,cAAc,CAAC"}