Skip to content

ChatGPT/Gemini AI for WhatsApp using Google's Gemini API/OAI API and whatsapp-web.js, written in JS using Node.js

Notifications You must be signed in to change notification settings

iamkhalid2/WhatsAppGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsAppGPT

About The Project

ChatGPT/Gemini AI for WhatsApp using Google's Gemini API/OAI API and whatsapp-web.js, written in JS using Node.js

NOTE: I can't guarantee you will not be blocked by using this method, although it has worked for me. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.

Prerequisites

  • npm
npm install npm@latest -g

Installation

  1. Clone this Repo:

    git clone https://github.com/iamkhalid2/WhatsAppGPT.git
  2. Install Dependencies:

    npm install
  3. Create a ".env" file

  4. Open file .env in a text editor and insert the following environment variable with your Gemini API key:

    OPENAI_API_KEY="INSERT YOUR OPENAI API KEY HERE"
    GEMINI_API_KEY="INSERT YOUR GEMINI API KEY HERE"
  5. Run the program:

    npm start
  6. Scan the QR code that appears in the terminal with WhatsApp to link your account.

  7. The chatbot is now running and listening for messages. Send a message starting with # followed by your question in WhatsApp. The response will be generated by Gemini AI and sent as a reply to your message.

Features

  • Uses Google's Gemini AI 2.0 Flash Thinking model
  • Maintains conversation history for context (last 10 conversations)
  • Quick response time with real-time message processing

ENJOY!

About

ChatGPT/Gemini AI for WhatsApp using Google's Gemini API/OAI API and whatsapp-web.js, written in JS using Node.js

Topics

Resources

Stars

Watchers

Forks