بنقرة واحدة
media
Handle images, audio, and document files for messaging channels
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Handle images, audio, and document files for messaging channels
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
store and retrieve long-term memories (facts, preferences, context)
Create and manage agents with isolated sessions and routing
Core behavior guidelines for agent interactions
Automate web browsing, scraping, and form interaction
Create and manage persistent interactive workspaces
Schedule jobs to run at specific times or intervals
| name | media |
| description | Handle images, audio, and document files for messaging channels |
| trigger | on-demand |
Process and send media files (images, audio, documents) through messaging channels like WhatsApp.
| Regra | Motivo |
|---|---|
SEMPRE use send_media para enviar arquivos | Criar arquivo ≠ enviar |
Use type para forçar tipo (image/audio/document) | Auto-detecta se omitido |
Use caption para contexto | Ajuda usuário entender o arquivo |
| Verifique se arquivo existe antes de enviar | Evita erros |
Usuário: "Me envia o PDF"
Agente: bash(command="ls /tmp/arquivo.pdf") ❌
Agente: "O PDF está em /tmp/arquivo.pdf" ❌ (não enviou!)
Usuário: "Me envia o PDF"
Agente: send_media( ✓
file_path="/tmp/arquivo.pdf",
type="document",
caption="Lista de compras"
)
Agente: "Enviado!" ✓
┌─────────────────────────────────────────────────────────────┐
│ Agent Context │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────┴──────────────────┐
│ │
▼ ▼
┌───────────────┐ ┌───────────────┐
│ INPUT MEDIA │ │ OUTPUT MEDIA │
├───────────────┤ ├───────────────┤
│describe_image │ │ send_media │
│transcribe_audio │ (unified tool)│
└───────┬───────┘ └───────┬───────┘
│ │
▼ ▼
┌───────────────┐ ┌───────────────┐
│ AI Analysis │ │ Messaging │
│ (Vision/STT) │ │ Channel │
└───────────────┘ └───────────────┘
| Tool | Action | Use When |
|---|---|---|
describe_image | Analyze image with AI vision | User sends image |
transcribe_audio | Convert audio to text | User sends voice message |
send_media | SEND any media to user | User needs file (image, audio, document) |
Images sent by the user are automatically analyzed by the media enrichment pipeline.
The describe_image tool accepts image_base64 (base64-encoded data), not file paths:
describe_image(image_base64="<base64 data>", prompt="What is in this image?")
# Output:
# The image shows a green fern plant in a white ceramic pot.
# The plant appears healthy with several fronds.
Audio messages are automatically transcribed by the media enrichment pipeline.
The transcribe_audio tool accepts audio_base64 (base64-encoded data):
transcribe_audio(audio_base64="<base64 data>", filename="voice.ogg")
# Output:
# "Olá, gostaria de saber sobre a entrega."
Quando usuário pedir para enviar arquivo, USE send_media:
send_media(
file_path="/tmp/report.pdf",
type="document",
caption="Relatório Mensal - Fevereiro 2026"
)
# Output: Document sent successfully
send_media(
file_path="/tmp/chart.png",
type="image",
caption="Gráfico de vendas do mês"
)
# Output: Image sent successfully
send_media(
file_path="/tmp/response.mp3",
type="audio",
caption="Resposta em áudio"
)
# Output: Audio sent successfully
send_media(
file_path="/tmp/photo.jpg",
caption="Foto da entrega"
)
# type auto-detected as "image" from MIME type
| Type | Formats | Max Size |
|---|---|---|
| Images | PNG, JPG, JPEG, GIF, WEBP | 5MB |
| Audio | MP3, OGG, WAV, M4A | 16MB |
| Documents | PDF, DOC, DOCX, XLS, XLSX | 100MB |
# 1. Gerar PDF
bash(command="python3 scripts/create_pdf.py --output /tmp/lista.pdf")
# 2. Verificar se criou
bash(command="ls -lh /tmp/lista.pdf")
# 3. ENVIAR (CRÍTICO!)
send_media(
file_path="/tmp/lista.pdf",
type="document",
caption="Lista de Compras"
)
# 4. Confirmar
send_message("PDF enviado!")
# 1. Gerar visualização
bash(command="python scripts/generate_chart.py --output /tmp/sales.png")
# 2. ENVIAR
send_media(
file_path="/tmp/sales.png",
type="image",
caption="Vendas por categoria - Últimos 30 dias"
)
# User sends photo → automatically enriched by pipeline
# The image description is added to the message context
# Agent sees the description and responds:
send_message("Essa é uma Samambaia! Ela gosta de luz indireta e rega quando o topo da terra estiver seco.")
# User sends voice message → automatically transcribed by pipeline
# The transcription is added to the message context
# Agent sees the transcription and responds:
send_message("Entendi! Vou verificar isso para você.")
# Usuário: "Gera um PDF dessa lista e me envia"
# PASSO 1: Criar o PDF
bash(command="python3 << 'PYEOF'
from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.set_font('Arial', 'B', 16)
pdf.cell(0, 10, 'Lista de Compras', 0, 1, 'C')
pdf.set_font('Arial', '', 12)
items = ['Papel higiênico', 'Peito de frango', 'Ovos', 'Tomates', 'Coentro']
for item in items:
pdf.cell(0, 10, f'• {item}', 0, 1)
pdf.output('/tmp/lista.pdf')
PYEOF")
# PASSO 2: Verificar criação (opcional)
bash(command="ls -lh /tmp/lista.pdf")
# Output: -rw-r--r-- 1 user user 1.7K Feb 24 14:36 /tmp/lista.pdf
# PASSO 3: ENVIAR (CRÍTICO!)
send_media(
file_path="/tmp/lista.pdf",
type="document",
caption="Lista de Compras"
)
# Output: Document sent successfully
# PASSO 4: Confirmar
send_message("PDF enviado! 📄")
Causa: Arquivo não existe no caminho especificado.
Debug:
# Verificar se arquivo existe
bash(command="ls -la /tmp/arquivo.pdf")
Causa: Não usou send_media.
Solução:
# ❌ Errado - apenas verifica
bash(command="ls /tmp/arquivo.pdf")
# ✓ Correto - envia
send_media(file_path="/tmp/arquivo.pdf", type="document", caption="...")
Causa: Formato não suportado pelo canal.
Solução:
# Converter formato
bash(command="ffmpeg -i input.wav output.mp3")
send_media(file_path="/tmp/output.mp3", type="audio")
Causa: Excede limite do canal.
Solução:
# Comprimir
bash(command="gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -o small.pdf large.pdf")
send_media(file_path="/tmp/small.pdf", type="document", caption="...")
| Erro | Correção |
|---|---|
| Apenas criar arquivo, não enviar | Usar send_media |
| Sem caption | Adicionar descrição no caption |
| Caminho errado | Verificar com ls antes |
| Formato não suportado | Converter para formato aceito |
| Arquivo muito grande | Comprimir antes de enviar |