From 0ae1a831f819b7c3db2560919ddd2de8f10e0c96 Mon Sep 17 00:00:00 2001 From: "H. Saw" <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Thu, 11 Apr 2024 06:36:25 +0000 Subject: [PATCH] create product analyzer function --- scripts/product.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/product.js diff --git a/scripts/product.js b/scripts/product.js new file mode 100644 index 0000000..7d8b295 --- /dev/null +++ b/scripts/product.js @@ -0,0 +1,27 @@ +/* ask.js +Ask product information to Google Gemini. */ + +// Import the storage management module. +const secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js")); + +// Don't forget to set the class as export default. +class product { + /* Initialize a new product with its details. + + @param {object} details the product details + */ + constructor (details) { + }; + + /* Get the product information. + + @param {object} options the options + @returns {object} the analysis + */ + analyze(options) { + const gemini = (await import('./AI/gemini.js')).default; + let analyzer = new gemini ((typeof(options).includes(`obj`) && !Array.isArray(options) && options != null) ? options[`API Key`] : await secretariat.read([`settings`,`analysis`,`api`,`key`], 1), `gemini-pro`); + + + } +};