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.

Configuration

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.
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