Image Agent

Analyze an image URL with DashScope's qwen3-vl-plus and search the web for more context.

The qwen3-vl-plus model supports both image input and function calling, which this example uses for web search.

Code

from agno.agent import Agent
from agno.media import Image
from agno.models.dashscope import DashScope
from agno.tools.websearch import WebSearchTools

agent = Agent(
    model=DashScope(id="qwen3-vl-plus"),
    tools=[WebSearchTools()],
    markdown=True,
)

agent.print_response(
    "Analyze this image in detail and tell me what you see. Also search for more information about the subject.",
    images=[
        Image(
            url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg"
        )
    ],
    stream=True,
)

The default endpoint is Singapore (https://dashscope-intl.aliyuncs.com/compatible-mode/v1). Use a DASHSCOPE_API_KEY issued for that service region and a model available there. Keys and endpoints must match the service region, regardless of your physical location. For another region, pass its base_url to DashScope; see Model Studio API keys and regional endpoints.

Usage

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Set your API key

export DASHSCOPE_API_KEY=xxx

Install dependencies

uv pip install -U openai ddgs agno

Run Agent

Save the code above as image_agent.py, then run:

python image_agent.py