Chapter 12 · the model can see now
Message content is a list:
[ text part, image part ]
Reasoned over in one pass. Everything you know about prompting still applies — now over pixels.
client.responses.create(model="gpt-5.4-nano", input=[{
"role": "user",
"content": [
{"type": "input_text", "text": question},
{"type": "input_image", "image_url": url},
],
}])
OpenAI fetches the URL for you.
img = urllib.request.urlopen(url).read()
client.models.generate_content(
model="gemini-3.1-flash-lite",
contents=[
types.Part.from_bytes(data=img, mime_type="image/jpeg"),
question,
])Same multimodal message; instruction + output handling change.
Multimodal input = the same models with a richer message. Prompting, structured output, grounding all still apply, over pixels. Next: the model stops reading images and starts making them.