Telegram Bot that is using AI GPT-4 version from the OpenAI company.
In order to use it - you will 2 things:
- Create Telegram Bot within telegram infa. The BotFather from Telegram will help you with that.
- Get GPT-4 API token from OpenAI. Details here.
This project is using python-poetry as a PYTHON PACKAGING AND DEPENDENCY MANAGEMENT.
- Python >= 3.11 version
- Poetry >= 1.4.0 version
- Checkout && cd to the project's folder
- Install dependencies
poetry install
- Export env variables
export TELEGRAM_TOKEN=token && export OPENAI_TOKEN=token
- Run
poetry run python gpt4_telegram_bot/gpt4_telegram_bot.py
- Set the tokens inside
docker-compose.yaml
- Run docker-compose
docker-compose up
The current features of the bot:
- Pass the complete text chat to the OpenAI's GPT-4 and forwarding reply to it
- Reset the chat history with
/restart
command
Currenty supported commands:
/restart
- reset the chat history for GPT-4