GPT-4o Reminders WhatsApp bot

Test this app for free
12
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
Get full code

Created: | Last Updated:

This bot uses GPT-4o to give Whatsapp-based reminders to people just by chatting. In the encryption key environment secret, you need to get a 128 bit AES hex key from a website such as https://asecuritysite.com/encryption/plain

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

  1. Click "Start with this Template" to begin using the GPT-4o Reminders WhatsApp bot template in the Lazy Builder interface.

Initial Setup

  1. Navigate to the Environment Secrets tab in the Lazy Builder interface.

  2. Set up the following environment secrets:

  3. TWILIO_ACCOUNT_SID: Your Twilio Account SID
  4. TWILIO_AUTH_TOKEN: Your Twilio Auth Token
  5. ENCRYPTION_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

  1. Click the "Test" button in the Lazy Builder interface to deploy and run the application.

  2. Once deployed, you will receive a dedicated server link for your WhatsApp bot through the Lazy CLI.

Using the WhatsApp Bot

  1. Set up a Twilio WhatsApp Sandbox:
  2. Go to the Twilio Console
  3. Navigate to Messaging > Try it out > Send a WhatsApp message
  4. Follow the instructions to join your Sandbox

  5. Send a message to your Twilio WhatsApp number to start interacting with the bot.

  6. 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! 💫 ```

  1. You can now interact with the bot using natural language to set, view, and manage reminders. For example:
  2. To set a reminder: "Remind me to call John tomorrow at 2 PM"
  3. To view reminders: "Show me my reminders"
  4. To stop a reminder: "Stop reminding me about calling John"
  5. 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

  1. Enhanced Customer Engagement: This WhatsApp bot provides a convenient and familiar platform for users to set reminders, improving customer engagement and satisfaction.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Technologies

Streamline CSS Development with Lazy AI: Automate Styling, Optimize Workflows and More Streamline CSS Development with Lazy AI: Automate Styling, Optimize Workflows and More
Maximize OpenAI Potential with Lazy AI: Automate Integrations, Enhance Customer Support and More  Maximize OpenAI Potential with Lazy AI: Automate Integrations, Enhance Customer Support and More
Enhance HTML Development with Lazy AI: Automate Templates, Optimize Workflows and More Enhance HTML Development with Lazy AI: Automate Templates, Optimize Workflows and More

Similar templates

FastAPI endpoint for Text Classification using OpenAI GPT 4

This API will classify incoming text items into categories using the Open AI's GPT 4 model. If the model is unsure about the category of a text item, it will respond with an empty string. The categories are parameters that the API endpoint accepts. The GPT 4 model will classify the items on its own with a prompt like this: "Classify the following item {item} into one of these categories {categories}". There is no maximum number of categories a text item can belong to in the multiple categories classification. The API will use the llm_prompt ability to ask the LLM to classify the item and respond with the category. The API will take the LLM's response as is and will not handle situations where the model identifies multiple categories for a text item in the single category classification. If the model is unsure about the category of a text item in the multiple categories classification, it will respond with an empty string for that item. The API will use Python's concurrent.futures module to parallelize the classification of text items. The API will handle timeouts and exceptions by leaving the items unclassified. The API will parse the LLM's response for the multiple categories classification and match it to the list of categories provided in the API parameters. The API will convert the LLM's response and the categories to lowercase before matching them. The API will split the LLM's response on both ':' and ',' to remove the "Category" word from the response. The temperature of the GPT model is set to a minimal value to make the output more deterministic. The API will return all matching categories for a text item in the multiple categories classification. The API will strip any leading or trailing whitespace from the categories in the LLM's response before matching them to the list of categories provided in the API parameters. The API will accept lists as answers from the LLM. If the LLM responds with a string that's formatted like a list, the API will parse it and match it to the list of categories provided in the API parameters.

Icon 1 Icon 1
218

We found some blogs you might like...