Skip to main content
Bot platform adapters now ship in the praisonai-bot package. praisonai bot serve still works exactly as documented here; for a standalone install see praisonai-bot Migration.
Bot adapters forward inbound photos and documents to your agent’s vision capability — validated, size-capped, and SSRF-safe.
The user sends a photo or document in WhatsApp or Telegram; the bot validates the file and passes it to the agent vision model.

Quick Start

1

Simple — works with any vision model

No configuration needed. Point a vision-capable agent at your bot.
Send the bot a photo (with or without a caption). The agent sees the image and responds.
2

With size limit

Cap media size for public-facing bots to avoid processing large files.
3

Disable inbound media

Set max_inbound_media_bytes=0 for text-only agents.

How It Works


Platform Coverage

Telegram registers a PHOTO | Document.ALL handler — both photos and any document type (PDF, DOCX, etc.) flow through the same validation pipeline.

Media Albums

Coalesce a burst of updates sharing one media_group_id into a single multimodal turn — the agent sees the whole album at once instead of N separate turns. Opt in via BotConfig.metadata — disabled by default so existing deployments are unchanged.
Each inbound update flows through this decision path:

Behaviour


Configuration

Both album options live under BotConfig.metadata (there are no top-level BotConfig fields for them — resolve_album_window_ms / resolve_album_max_items read metadata first, then a direct attribute). Values that fail int() coercion silently fall back to the default. Set via BotConfig:
Or via YAML:

Common Patterns

Photo + question (most common)

The user sends a photo with a caption asking a question. The caption becomes the prompt; the image is the attachment.

Document analysis

Send a PDF or Word document. The agent reads the content via vision.

Oversized file rejected

Files above max_inbound_media_bytes are silently dropped. Only the caption text is forwarded.

Non-vision agent (backward compatible)

If agent.chat() does not accept attachments, the adapter skips the file gracefully.

Best Practices

The default 20 MiB is generous. For public-facing bots, set 2–5 MiB to reduce processing time and storage use.
If your agent doesn’t use vision, set max_inbound_media_bytes=0. Users still get a response — just from the caption text alone.
The SSRF guard logs rejections at WARNING level. If you see unexpected rejections in production, check that the platform’s media CDN URLs resolve to public IPs.
Set metadata["media_group_window_ms"] to 10001500 ms so a user sending “compare these 3 photos” reaches the agent as one multimodal turn instead of three. Leave media_group_max at 10 (a full Telegram album) unless you want to cap memory further.
Not all models support vision. Pass a vision-capable model to see image attachments.

WhatsApp Bot

WhatsApp setup, Cloud API, Web mode, and message filtering

Messaging Bots

All supported platforms: Telegram, Discord, Slack, WhatsApp

Platform-Aware Agents

Session context, channel directory, and BotSessionManager parameters

Bot Streaming Replies

Live streaming responses for Telegram, Slack, and Discord

Turn Completion Notes

Surface why a bot turn ended (max_steps, cancelled, error) as a user-safe note