Thursday, November 7, 2024

How to Build a WhatsApp Chatbot with ChatGPT In Termux

Build a WhatsApp OpenAI GPT-3 Bot with Node.js | A Step-by-Step Guide




Building a chatbot can be a fun and rewarding project, especially if you want to add automated functionality to your business or personal communications. In this guide, we will walk you through creating a chatbot for WhatsApp using the OpenAI language model behind ChatGPT. We are building a bot that automatically generates replies to WhatsApp messages.

This is the source code to build a WhatsApp bot using OpenAI bot and Node.js. The bot is able to understand natural language and provide information on various topics. It can be used to answer questions, provide advice, and even have conversations with users. With this source code, you can create a powerful robot that can be used for various purposes.

 WHAT is WhatsApp ChatBot??

A WhatsApp chatbot is an automated software that uses artificial intelligence or pre-programmed rules to engage your customers on the WhatsApp platform. Engati’s WhatsApp chatbots use AI and our proprietary Natural Language Processing (NLP) engine to interact with your customers intelligently.

Engati’s WhatsApp chatbots use AI and our proprietary Natural Language Processing (NLP) engine to interact with your customers intelligently. You can use them to answer customer questions about your products and services, share content, promote sales, and send notifications about orders, payments, shipping, etc.

WhatsApp business chatbots run on the WhatsApp Business API to intelligently communicate with your customers, employees, students, and other users without human intervention.

What Is OpenAI?

OpenAI came to life in 2015 in San Francisco as a joint initiative of Elon Musk, Sam Altman, Greg Brockman, Wojciech Zaremba, Ilya Sutskever, and John Schulman. The mission was simple but hugely ambitious – to develop secure and open AI tools to empower (rather than eradicate) humans.

What Is ChatBot?

ChatGPT is a powerful artificial intelligence bot developed by OpenAI. Its creators Altman, Musk, and other Silicon Valley investors created a non-profit organization engaged in artificial intelligence research in 2015 and presented it to the world on November 30, 2022. ChatGPT is a Chat Generative Pre-Trained Transformer. It is a powerful artificial intelligence robot capable of understanding human speech and producing in-depth writing that humans easily understand. ChatGPT’s use of a question-and-answer format makes it interesting.



REQUIREMENTS 
  • Termux App
  • Minimum Space Required = 200 MB 
  • Internet
  • Node js (npm)




How to download Termux

  • First Uninstall Old Termux and Install the New Upgrade Version
  • First, open the   F-DROID Website / App on your Android phone.
  • Search for the Termux app.
  • And install it on your Android phone by clicking the Download button
  • And it will download to your phone

STEPS OF CONNECTING CHAT BOT

After downloading termux app paste the following command on termux 

  • apt update -y && apt upgrade -y 
  • apt install git -y 
  • apt install nodejs -y
  • apt install nodejs-lts -y
  • apt install nano -y
  • git clone https://github.com/OnlineHacKing/Whatsapp-ChatGPT
  • cd Whatsapp-ChatGPT
  • npm install
  • nano api.json
To get an API key for the OpenAI API, you will need to register a free OpenAI account on the OpenAI website (https://openai.com/):



Then replace the text INSERT YOUR OPENAI API KEY in the api.json file with your personal API key.

Enit api.json file and add Openal API Key. and save this file. CURL +X and type Y and Enter

next command

  • node index.js
The output on the command line should then display the QR code correctly 








This QR code can then be used for verification via the WhatsApp mobile application. After scanning the QR code, you should see the following message:

How to scan QR in Whatsapp:

  • Open WhatsApp
  • Click 3 dot top right
  • Click the Linked Devices Button and again click the link a device button. or scanning the QR code
Now the Chatbot is running and showing a list of messages. Use the # sign and write the question as a WhatsApp message. The response is then generated by OpenAI and automatically accepted as a reply to the original message:



Waoo! It's done now the chatBot is running on your WhatsApp. And automatically reply via WhatsApp messages 







Prepared by WADUDUU GROUP
Written by DUDUU_MENDEZ 

No comments:

Post a Comment

HACKING KWA NJIA YA PHISHING (Part 01)

Phishing ni mojawapo ya vitisho vya kawaida na hatari zaidi vya usalama wa mtandao. Ni aina ya shambulio la mtandao ambapo wadukuzi wanadang...