← Back to hub

Multimodal agents — text + image

Status CoveredUpdated 28 Jun 2026

In one line

Give the model eyes. Send images with your text and it can read, describe, compare, or reason over them.

Key idea

In 1.0 you send mixed input as a list of content blocks inside one message. A text block plus an image block. The image can come three ways:

Prefer URLs. base64 makes the message big and slow. Use it only when the file is not reachable by a link.

Send an image (URL)

from langchain.agents import create_agent
agent = create_agent(model="claude-sonnet-4-6", tools=[])

message = {
    "role": "user",
    "content": [
        {"type": "text", "text": "What is in this image?"},
        {"type": "image", "url": "https://example.com/photo.jpg"},
    ],
}
result = agent.invoke({"messages": [message]})
print(result["messages"][-1].content)

Send an image (base64)

{"type": "image", "base64": "AAAA....", "mime_type": "image/png"}

Reading the reply

The model also answers in content blocks. An image-making model returns an image block. Read them the same way for every provider:

for block in response.content_blocks:
    if block["type"] == "text":
        print(block["text"])
    elif block["type"] == "image":
        print(block.get("url") or block.get("base64"))

Good use cases

Watch out

Links

My notes

Add your own findings here as you learn.