agent_with_media.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export environment variables
4
Expose the server
Start ngrok for port 7777 and copy its public HTTPS URL. Keep ngrok running:
5
Start AgentOS
Save the code above as Keep the server running while you configure and verify the webhook.
agent_with_media.py, then run:6
Configure the webhook
Follow WhatsApp setup. In Meta, set the callback URL to
https://<your-ngrok-url>/whatsapp/webhook, use the same verify token as WHATSAPP_VERIFY_TOKEN, and subscribe to the messages field. Verify the webhook while AgentOS and ngrok are running.