Skip to content

Commit f928c1a

Browse files
author
Guiners
committed
fixing failed tests
1 parent 13fa4cb commit f928c1a

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

genai/image-generation/imggen-mmflash-edit-img-with-txt-img.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,26 @@ async function generateImage(
3434
location: location,
3535
});
3636

37-
const image = fs.readFileSync(FILE_NAME);
37+
const imageBytes = fs.readFileSync(FILE_NAME);
3838

3939
const response = await client.models.generateContent({
4040
model: 'gemini-2.5-flash-image',
41-
contents: [image, 'Edit this image to make it look like a cartoon'],
41+
contents: [
42+
{
43+
role: 'user',
44+
parts: [
45+
{
46+
inlineData: {
47+
mimeType: 'image/png',
48+
data: imageBytes.toString('base64'),
49+
},
50+
},
51+
{
52+
text: 'Edit this image to make it look like a cartoon',
53+
},
54+
],
55+
},
56+
],
4257
config: {
4358
responseModalities: [Modality.TEXT, Modality.IMAGE],
4459
},
1.2 MB
Loading

genai/test/imggen-mmflash-edit-img-with-txt-img.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe('imggen-mmflash-edit-img-with-txt-img', async () => {
2828
this.retries(4);
2929
await delay(this.test);
3030
const response = await sample.generateImage(projectId, location);
31+
console.log(response);
3132
assert(response);
3233
});
3334
});

0 commit comments

Comments
 (0)