prompt-api-polyfill 1.12.0 → 1.12.1
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
CHANGED
|
@@ -52,7 +52,8 @@ configured, the polyfill will use Transformers.js with the default model.
|
|
|
52
52
|
|
|
53
53
|
- **Uses**: `@huggingface/transformers` SDK.
|
|
54
54
|
- **Select by setting**: `window.TRANSFORMERS_CONFIG`.
|
|
55
|
-
- **Note**: This is the **default backend** if no other configuration is
|
|
55
|
+
- **Note**: This is the **default backend** if no other configuration is
|
|
56
|
+
provided.
|
|
56
57
|
- **Model**: Uses default if not specified (see
|
|
57
58
|
[`backends/defaults.js`](backends/defaults.js)).
|
|
58
59
|
|
|
@@ -8,7 +8,7 @@ class w extends h {
|
|
|
8
8
|
#n;
|
|
9
9
|
constructor(s = {}) {
|
|
10
10
|
if (super(s.modelName || c.transformers.modelName), this.#o = s.device || c.transformers.device, this.#a = s.dtype || c.transformers.dtype, s.isDefault && console.log(
|
|
11
|
-
`
|
|
11
|
+
`Polyfill: No backend configuration found. Defaulting to Transformers.js with model: ${this.modelName}`
|
|
12
12
|
), p.experimental_useCrossOriginStorage = !0, s.env) {
|
|
13
13
|
const e = (n, r) => {
|
|
14
14
|
for (const [o, t] of Object.entries(r))
|
|
@@ -363,8 +363,7 @@ class h extends EventTarget {
|
|
|
363
363
|
if (e)
|
|
364
364
|
return {
|
|
365
365
|
...e,
|
|
366
|
-
configValue: { apiKey: "dummy", isDefault: !0 }
|
|
367
|
-
isDefault: !0
|
|
366
|
+
configValue: { apiKey: "dummy", isDefault: !0 }
|
|
368
367
|
};
|
|
369
368
|
const r = h.#d.map((n) => `window.${n.config}`).join(", ");
|
|
370
369
|
throw new (t.DOMException || globalThis.DOMException)(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prompt-api-polyfill",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"description": "Polyfill for the Prompt API (`LanguageModel`) backed by Firebase AI Logic, Gemini API, OpenAI API, or Transformers.js.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/prompt-api-polyfill.js",
|