Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.29 KB

README.md

File metadata and controls

29 lines (22 loc) · 1.29 KB

GPT Telegram BOT

Simple Telegram bot connected to GPT

Requirements:

Install dependencies:

(Virtualenvs are highly recommended)

$ pip install -r requirements.txt

GPT

export TG_BOT_GPT_TOKEN=<your_OPEN_AI_API_key>
  • File resources/example_config.json should be renamed to resources/config.json, and modified with the desired GPT engine configuration. In this file you can also modify the dialog lines (for greeting or other notifications that do not depend on GPT) and also, in this file, you can find the list of users that have access to this platform (allowed_users). If the user's identifier is not known, just start a conversation and a message with the id: User 'XXXXX' not allowed! will be automatically sent back to the user.
  • File resources/example_prompt.text should be renamed to resources/prompt.text, and modified with the initial prompt of the conversation.

Run

$ python gpt_telegram_bot.py

Telegram commands:

  • /start: For starting a conversation.
  • /cancel: For finalizing a conversation.