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:
- A registered account on GREEN-API
- An instance ID and API token from your GREEN-API account
- 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()