An AI-powered Telegram bot that helps pet owners by answering questions about pet health using the Anthropic Claude AI model.
- Answers pet health-related questions using Anthropic's Claude AI
- Provides helpful and compassionate advice
- Always recommends consulting with a veterinarian for serious medical conditions
- Easy to use through Telegram messaging
- Go 1.21 or later
- Telegram Bot Token (obtain from @BotFather)
- Anthropic API Key (obtain from Anthropic Console)
- Clone the repository:
git clone https://github.com/ksysoev/help-my-pet.git
cd help-my-pet
- Install dependencies:
go mod download
- Create a configuration file:
cp config.yaml config.local.yaml
- Edit
config.local.yaml
and add your API keys:
bot:
telegram_token: "your-telegram-bot-token" # Required: Your Telegram bot token from BotFather
rate_limit:
user_hourly_limit: 5 # Maximum number of requests per hour per user
user_daily_limit: 15 # Maximum number of requests per day per user
global_daily_limit: 1000 # Maximum total requests per day across all users
whitelist_ids: [] # List of user IDs exempt from rate limiting
ai:
model: "claude-2" # Optional: Anthropic model to use (default: claude-2)
api_key: "" # Required: Your Anthropic API key
max_tokens: 1000 # Optional: Maximum tokens in response (default: 1000)
- Start the bot:
go run cmd/help-my-pet/main.go bot --config config.local.yaml
- Open Telegram and start chatting with your bot
- Ask any pet health-related questions
- Run tests:
go test ./...
- Run linter:
golangci-lint run
You can run the bot using Docker in the following ways:
- Pull the image:
docker pull ghcr.io/ksysoev/help-my-pet:latest
-
Create your config file as described in the Installation section
-
Run the container:
docker run -v $(pwd)/config.local.yaml:/app/config.yaml ghcr.io/ksysoev/help-my-pet bot
- Build the image:
docker build -t help-my-pet .
- Run the container:
docker run -v $(pwd)/config.local.yaml:/app/config.yaml help-my-pet bot
The application can be automatically deployed to Digital Ocean using GitHub Actions. The deployment process is triggered automatically when changes are pushed to the main branch.
- A Digital Ocean droplet with Docker and Docker Compose installed
- SSH access to the droplet
- GitHub repository secrets configured
Set up the following secrets in your GitHub repository (Settings -> Secrets and variables -> Actions):
DO_SSH_PRIVATE_KEY
: SSH private key for accessing the Digital Ocean dropletDO_HOST
: Your Digital Ocean droplet's IP address or hostnameDO_USER
: SSH user for the Digital Ocean dropletANTHROPIC_API_KEY
: Your Anthropic API key for the deployed instance
- Push your changes to the main branch
- GitHub Actions will automatically:
- Build and push the Docker image to GitHub Container Registry
- Deploy the latest version to your Digital Ocean droplet
- Set up the configuration and start the container
If you need to deploy manually, you can:
- SSH into your Digital Ocean droplet
- Pull the latest image:
docker pull ghcr.io/ksysoev/help-my-pet:main
- Update the container:
docker-compose pull && docker-compose up -d
cmd/help-my-pet/
- Main application entry pointpkg/
bot/
- Telegram bot service implementationcore/
- Core business logic and AI servicecmd/
- Command line interface and configuration
This project is licensed under the MIT License - see the LICENSE file for details.