This is a repository for a chatbot built using OpenAI's chat completion API. It allows users to ask the bot questions and receive human-like responses from the AI model.
-
Here is command for installation on Debian/Ubuntu via convenience script:
sudo apt update && \ curl -fsSL https://get.docker.com -o get-docker.sh && \ /bin/bash ./get-docker.sh && \ sudo apt install -y docker-compose
-
Clone this repo onto your local machine:
git clone https://github.com/Danand/bot-openai.git
-
Create
.env
file with the necessary variables:LOG_LEVEL="DEBUG" TELEGRAM_API_TOKEN="<your-token-here>" TELEGRAM_WHITELISTED_USERS="<telegram-user-id-integer-of-admins-comma-separated>" OPENAI_API_KEY="<your-token-here>" OPENAI_DEFAULT_MODEL="gpt-3.5-turbo" OPENAI_DEFAULT_TEMPERATURE="1.0" OPENAI_DEFAULT_MAX_TOKENS="4097" OPENAI_DEFAULT_MAX_MESSAGES="6" REDIS_HOST="bot-openai-redis" REDIS_PORT=6380 REDIS_VERSION="7.0.11-alpine3.18"
-
Run the bot using the command:
docker-compose \ -f ./docker-compose.yml \ -f ./docker-compose-local.yml \ up
-
Fork this repo to your own account.
-
Set up necessary secrets in your secrets settings of your repo:
DEPLOY_SSH_KEY
HOST_PUBLIC_IP
OPENAI_API_KEY
TELEGRAM_API_TOKEN
TELEGRAM_WHITELISTED_USERS
_GITHUB_PAT
-
Make changes if you want to.
-
Make sure you have compatible GitHub Actions Runner for this repo.
-
Push new tag, workflow Build and Push Docker Images will be triggered automatically.
-
Run workflow Deploy Docker Images manually with chosen tag to deploy image built at previous step.