prompt-api-polyfill 1.14.0 → 1.14.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prompt-api-polyfill",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
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,17 +47,19 @@
47
47
  },
48
48
  "devDependencies": {
49
49
  "@eslint/js": "^10.0.1",
50
- "eslint": "^10.0.3",
50
+ "eslint": "^10.1.0",
51
51
  "eslint-config-prettier": "^10.1.8",
52
52
  "globals": "^17.4.0",
53
+ "node-addon-api": "^8.7.0",
54
+ "node-gyp": "^12.2.0",
53
55
  "prettier": "^3.8.1",
54
56
  "prettier-plugin-curly": "^0.4.1",
55
- "vite": "^7.3.1"
57
+ "vite": "^8.0.3"
56
58
  },
57
59
  "dependencies": {
58
- "@google/genai": "^1.44.0",
59
- "@huggingface/transformers": "^4.0.0-next.7",
60
- "firebase": "^12.10.0",
61
- "openai": "^6.27.0"
60
+ "@google/genai": "^1.46.0",
61
+ "@huggingface/transformers": "^4.0.0-next.9",
62
+ "firebase": "^12.11.0",
63
+ "openai": "^6.33.0"
62
64
  }
63
65
  }
@@ -1,72 +0,0 @@
1
- class r {
2
- /**
3
- * @param {string} modelName - The name of the model.
4
- */
5
- constructor(e) {
6
- this.modelName = e;
7
- }
8
- /**
9
- * Checks if the backend is available given the options.
10
- * @param {Object} _options - LanguageModel options.
11
- * @returns {string} 'available', 'unavailable', 'downloadable', or 'downloading'.
12
- */
13
- static availability(e) {
14
- return "available";
15
- }
16
- /**
17
- * Creates a model session and stores it.
18
- * @param {Object} _options - LanguageModel options.
19
- * @param {Object} _sessionParams - Parameters for the cloud or local model.
20
- * @param {EventTarget} [_monitorTarget] - The event target to dispatch download progress events to.
21
- * @returns {any} The created session object.
22
- */
23
- createSession(e, n, o) {
24
- throw new Error("Not implemented");
25
- }
26
- /**
27
- * Generates content (non-streaming).
28
- * @param {Array} _content - The history + new message content.
29
- * @returns {Promise<{text: string, usage: number}>}
30
- */
31
- async generateContent(e) {
32
- throw new Error("Not implemented");
33
- }
34
- /**
35
- * Generates content stream.
36
- * @param {Array} _content - The history + new content.
37
- * @returns {Promise<AsyncIterable>} Stream of chunks.
38
- */
39
- async generateContentStream(e) {
40
- throw new Error("Not implemented");
41
- }
42
- /**
43
- * Counts tokens.
44
- * @param {Array} _content - The content to count.
45
- * @returns {Promise<number>} Total tokens.
46
- */
47
- async countTokens(e) {
48
- throw new Error("Not implemented");
49
- }
50
- /**
51
- * Translates a standard JSON Schema into a backend-specific format.
52
- * @param {Object} schema - The standard JSON Schema.
53
- * @returns {any} The backend-specific schema.
54
- */
55
- convertSchema(e) {
56
- return e;
57
- }
58
- }
59
- const a = {
60
- firebase: { modelName: "gemini-2.5-flash-lite" },
61
- gemini: { modelName: "gemini-2.5-flash-lite" },
62
- openai: { modelName: "gpt-4o" },
63
- transformers: {
64
- modelName: "onnx-community/gemma-3-1b-it-ONNX-GQA",
65
- device: "webgpu",
66
- dtype: "q4f16"
67
- }
68
- };
69
- export {
70
- a as D,
71
- r as P
72
- };