This mini-project allows you to quickly create and launch your own simple neural network chat bot in Telegram based on any model provided by GitHub Models.
- Create telegram bot via @BotFather and get bot token
- Clone this repo:
git clone https://github.com/S0lnyx/GitHub-Models-Telegram-Bot.git
- Go to repo directory:
cd GitHub-Models-Telegram-Bot
- Create python3 venv and install reuired modules (before make sure you installed python3-full package):
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -r requirements.txt
- Create config file:
sudo touch .env
sudo nano .env
- Write required parameters:
GITHUB_KEY = "Your_presonal_access_token_goes_here"
TOKEN = "Your_telegram_bot_token"
BOT_USERNAME = "@YourBotUsername"
MODEL_NAME = "Model_name_from_models_marketplace"
Your personal GitHub key that be used as API Key to authenticate in Azure module and get access to GitHub models service, you can generate it here: https://github.com/settings/tokens, no special permissions for the token needed.
Save .env file
- Customize bot responses for
/help
/start
and/test
To change bot responses on these commands, editconfig.ini
file
Help_command_response - Text of the message after /help command
Start_command_response - Text of the message after /start command
Test_command_promt - Prompt for model to check functionality (/test)
- Start the bot
python3 main.py
Done!