Implementations using different OpenAI models: davinci, Dall-E, gpt-3.5-turbo.
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_IDpip3 install -r requirements.txtpython3 davinci.py &kill -9 $(ps aux | grep 'danvinci.py' | awk '{print $2}')Copy file to bin folder:
sudo cp -i /path_to/davinci.py /bin/davinci.pyOpen crontab editor
sudo crontab -eAdd:
@reboot python3 davinci.py &