From ca03f5c5a4779972a4278832f321b747d3a6d607 Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Thu, 8 May 2025 03:19:46 +0000 Subject: [PATCH] Add file analysis --- scripts/prompt.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/prompt.js b/scripts/prompt.js index 38ef5b7..3a38eeb 100644 --- a/scripts/prompt.js +++ b/scripts/prompt.js @@ -5,7 +5,7 @@ class Tests { #toolkit; constructor () { - this.#key = process.env.GoogleGenAIKey + this.#key = process.env.GoogleGenAIKey; this.#toolkit = new GoogleGenAI({ apiKey: this.#key }); } @@ -15,6 +15,19 @@ class Tests { "contents": contents }); + return response; + }; + + async analyzefile (model, message, files) { + const contents = [ + { text: message }, ...files + ]; + + const response = await this.#toolkit.models.generateContent({ + model: model, + contents: contents + }); + return response; } }