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: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
Examples
Vision (Cascade)
Send images to a cascade agent.