TypeError: Could not create Blob, expected Blob, dict or an Image type(PIL.Image.Image or IPython.display.Image).
Got a: <class ‘NoneType’>
Value: None
text is a string
img is PIL. Image
when I use 1 of them for example just text or just photo its working, but both no!
What version of the google-generativeai module are you using?
I tested with the following code and it works for me:
import PIL.Image
import google.generativeai as genai
genai.configure(api_key="API_KEY")
img = PIL.Image.open(fp='PATH_TO_IMAGE')
model = genai.GenerativeModel(model_name='gemini-1.5-pro-latest')
response = model.generate_content(contents=["Transcribe text from this image", img], stream=True)
response.resolve()
print(response.candidates[0])