session.reply() takes a frames count and the runtime shows the model that many of the
newest camera frames alongside your prompt. The count travels, not the pixels. This works in
Cascade pipelines and is the simplest way to add vision.
Capture and send
frames is a count, not a list of images — at most Session.MAX_FRAMES (5). A negative
count or one above the maximum raises ValueError. Capturing needs Room(vision=True);
without it there is no video track to capture from.
Trigger a capture
A common pattern is to capture when the client sends a pub/sub message, for example, a “capture” button in your app:ImageContent directly from PIL images, NumPy arrays, or av.VideoFrames
for fully custom flows.
Encoding
Before frames reach the model they’re encoded withEncodeOptions: JPEG by default, resized (default 1024×1024) and compressed (quality=75). Raise these when you need higher fidelity
(for example, to read fine text on camera) at the cost of more tokens and latency.
References
- Python
- Node JS
Examples
Vision (Cascade)
Send images to a cascade agent.