|
|
|
|
|
by brrrrrm
921 days ago
|
|
why on earth did they design the Node.js and Web APIs to be slightly different and incompatible? (edit: this might just be a bug/oversight on the landing page?) Node.js: const model = genAI.getGenerativeModel({ model: "gemini-pro-vision"});
const result = model.generateContent({ contents: [{parts: [
{text: "What’s in this photo?"},
{inlineData: {data: imgBase64, mimeType: 'image/png'}}
] }] })
Web: const model = genAI.getGenerativeModel({ model: "gemini-pro-vision"});
const result = await model.generateContent([
"What’s in this photo?",
{inlineData: {data: imgDataInBase64, mimeType: 'image/png'}}
]);
|
|