by balujan04
GPT-4o Reminders WhatsApp bot
from typing import List
from db_utils import get_db_connection
from encryption_utils import decrypt
from db_utils import check_first_communication, insert_first_communication, insert_reminder, retrieve_reminders, delete_reminder, retrieve_all_reminders, update_timezone, retrieve_timezone, set_next_reminder_time
from time import sleep
import threading
from encryption_utils import encrypt
from timezone_finder import convert_timezone
from abilities import llm_prompt
from datetime import datetime, timedelta
from nlp_processing import process_reminder_input, process_timezone, process_action
from abilities import key_value_storage
import logging
import calendar
import requests
import json
import os
from twilio.twiml.messaging_response import MessagingResponse
from twilio.rest import Client
from flask import Flask, render_template, request
from gunicorn.app.base import BaseApplication
import random
import sqlite3
Created: | Last Updated:
Here's a step-by-step guide for using the GPT-4o Reminders WhatsApp bot template:
Introduction
The GPT-4o Reminders WhatsApp bot is a powerful tool that allows users to set and manage reminders through WhatsApp using natural language processing. This bot leverages GPT-4o to understand user inputs and create personalized reminders.
Getting Started
- Click "Start with this Template" to begin using the GPT-4o Reminders WhatsApp bot template in the Lazy Builder interface.
Initial Setup
-
Navigate to the Environment Secrets tab in the Lazy Builder interface.
-
Set up the following environment secrets:
TWILIO_ACCOUNT_SID
: Your Twilio Account SIDTWILIO_AUTH_TOKEN
: Your Twilio Auth TokenENCRYPTION_KEY
: A 128-bit AES hex key for encryption
To obtain your Twilio credentials: - Sign up for a Twilio account at https://www.twilio.com/ - Once logged in, find your Account SID and Auth Token on the Twilio Console dashboard
To generate an encryption key: - Visit https://asecuritysite.com/encryption/plain - Use the generated 128-bit AES hex key
Test the Application
-
Click the "Test" button in the Lazy Builder interface to deploy and run the application.
-
Once deployed, you will receive a dedicated server link for your WhatsApp bot through the Lazy CLI.
Using the WhatsApp Bot
- Set up a Twilio WhatsApp Sandbox:
- Go to the Twilio Console
- Navigate to Messaging > Try it out > Send a WhatsApp message
-
Follow the instructions to join your Sandbox
-
Send a message to your Twilio WhatsApp number to start interacting with the bot.
-
The bot will respond with an introduction message explaining its capabilities: ``` Hi, I'm LazyReminders: a reminder bot for WhatsApp! 😎
You can set reminders just by talking to me (text and voice).
- Set Reminders: You can set recurring or one-time reminders. Example: 'my mom's birthday is this Friday'. I will remind you every year.
- View reminders: Say 'show me my reminders' to see what I'm talking about!
- Stop reminders: Try saying 'stop reminding me about my mom's birthday' and I will no longer remind you about your mom's birthday.
- Timezones: Get a custom timezone by saying your location (city and country). No pressure though! I respond in GMT by default.
Go to getlazy.ai to build cool stuff like me! 💫 ```
- You can now interact with the bot using natural language to set, view, and manage reminders. For example:
- To set a reminder: "Remind me to call John tomorrow at 2 PM"
- To view reminders: "Show me my reminders"
- To stop a reminder: "Stop reminding me about calling John"
- To set your timezone: "I'm in New York, USA"
The bot will process your requests using GPT-4o and respond accordingly, setting up reminders in the database and sending them at the specified times.
By following these steps, you'll have a fully functional GPT-4o Reminders WhatsApp bot ready to help users manage their reminders through natural language interactions.
Here are the top 5 business benefits or applications of this GPT-4o Reminders WhatsApp bot template:
Template Benefits
-
Enhanced Customer Engagement: This WhatsApp bot provides a convenient and familiar platform for users to set reminders, improving customer engagement and satisfaction.
-
Increased Productivity: By automating the reminder process, businesses can help their clients or employees stay on top of important tasks and deadlines, boosting overall productivity.
-
Scalable Customer Service: The bot can handle multiple users simultaneously, providing 24/7 reminder services without the need for human intervention, thus scaling customer service capabilities.
-
Personalized User Experience: Leveraging GPT-4o's natural language processing capabilities, the bot can understand and respond to user requests in a more human-like manner, creating a personalized experience.
-
Data-Driven Insights: By analyzing the types of reminders set and user interactions, businesses can gain valuable insights into customer behavior and preferences, informing future product or service improvements.