Skip to content

Build

Photo input

Read fields, describe an image, check visible details or choose an action from a photo.

Choose a model that accepts photos

Choose a model marked Photos in the dashboard. The same agent keeps its instructions, Context and Knowledge; each operation can receive text, photos or both. A text-only model refuses an image request before generation.

Pass photos with the operation

photo.py
from nullprotocol import NullProtocol

with NullProtocol() as client:
    agent = client.load("photo-reader")
    result = agent.extract(
        "Identify the landmark in the photo.",
        {"landmark": "string"},
        images=["https://images.unsplash.com/photo-1502602898657-3e91760cbb34?w=800&q=80"],
    )
    if not result.success:
        raise RuntimeError(result.error)
    print(result.data, result.usage)

Create photo-reader in the dashboard first, or replace it with your own agent ID. All four operations accept images. Use an empty string for data, content, subject or context when the photo is the entire input; validate still needs criteria and decide still needs its allowed actions.

Over HTTP, put images in the same JSON body as operation and its input. The OpenAPI specification describes the common field. Try agent accepts the same photo URLs and Connect carries them into JavaScript, Python and HTTP examples.

Combine a photo with your rules

Python
result = agent.validate(
    "Check whether the visible packaging meets the supplied policy.",
    "Inspect this delivery photo.",
    images=["https://your-storage.example/delivery.jpg"],
    knowledge={"query": "Packaging requirements and damage exceptions"},
)

This fragment assumes your agent has prepared Knowledge sources and uses your own photo URL. Search uses task text or an explicit query, not image content or the URL. Give an explicit query for a photo-only task. Photos are not automatically added to Knowledge or memory.

Inspect results and usage

History records the photo URLs alongside the task input and result. It does not copy the remote image bytes: changed or expired links can no longer show the original photo. Keep links valid for as long as your application needs them.

Choose a suitable model and test on your actual photos. A valid JSON response does not prove the image was interpreted correctly. Search embedding usage remains separate from generation usage.