Skip to main content

Function

Tool identifier image_understand. image_understand uses the configured vision model to understand one or more images: describing the scene, reading the text in an image, or answering questions about it. Up to 8 images are accepted per call, from local paths or publicly accessible http(s) URLs. The tool is an async function (async def) and reuses the agent model’s API key, model name, and endpoint configuration. Import path: from veadk.tools.builtin_tools.image_understand import image_understand

Prerequisites

Requirement: configure the API key for the agent’s reasoning model; the selected model must support vision understanding.
Environment variables:
  • MODEL_AGENT_API_KEY: API key used for the vision request; falls back to model.api_key in the configuration file when unset
  • MODEL_VISION_NAME: optional vision model name; the agent model name is used when unset
  • The endpoint is taken from model.api_base in the configuration file
Model-name resolution order is the model_name argument, then the MODEL_VISION_NAME environment variable, then the agent model name.

Usage

examples/tools/image_understand/agent.py
Direct calls:

Parameters

Success returns {"text": ..., "model": ...}, where model is the model actually used. On failure it returns {"error": ...}.

Notes

  • Local images are capped at 20 MB per image and 40 MB in total; remote URLs pass an SSRF check before being forwarded to the model, so private and loopback addresses are blocked.
  • Remote URLs are fetched by the model service, so they must be publicly reachable from that service; download images requiring authentication or internal access locally and pass their paths instead.
  • When only verbatim text extraction is needed, ocr returns a more focused transcription.
Last modified on November 27, 2026