Add file analysis

This commit is contained in:
buzzcode2007 2025-05-08 03:19:46 +00:00
parent 349a2bbbb6
commit ca03f5c5a4

View file

@ -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;
}
}