Skip to content

mAhsanZafar/Whatsapp_Chatbot_using_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Whatsapp_Chatbot_using_API

A WhatsApp chatbot that uses ThingESP for messaging and Google Gemini for AI responses.

Features

  • Receives WhatsApp queries via ThingESP
  • Generates AI responses using Gemini
  • Replies automatically through MQTT

Requirements

  • Python 3.8+
  • ThingESP account credentials
  • Google Gemini API key

Installation

pip install google-genai paho-mqtt

Configuration

Edit these values inside WhatsChatbot.py:

client = genai.Client(api_key="YOUR_GEMINI_API_KEY")
thing = Client('YOUR_USERNAME', 'YOUR_PROJECT_NAME', 'YOUR_PASSWORD')

Usage

Run the script:

python WhatsChatbot.py

Your bot will listen for incoming messages and respond automatically.

Notes

  • Keep your API keys secret.
  • You can customize handleResponse() to modify how replies are generated.

License

MIT (or your preferred license)

About

A WhatsApp chatbot powered by Google Gemini AI and ThingESP MQTT — sends and receives messages automatically via WhatsApp.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages