Skip to content

adding voice and pdf sending functionality to whatsapp#13555

Closed
notoriousmic wants to merge 1 commit into
NousResearch:mainfrom
notoriousmic:whatsapp-voice-files
Closed

adding voice and pdf sending functionality to whatsapp#13555
notoriousmic wants to merge 1 commit into
NousResearch:mainfrom
notoriousmic:whatsapp-voice-files

Conversation

@notoriousmic

Copy link
Copy Markdown

What does this PR do?

This pull request introduces support for additional media file types and improves how different media responses are delivered. The main changes are the expansion of recognized media file extensions and the addition of logic to handle video and audio file sending separately.

Related Issue

#9236
#4979

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

Media type support and delivery improvements:

  • Added .ogg and .pdf to the list of recognized local media file extensions in gateway/platforms/base.py to support more file types.

  • Enhanced the media delivery logic in gateway/run.py to:

    • Send videos using send_video for file extensions in _VIDEO_EXTS.
    • Send audio files using send_voice for file extensions in _AUDIO_EXTS.
    • Continue sending other files as documents if they do not match the above types.

How to Test

  1. Ask for voice message or pdf file on whatsapp

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • [] I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Mac OS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

@teknium1

Copy link
Copy Markdown
Contributor

Thanks Michael! Taking a different cut at this.

Kept: .pdf in MEDIA: tag extraction (shipped in #13683#13683).

Left out: .ogg in _LOCAL_MEDIA_EXTS and the audio/video routing in _deliver_media_from_response. Two reasons:

  1. _LOCAL_MEDIA_EXTS drives extract_local_files(), which auto-sends any bare path the agent mentions. That's fine for images/videos (agents rarely write those inline as status text) but risky for audio/PDFs — the model routinely mentions file paths as status ("I saved the report to /tmp/out.pdf") without intending to deliver them. Making MEDIA: the explicit opt-in keeps that boundary clean.

  2. The audio send_voice routing already landed on main in ed76185 (send_voice override) + the existing _AUDIO_EXTS branches in gateway/platforms/base.py and gateway/run.py for MEDIA:-tagged audio. The .ogg case your PR targeted flows through that path already when the agent uses MEDIA:.

So: agents wanting to deliver a PDF now emit MEDIA:/path/to/file.pdf and it goes through as a native attachment. Same for audio, which already worked via MEDIA: on main. Closing this one — PDF gap is fixed, and the other changes would open the bare-path surface wider than we want right now.

@teknium1 teknium1 closed this Apr 21, 2026
@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery platform/whatsapp WhatsApp Business adapter labels Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery platform/whatsapp WhatsApp Business adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants