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