prompt-api-polyfill 1.18.0 → 1.20.0
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/backends/firebase.js +1 -1
- package/dist/backends/gemini.js +1 -1
- package/dist/backends/openai.js +1 -1
- package/dist/backends/transformers.js +1 -1
- package/dist/backends/webllm.js +1 -1
- package/dist/prompt-api-polyfill.js +2 -1
- package/package.json +10 -10
- /package/dist/chunks/{defaults-DMD-8IKq.js → defaults-n7NcZd-K.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/defaults-
|
|
1
|
+
import { n as e, t } from "../chunks/defaults-n7NcZd-K.js";
|
|
2
2
|
import { initializeApp as n } from "firebase/app";
|
|
3
3
|
import { ReCaptchaEnterpriseProvider as r, initializeAppCheck as i } from "firebase/app-check";
|
|
4
4
|
import { GoogleAIBackend as a, InferenceMode as o, Schema as s, VertexAIBackend as c, getAI as l, getGenerativeModel as u } from "firebase/ai";
|
package/dist/backends/gemini.js
CHANGED
package/dist/backends/openai.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/defaults-
|
|
1
|
+
import { n as e, t } from "../chunks/defaults-n7NcZd-K.js";
|
|
2
2
|
import { TextStreamer as n, env as r, pipeline as i } from "@huggingface/transformers";
|
|
3
3
|
//#region backends/transformers.js
|
|
4
4
|
var a = class extends e {
|
package/dist/backends/webllm.js
CHANGED
|
@@ -272,6 +272,7 @@ var i = class i extends EventTarget {
|
|
|
272
272
|
return n(i.#d(e).path);
|
|
273
273
|
}
|
|
274
274
|
static async #p(e = {}, t = globalThis) {
|
|
275
|
+
if (e.samplingMode !== void 0 && typeof e.samplingMode != "string") throw TypeError("The samplingMode option must be a string.");
|
|
275
276
|
if (e.expectedInputs) for (let t of e.expectedInputs) {
|
|
276
277
|
if (t.type !== "text" && t.type !== "image" && t.type !== "audio") throw TypeError(`Invalid input type: ${t.type}`);
|
|
277
278
|
t.languages && i.#m(t.languages);
|
|
@@ -312,7 +313,7 @@ var i = class i extends EventTarget {
|
|
|
312
313
|
}
|
|
313
314
|
static async create(e = {}) {
|
|
314
315
|
let t = this.__window || globalThis;
|
|
315
|
-
if (i.#c(t), await i.#p(e, t), e.signal?.aborted) throw e.signal.reason || new (t.DOMException || globalThis.DOMException)("Aborted", "AbortError");
|
|
316
|
+
if (i.#c(t), await i.#p(e, t), e.samplingMode !== void 0 && console.warn(`Prompt API Polyfill: The samplingMode option ("${e.samplingMode}") is not supported and will be silently ignored.`), e.signal?.aborted) throw e.signal.reason || new (t.DOMException || globalThis.DOMException)("Aborted", "AbortError");
|
|
316
317
|
let n = await this.availability(e);
|
|
317
318
|
if (n === "unavailable") throw new (t.DOMException || globalThis.DOMException)("The model is not available for the given options.", "NotSupportedError");
|
|
318
319
|
if (n === "downloadable" || n === "downloading") throw new (t.DOMException || globalThis.DOMException)("Requires a user gesture when availability is \"downloading\" or \"downloadable\".", "NotAllowedError");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prompt-api-polyfill",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
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",
|
|
@@ -47,20 +47,20 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/js": "^10.0.1",
|
|
50
|
-
"eslint": "^10.4.
|
|
50
|
+
"eslint": "^10.4.1",
|
|
51
51
|
"eslint-config-prettier": "^10.1.8",
|
|
52
52
|
"globals": "^17.6.0",
|
|
53
|
-
"node-addon-api": "^8.
|
|
54
|
-
"node-gyp": "^12.
|
|
55
|
-
"prettier": "^3.8.
|
|
53
|
+
"node-addon-api": "^8.8.0",
|
|
54
|
+
"node-gyp": "^12.4.0",
|
|
55
|
+
"prettier": "^3.8.4",
|
|
56
56
|
"prettier-plugin-curly": "^0.4.1",
|
|
57
|
-
"vite": "^8.0.
|
|
57
|
+
"vite": "^8.0.16"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@google/genai": "^2.
|
|
60
|
+
"@google/genai": "^2.8.0",
|
|
61
61
|
"@huggingface/transformers": "^4.2.0",
|
|
62
|
-
"@mlc-ai/web-llm": "^0.2.
|
|
63
|
-
"firebase": "^12.
|
|
64
|
-
"openai": "^6.
|
|
62
|
+
"@mlc-ai/web-llm": "^0.2.84",
|
|
63
|
+
"firebase": "^12.14.0",
|
|
64
|
+
"openai": "^6.42.0"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
File without changes
|