Skip to content

heptaber/AI-Telegram-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI Telegram Bots

Implementations using different OpenAI models: davinci, Dall-E, gpt-3.5-turbo.

Set Up

Set the environment variables OPENAI_API_KEY and TG_TOKEN.
Also there is a restriction for the user, so for any of these implementations USER1_TG_ID should be also added as an environment variable.

Add these variables and your values into ~/.profile file:

export OPENAI_API_KEY=YOUR_PERSONAL_API_KEY_INSTEAD_OF_THIS
export TG_TOKEN=YOUR_PERSONAL_TELEGRAM_BOT_TOKEN
export USER1_TG_ID=YOUR_TELEGRAM_USER_ID

Install dependencies

pip3 install -r requirements.txt

To run in background

python3 davinci.py &

To kill process

kill -9 $(ps aux | grep 'danvinci.py' | awk '{print $2}')

To run after reboot

Copy file to bin folder:

sudo cp -i /path_to/davinci.py /bin/davinci.py

Open crontab editor

sudo crontab -e

Add:

@reboot python3 davinci.py &

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages