Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
ag2ai avatar

Ag2 Multimodal Input

  • 34 installs
  • 8 repo stars
  • Updated July 27, 2026
  • ag2ai/ag2-skills

ag2-multimodal-input is a Claude Code skill that sends images, audio, video, or documents into an AG2 beta Agent alongside text.

About

This skill covers sending images, audio, video, or documents into an AG2 beta Agent alongside text using ImageInput, AudioInput, VideoInput, and DocumentInput. A developer uses it when they want an agent to describe a photo, transcribe audio, summarise a PDF, or analyse a video. It documents the per-provider support matrix, the four ways to source data, and provider-specific features like Gemini YouTube URLs and Anthropic attachment caching.

  • Send images, audio, video, or documents into an AG2 agent alongside text
  • Covers a per-provider support matrix across OpenAI, Gemini, and Anthropic
  • Documents four data sources: URL, path, bytes, and file_id

Ag2 Multimodal Input by the numbers

  • 34 all-time installs (skills.sh)
  • Ranked #8,855 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
At a glance

ag2-multimodal-input capabilities & compatibility

Free skill; requires an LLM provider API key that supports the input type.

Capabilities
multimodal input · image description · audio transcription · pdf parsing
Works with
openai · anthropic
Use cases
transcription · pdf parsing · image generation
Pricing
Bring your own API key
From the docs

What ag2-multimodal-input says it does

The user wants the agent to process non-text input: an image to describe, audio to transcribe, video to summarise, or a PDF / document to extract from.
SKILL.md
**Gemini has the broadest multimodal support.** If you don't know which provider to pick for a multimodal task, start there.
SKILL.md
npx skills add https://github.com/ag2ai/ag2-skills --skill ag2-multimodal-input

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs34
repo stars8
Last updatedJuly 27, 2026
Repositoryag2ai/ag2-skills

What it does

Pass images, audio, video, or PDFs into an AG2 beta agent so it can process non-text input.

Who is it for?

Developers who need an AG2 agent to describe images, transcribe audio, or summarise PDFs.

Skip if: Provider and input-type combinations outside the documented support matrix, which raise UnsupportedInputError.

When should I use this skill?

The user wants the agent to process non-text input like an image, audio, video, or a PDF.

What you get

The agent accepts images, audio, video, and documents from URL, path, bytes, or file_id across providers.

By the numbers

  • 4 input factories (Image, Audio, Video, Document)
  • 4 data sources per factory (URL / path / bytes / file_id)

Files

SKILL.mdMarkdownGitHub ↗

Multimodal inputs

When to use

The user wants the agent to process non-text input: an image to describe, audio to transcribe, video to summarise, or a PDF / document to extract from. The same factory pattern works across providers; per-provider support varies.

60-second recipe

from autogen.beta import Agent
from autogen.beta.config import GeminiConfig
from autogen.beta.events import ImageInput

agent = Agent(
    "vision",
    "You describe images.",
    config=GeminiConfig(model="gemini-3-flash-preview"),
)

image = ImageInput("https://example.com/photo.jpg")
reply = await agent.ask("Describe this image in detail.", image)
print(reply.body)

Multiple inputs in one ask are fine:

reply = await agent.ask(
    "Compare these two images.",
    ImageInput("https://example.com/before.jpg"),
    ImageInput("https://example.com/after.jpg"),
)

Input factories

FactoryFormats
ImageInput(...)JPEG, PNG, GIF, WebP
AudioInput(...)WAV, MP3, OGG, FLAC, AAC
VideoInput(...)MP4, WebM, MOV, MKV, MPEG
DocumentInput(...)PDF, TXT, HTML, Markdown, CSV, JSON, Office formats

Each accepts the same four data sources:

from autogen.beta.events import ImageInput

ImageInput("https://example.com/photo.jpg")     # URL
ImageInput(path="photo.jpg")                    # local file
ImageInput(data=raw_bytes, media_type="image/png")  # bytes
ImageInput(file_id="file-abc123")               # provider-uploaded

Provider matrix

Input typeOpenAIOpenAI ResponsesGeminiAnthropic
Text
Image (URL)
Image (binary)
Audio (URL)
Audio (binary)
Video (URL)
Video (binary)
Document (URL)
Document (binary)
File ID

Unsupported combinations raise UnsupportedInputError with a clear message.

Gemini has the broadest multimodal support. If you don't know which provider to pick for a multimodal task, start there.

Provider-specific niceties

Gemini — YouTube URLs work directly

from autogen.beta.events import VideoInput

video = VideoInput("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
reply = await agent.ask("Summarize this video.", video)

Gemini — large files (> 20MB) via Google Files API

from google import genai
from autogen.beta.events import VideoInput
import time

client = genai.Client()
uploaded = client.files.upload(file="large_video.mp4")
while uploaded.state.name == "PROCESSING":
    time.sleep(2)
    uploaded = client.files.get(name=uploaded.name)

video = VideoInput(uploaded.uri)

Gemini — vendor_metadata

KeyPurpose
media_resolutionMEDIA_RESOLUTION_LOW/MEDIUM/HIGH/ULTRA_HIGH — token vs cost
video_metadataClipping (start_offset, end_offset) and fps
display_nameDisplay name for the file
ImageInput(data=raw, media_type="image/jpeg", vendor_metadata={"media_resolution": "MEDIA_RESOLUTION_LOW"})

VideoInput(path="lecture.mp4", vendor_metadata={
    "video_metadata": {"start_offset": "60s", "end_offset": "120s", "fps": 0.5},
})

OpenAI — image detail

ImageInput(data=raw, media_type="image/png", vendor_metadata={"detail": "low"})  # "low" | "high" | "auto"

Anthropic — File ID + prompt caching

import anthropic
from autogen.beta.events import ImageInput, DocumentInput

client = anthropic.Anthropic()
uploaded = client.beta.files.upload(file=("photo.jpg", open("photo.jpg", "rb"), "image/jpeg"))

# filename determines block type (image vs document)
image = ImageInput(file_id=uploaded.id, filename="photo.jpg")

# Cache an attachment so subsequent turns skip re-uploading
doc = DocumentInput(path="report.pdf", vendor_metadata={"cache_control": {"type": "ephemeral"}})

FilesAPI — upload lifecycle, provider-agnostic

For any provider that has a file API (OpenAIConfig, OpenAIResponsesConfig, AnthropicConfig, GeminiConfig):

from autogen.beta import FilesAPI
from autogen.beta.config import OpenAIResponsesConfig

files = FilesAPI(OpenAIResponsesConfig(model="gpt-5-mini"))

uploaded = await files.upload(path="report.pdf", purpose="assistants")
print(uploaded.file_id)

# Or from bytes (filename required)
uploaded = await files.upload(data=b"...", filename="hello.txt", purpose="assistants")

# List, read, delete
all_files = await files.list()
data = await files.read(uploaded.file_id)        # NotImplementedError on Gemini
await files.delete(uploaded.file_id)

Pass the file_id to DocumentInput, ImageInput, etc.:

from autogen.beta.events import DocumentInput

doc = DocumentInput(file_id=uploaded.file_id)
reply = await agent.ask("Summarize this report.", doc)

Going deeper

  • website/docs/beta/inputs/inputs.mdx — full provider matrix and vendor_metadata reference.
  • website/docs/beta/advanced/files.mdxFilesAPI reference (upload / list / read / delete).
  • For tools that return images / binary back to the LLM, see ag2-add-custom-tool (ImageInput, BinaryInput, ToolResult).

Common pitfalls

  • Picking a provider that doesn't support your input type — silently you'll get UnsupportedInputError. Check the matrix; Gemini is broadest.
  • `FilesAPI.read()` on Gemini — raises NotImplementedError. Gemini doesn't expose download.
  • Calling `files.upload(data=...)` without `filename=` — raises ValueError. Filename is required for in-memory uploads.
  • Supplying more than one source to a factory — not an error. The factory resolves in priority order url > file_id > path > data, so extra sources are silently ignored. Pass exactly one to get what you intend. Supplying zero sources raises ValueError.
  • Anthropic `ImageInput(file_id=...)` without `filename=` — Anthropic decides block type (image vs document) by filename extension. Pass it.
  • Gemini `vendor_metadata` keys are nestedvideo_metadata itself takes a dict. Check the doc table for shape.
  • Forgetting to wait for Gemini file processing — large uploads have a PROCESSING state. Poll client.files.get(name=...) until ready before referencing the URI.

Related skills

FAQ

Which provider has the broadest multimodal support?

Gemini has the broadest multimodal support; start there if unsure.

What are the four ways to source input data?

URL, local path, raw bytes, or a provider-uploaded file_id.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.