prompt-api-polyfill 1.20.0 → 1.20.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.
@@ -272,7 +272,6 @@ 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.");
276
275
  if (e.expectedInputs) for (let t of e.expectedInputs) {
277
276
  if (t.type !== "text" && t.type !== "image" && t.type !== "audio") throw TypeError(`Invalid input type: ${t.type}`);
278
277
  t.languages && i.#m(t.languages);
@@ -313,7 +312,7 @@ var i = class i extends EventTarget {
313
312
  }
314
313
  static async create(e = {}) {
315
314
  let t = this.__window || globalThis;
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");
315
+ if (i.#c(t), await i.#p(e, t), e.signal?.aborted) throw e.signal.reason || new (t.DOMException || globalThis.DOMException)("Aborted", "AbortError");
317
316
  let n = await this.availability(e);
318
317
  if (n === "unavailable") throw new (t.DOMException || globalThis.DOMException)("The model is not available for the given options.", "NotSupportedError");
319
318
  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.20.0",
3
+ "version": "1.20.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",
@@ -47,11 +47,11 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@eslint/js": "^10.0.1",
50
- "eslint": "^10.4.1",
50
+ "eslint": "^10.5.0",
51
51
  "eslint-config-prettier": "^10.1.8",
52
52
  "globals": "^17.6.0",
53
53
  "node-addon-api": "^8.8.0",
54
- "node-gyp": "^12.4.0",
54
+ "node-gyp": "^13.0.0",
55
55
  "prettier": "^3.8.4",
56
56
  "prettier-plugin-curly": "^0.4.1",
57
57
  "vite": "^8.0.16"
@@ -60,7 +60,7 @@
60
60
  "@google/genai": "^2.8.0",
61
61
  "@huggingface/transformers": "^4.2.0",
62
62
  "@mlc-ai/web-llm": "^0.2.84",
63
- "firebase": "^12.14.0",
64
- "openai": "^6.42.0"
63
+ "firebase": "^12.15.0",
64
+ "openai": "^6.44.0"
65
65
  }
66
66
  }