Added image inputs; Version 1.0.0

This commit is contained in:
Aslan 2025-12-29 13:49:12 +01:00
parent a5d6163ef9
commit a8e1a83e63
5 changed files with 54 additions and 9 deletions

View file

@ -20,15 +20,31 @@ const getTextGemini = async (
instructions: IAIInstructions,
input: string,
oldInput?: string,
inputImage?: Buffer<ArrayBuffer>,
): Promise<AIResponseText> => {
const inputContent: Content = {
role: "user",
parts: [
{
text: input,
},
],
};
const inputContent: Content = inputImage
? {
role: "user",
parts: [
{
text: input,
},
{
inlineData: {
mimeType: "image/png",
data: Buffer.from(inputImage).toString("base64"),
},
},
],
}
: {
role: "user",
parts: [
{
text: input,
},
],
};
const oldInputContent: Content = {
role: "user",
parts: [