A gray kitten is sitting on a tree stump and looking up at something off-camera. The background is green foliage.
How this output was generated?
const MODEL_NAME = "gemini-1.0-pro-vision-latest";
const generationConfig = {
temperature: 0.4,
topK: 32,
topP: 1,
maxOutputTokens: 100,
};
const safetySettings = [
{
category: HarmCategory.HARM_CATEGORY_HARASSMENT,
threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
},
{
category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
},
{
category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
},
{
category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
threshold: HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,
},
];
const parts = [
{
// There's a lot to improve
text: "Generate an image description for the HTML img tag's alt attribute. The alt should be in English.\n",
},
{
inlineData: {
mimeType: "image/jpeg",
data: "BASE64 IMAGE STRING",
},
},
];