Skip to content

Installation and quick start#

Installation#

pip install whatsapp-chatgpt-python

Dependencies (openai, whatsapp-chatbot-python and requests) will be installed automatically.

Prerequisites#

Before using the bot, you will need:

  1. A registered account on GREEN-API
  2. An instance ID and API token from your GREEN-API account
  3. An OpenAI API key to access GPT

Quick Start#

from whatsapp_chatgpt_python import WhatsappGptBot

# Initialize the bot
bot = WhatsappGptBot(
id_instance="your-instance-id",
api_token_instance="your-api-token",
openai_api_key="your-openai-api-key",
model="gpt-4o",
system_message="You are a useful assistant."
)

# Run the bot
bot.run_forever()