WhatsApp GPT Chatbots' Library Python#
WhatsApp GPT Bot Library for Python is a modern library for creating a WhatsApp bot with state support and OpenAI GPT integration, built on whatsapp-chatbot-python and GREEN-API. To use the library, you need to get a registration token and instance ID in your console. For testing, we recommend using the free "Developer" plan.
API#
Documentation for the REST API is located at link. The library is a wrapper for the REST API, so the documentation at the link above is also applicable to the library itself.
Authorization#
To send a message or perform other GREEN-API methods, the WhatsApp account in the phone application must be in the authorized state. To authorize the instance, go to console and scan the QR code using the WhatsApp application.
Features#
- Integration with OpenAI GPT models for intelligent responses
- Support for various GPT models (GPT-3.5, GPT-4, GPT-4o, o1)
- Multimodal capabilities with image processing support
- Voice message transcription using Whisper API
- Comprehensive processing of various WhatsApp media message types
- Middleware architecture for customizing message and response processing
- Built-in conversation history management
- State system inherited from the core library
- Support for Python type hints and detailed docstrings
Installation and Quick Start#
Main Components#
Message Processing#
Middleware#
Session Data#
Utilities#
Supported OpenAI Models#
Advanced Configuration#
Bot Example#
WhatsApp demo GPT Chatbot Python 🔥#
Service Method Documentation#
License#
Licensed under the terms Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0) . LICENSE.