Skip to main content
For a snapshot-style “look at this” interaction, capture the most recent frames with capture_frames() and pass them to session.reply() with a prompt. The frames and prompt go to the LLM together. This works in Cascade pipelines and is the simplest way to add vision.

Capture and send

capture_frames() never raises: it returns an empty list when vision is not active or no frames have arrived yet, so no exception handling is needed.

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:
You can also build ImageContent directly from PIL images, NumPy arrays, or av.VideoFrames for fully custom flows.

Encoding

Before frames reach the model they’re encoded with EncodeOptions: 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

Examples

Vision (Cascade)

Send images to a cascade agent.