Skip to content

Readme for new Gemini Code Samples on Recipie to be updated to accept Image  #112

@AndrewVoirol

Description

@AndrewVoirol

Description of the bug:

The current example produces a base 64 response instead of the actual recipe of the item.

Actual vs expected behavior:

image

Any other information you'd like to share?

This code works correctly

import google.generativeai as genai
from PIL import Image

genai.configure(api_key="[API_KEY")

model = genai.GenerativeModel('gemini-pro-vision')
cookie_picture = Image.open('image.png')
prompt = "Give me a recipe for this:"

response = model.generate_content(
    contents=[prompt, cookie_picture]
)

print(response.text)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions