from google import genai
client = genai.Client()
response = client.models.generate_content(
model=“gemini-3-pro-preview”,
contents=“Explain how AI works in a few words”,
)
print(response.text)
from google import genai
client = genai.Client()
response = client.models.generate_content(
model=“gemini-3-pro-preview”,
contents=“Explain how AI works in a few words”,
)
print(response.text)
Hey,
Hope you’re keeping well.
The generate_content method in the Python SDK currently only handles text prompts in the format you’ve shown. If you want to work with images or structured data like tables, you need to pass them as additional parts in the contents array using genai.types.Content objects with the appropriate MIME type or data field. For example, you can include an image by specifying mime_type=”image/png” and passing raw bytes, and the model will process it alongside text. Check the Gemini API multimodal guide for exact syntax and supported input types.
Thanks and regards,
Taz
Hi @Sameh_abomalak
Welcome to Google AI Forum!!!
Could you please provide more details so we can better understand your issue? This will help us analyze the problem and offer a more accurate and helpful response.