39 lines
No EOL
923 B
JavaScript
39 lines
No EOL
923 B
JavaScript
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.testWithData()
|
|
}
|
|
|
|
first () {
|
|
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(); |