From 5d8eed54d8bcdea78421d027edcbfb9bac6a8cb9 Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz-lightsnack-2007@users.noreply.github.com> Date: Thu, 8 May 2025 03:20:11 +0000 Subject: [PATCH] Add tests for 349a2bbbb6e42f41d4f774bcb0e2f2222aced136 --- scripts/main.js | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/scripts/main.js b/scripts/main.js index 6a39c92..db8a717 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -1,17 +1,39 @@ import Tests from './prompt.js'; +import { Buffer } from 'buffer'; + +// Importing modules for simulated data +import fs from 'fs'; + class main { constructor() { this.platform = new Tests(); - this.first(); + // this.first() + + this.testWithData() } - + first () { - let result = this.platform.generate("gemini-1.5-flash", "What is a TPU?"); - result.then((log) => { - console.log(log.text) - }) - } + let result = this.platform.generate("gemini-1.5-flash", "What is a TPU?"); + result.then((log) => { + console.log(log.text) + }) + }; + + testWithData () { + let results = []; + let files = [{ + inlineData: { + mimeType: 'text/csv', + data: Buffer.from(fs.readFileSync("data/test.csv")).toString("base64") + } + }]; + + let result = this.platform.analyzefile("gemini-1.5-flash", "Please summarize this document. Also, how many unique groups are there? ", files); + result.then((log) => { + console.log(log.text) + }) + }; } let runtime = new main(); \ No newline at end of file