Version 0.1.31
Warning: This project is pre version 1!
pBot is broken into 3 services.
- Admin - web UI for bot administration and experimentation (see sandbox).
- Listener - handles interactions with discord. Collects incoming messages, sends any responses.
- Bot - the bot proper. Evaluates messages. Conditionally makes calls to AI.
┌──────────┐
│ Discord │
└──────────┘
▲
┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┼ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┐
Docker ▼
│ ┌────────┐ │
│Listener│
│ │Service │ │
└────────┘
│ ▲ │
┌──────────┐ │
│ OpenAI │◀─┐│ ┌────────┐ ▼ ┌────────┐ │
└──────────┘ │ │ Bot │ ┌─────┐ │ Admin │
├┼─▶│Service │◀──▶│Redis│◀──▶│Service │ │
┌──────────┐ │ └────────┘ └─────┘ └────────┘
│Midjourney│◀─┘│ │
└──────────┘ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
.
Dependency | Admin Service | Bot Service | Listener Service |
---|---|---|---|
discord | ✅ | ||
Flask | ✅ | ||
openai | ✅ | ||
pylint | ✅ | ✅ | ✅ |
pytest | ✅ | ✅ | ✅ |
python-dotenv | ✅ | ✅ | ✅ |
ratelimit | ✅ | ✅ | |
tiktoken | ✅ | ||
redis-py | ✅ | ✅ | ✅ |
Dependency | Admin Service | Bot Service | Listener Service |
---|---|---|---|
Bootstrap 5 | ✅ |
Fork & submit a pull request. I'll try to reply quickly. 🙏
While there is stil much to do, pBot is meant to be a simple bot framework on which you can experiment and build. Dependencies and patterns have been chosen to this end. Always keep the novice developer in mind. As tempting as it might be to write clever code, doing so probably wont do newer developers any favors.
- Write code for humans first, machines second.
- Comments should explain why, not how.
- Code should be written as self-documenting as possible.
- Code should have tests behind it and those tests must pass!
- Pylint should pass 100%. You can ignore a rule if there is a good reason (dependency causes ignorable issue) but document why.
- API Documentation
- OpenAI Cookbook
- Developer Forums
- Pricing
- Rate limits
- Prompt engineering guide
- Best practices for prompt engineering
- Tokens
- Handle a monthly token allotment. Ration AI responses for both openai and midjourney.
- Image "mirroring"
- More robust multi-call decision making?
- rate limiting
- Incite chaos!
- document invoke usage