Want to build your own agentic meme generator? Here's how to get started:
-
Clone the repository:
git clone https://github.com/awsdataarchitect/agentic-meme-generator cd agentic-meme-generator
-
Install dependencies:
pip install -r requirements.txt
-
Set up Twilio for WhatsApp messaging:
- Sign up for a free Twilio account at https://www.twilio.com/try-twilio
- Navigate to the Twilio Console and note down your Account SID and Auth Token
- Enable the WhatsApp Sandbox in the Messaging section
- Follow the instructions to connect your WhatsApp number to the sandbox by sending the provided code
- Note: The sandbox allows you to send 9 free messages every 24 hours for testing
-
Configure your environment variables:
export TWILIO_ACCOUNT_SID=your_account_sid export TWILIO_AUTH_TOKEN=your_auth_token export BEDROCK_WHATSAPP_TO=your_whatsapp_number # Format: whatsapp:+1234567890
You can test your Twilio setup with this simple Python script:
from twilio.rest import Client client = Client("your_account_sid", "your_auth_token") message = client.messages.create( body="Test message from Twilio", from_="whatsapp:+14155238886", # Twilio's sandbox number to="whatsapp:+1234567890" # Your WhatsApp number ) print(f"Message sent with SID: {message.sid}")
-
Deploy with CDK:
cd agentic-meme-generator npm install npm run build cdk deploy
-
Trigger a meme generation manually on ad-hoc basis (if needed for testing):
# Simpler approach using cli-binary-format aws lambda invoke \ --region us-east-1 \ --function-name AgenticMemeGenerator \ --payload '{"body": "{\"theme\": \"standard\"}"}' \ --cli-binary-format raw-in-base64-out \ /tmp/lambda-output.json