Skip to main content
Multimodal capabilities enable Agents to understand and generate images, audio, video, and other media content.

Core Features

  • Architecture Unified: ContentBlock system handles text, images, audio, and video uniformly
  • Flexible Sources: Support both Base64 encoding and URL media loading methods
  • Mixed Messages: Single message can contain multiple media types and text
  • Model Adaptation: Automatic conversion to different model API format requirements

Core Concepts

ContentBlock Architecture

AgentScope uses a unified ContentBlock system to handle all types of content:

Media Sources

Two media source methods are supported:
  • Base64 Encoding: Encode media files as strings (recommended, best compatibility)
  • URL Reference: Reference via HTTP/HTTPS URL or local file path

Quick Start

Step 1: Create Media Content Blocks

Supported MIME Types:
  • Images: image/png, image/jpeg, image/gif, image/webp
  • Audio: audio/mp3, audio/wav, audio/mpeg
  • Video: video/mp4, video/mpeg

Step 2: Build Multimodal Messages

Step 3: Configure Vision Agent

Key Configuration:
  • DashScope vision models require DashScopeChatFormatter
  • Base64-encoded images are recommended for best compatibility

Complete Example


Supported Models

DashScope (Alibaba Cloud)

OpenAI

Anthropic


More Resources