Building a WhatsApp Chatbot with Python, Twilio, and EC2: Introducing ChatGPT WhatsApp Bot

preview_player
Показать описание
Hello, Guys, I am Spidy. I am back with another video.

In this video, I am showing you how you can build a ChatGPT WhatsApp chatbot using Python, Twilio, and AWS EC2.

## We have used:
- Ngrok and Flask as a server.
- Twilio as a WhatsApp agent.
- ChatGPT API for generating responses.
- Flask App as API for Request/Response model.
- AWS EC2 for deployment (24/7 running).

----------------- Commands -----------------
# Run Chatbot permanent
[Close Terminal, the app will run as a service for permanent]

# Stop Chatbot
ps -ef (Get process ID from here)
kill [id]

🔥 Don't forget to Subscribe

Playlist that you should check👇

"The video thumbnails were created using publicly available images from Google images and are used solely for thumbnail purposes. I do not claim ownership of these images. If you are the owner of any copyrighted content used in these thumbnails and want them removed or changed, please contact me and I will comply promptly. Thank you."

#chatgpt
#awsec2
#awstutorial
Рекомендации по теме
Комментарии
Автор

This is just so cool man. Your channel is gold.

androidoptimusprime
Автор

Great tutorial, thank you alot. You explain eveyrhting .

DJPapzin
Автор

I kind of did this with just python and whatsapp api and facing a problem.
Each time I change the access token On sending a message I get the error - Recipient not allowed in the list for which gets resolved on the recipient_waid variable name and running again. Can you something as why it might be happening?

PoorviAgrawal-ch
Автор

Great video, thanks!! This sandbox is for test right? What if I want to build this bot for a commercial scale using my company’s number? I watched many tutorials but didn’t get this part yet

kaiopeixoto
Автор

This is such an amazing video, thank you so much for making this! However, I have a few questions, how do I store the chat history so the users can reply in context of the previous message? Do I need to create a metadata to feed into the LLM? Also, could you give more insights on how to replace ngrok with ec2 itself? Or if you have already made a video, it would be great to drop the link here. Once again, thank you so much for this video!

zarxion
Автор

Thank you, Bro! Wonderful video. I am successfully able to run my custom-built Whatsapp bot with this approach in EC3. I have a couple of questions,
1. Is there any alternate way other than running with ngrok? Because if ngrok process stops for any reason, then I need to re-run it, copy the new URL and put it on the Twilio Sandbox. Since ngrok addresses chances every time, I am worried. It would be better to use a constant url in Twilio
2. I am planning to give my WhatsApp bot to 100 users next week. Will EC2 free tire be able to handle requests of 100 people? Or do I need to upgrade to a higher instance?

TheAstroengineer
Автор

Hi, in the video timeline from minute 9:05 to 9:20, it looks like you put the "CMOD" and "SSH Key" to your cloud shell/terminal. Did you put that to your local computer terminal or to the EC2 Cloud shell? I could not add/put those files to the EC2 cloud shell. I don't know why, Please and appreciate your help. Thank you so much for the great video.

TheMilleTV
Автор

i have a question if multiple requests will come then there is a chance of getting response of a request made by another person to multiply users?

DoNGaminG-
Автор

Interesting but you don't need to use Ngrok right ? You could have used the EC2 public address no ?

vinception
Автор

We don't get to have the OPENAI_API_KEY set to the ENV we're hardcoding it. And I don't get to see the endpoints in NGrok. Also given I cannot get to keep permanently the API KEY stored, we cannot use the Public IP address instead of NGROK. Thanks ! Great Video!

NooStrategy
Автор

Hi, Is there any way to keep updating tunnel url in twilio sandbox? means can we automate it in python as the ngrok forwarding tunnel url expires in 12 hrs and updated with a new one. Thanks and Great very informative and well described videos.

fajr.abbasi
Автор

does this chatbot includes its own database or do we have to add it later?

francescofavaro
Автор

Hi, I’m confused why we need ngrok, can’t we pass ec2 ip directly to twilio?

akshaysoni
Автор

hey friend, love your content. one question, can i make a custom ChatGPT WhatsApp chatbot deploy on WhatsAp? like, trains the chat to awenser my questions about a specific subject?

stephanreichmannvideos
Автор

Thanks for your video. Can you explain why you need a ngrok here? I can use the ip address directly, right?

candyman
Автор

I've written the code in Google colab. Do I need to follow the same steps ?

wmmneqi
Автор

Hi.. I get response on ubuntu but on whatsapp I am not getting any response... like when I type hi.. it says hello on ubuntu (putty), but on whatsapp I get no reply...
Please help

krishnamohangupta
Автор

Thanks. It's perfectly working. How do you update the mobile number with "Chatgpt chatbot" name?

NaazimHussain
Автор

hi sir,
i followed the same steps as shown in video but my bot is not giving any responses for "hi" message and as well the terminal at flask app also not showing my "hi" message .
please help

tmnarayana
Автор

is everything free of cost or we need to pay to create accounts ?

MANANAGGARWALMIC