Skip to main content

A chain message bot based on OpenAI

Project description

cover


Docker Image Size (tag) Docker Image Version (latest semver) docker workflow

Telegram Discord

中文手册

LLMBot is a message queue based IM Bot developed around the concept of an intelligent robot assistant that can be loaded with plugins to perform many functions. Implemented with Openai's new Feature gpt-function-call support.

Demo
sticker

Unlike previous projects, this project tries to replicate ChatGpt's plugin system based on the messaging platform, implementing some or more features.

Because func call is a feature, it only supports Openai type api, and does not intend to support LLM without func call.

📦 Feature

  • 🍪 Call a number of pre-defined functions in natural language.
  • 📝 Messaging system, define send receivers and data can be delivered to the llm chain.
  • 📎 Subscription system, which can subscribe to multiple senders in addition to paired senders, with push functionality.
  • 📦 Non-question-and-answer binding, unlimited time and unlimited sender triggered response.
  • 📬 Customizable ApiKey and Endpoint, traceability of sender authentication info.
  • 🍾 Easy Interactive Experience.
  • 🎵 Fine-grained consumption data storage, statistics on plugin credit consumption.
  • 🍖 Continuous session design for function plug-ins

🧀 Preview of some plugins

Sticker Converter Timer Func Translate
sticker timer translate

🎬 Platform support

Platform Support Tip
Telegram
Discord Working
QQ
Wechat
Twitter

📝 Deployment Guide

Make sure your system is UTF8, dpkg-reconfigure locales

Please make sure that your server has more than 1G of RAM, otherwise it will reboot indefinitely with PM2.

If you are using a brand-new server, you can use the following shell to automatically install:

curl -sSL https://raw.githubusercontent.com/LLMKira/Openaibot/main/deploy.sh | bash

🌻 Configuration

  • (Optional) Resolving conflicts

    pip uninstall llm-kira

  • Clone the project

git clone https://github.com/LlmKira/Openaibot.git
cd Openaibot
pip install -r requirements.txt
  • 🛠 Configure the .env file
cp .env.example .env
  • ⚙️ Install dependencies
pip install -r requirements.txt
  • 🗄 Configure the database environment
# Install Redis
apt-get install redis
systemctl enable redis.service --now
# Install RabbitMQ
docker pull rabbitmq:3.10-management
docker run -d -p 5672:5672 -p 15672:15672 \
        -e RABBITMQ_DEFAULT_USER=admin \
        -e RABBITMQ_DEFAULT_PASS=admin \
        --hostname myRabbit \
        --name rabbitmq \
        rabbitmq:3.10-management 
docker ps -l

▶️ Run

Docker

cd Openaibot
docker-compose -f docker-compose.yml -p llmbot up -d llmbot --compatibility

Install docker can refer to docker docs

Install docker-compose can refer to docker-compose docs

Install docker-desktop can refer to docker-desktop docs

PM2

apt install npm
npm install pm2 -g
pm2 start pm2.json

Shell

python3 start_sender.py
python3 start_receiver.py

Basic commands

help - help
chat - chat
task - task
tool - tool list
bind - bind optional platforms
unbind - unbind optional platforms
clear - Delete your own records
rset_endpoint - customize the backend
rset_key - set openai
clear_rset - wipe custom settings

🥽 Environment variables

Variable name value Description
LLMBOT_STOP_REPLY 1 Stop receiver to reply if value is 1
LLMBOT_LOG_OUTPUT DEBUG Print LONG debug log on screen if value is DEBUG

💻 How to develop?

For plugin development, please refer to the sample plugins in the plugins directory.

  • TODO: Plugin development documentation

🤝 We need your help!

We can't do it on our own at the moment:

  • Security checks on procedures
  • User Auth System

Feel free to submit a Pull Request or discuss, we'd love to receive your contribution!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llmkira-0.24.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

llmkira-0.24.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file llmkira-0.24.0.tar.gz.

File metadata

  • Download URL: llmkira-0.24.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/6.2.0-1012-azure

File hashes

Hashes for llmkira-0.24.0.tar.gz
Algorithm Hash digest
SHA256 18c3ae4861a292049c7035d9926dfcee26b72c0575b2eaeecdd25418f25d7332
MD5 d7a6dc7d84a28dc4f0c01f0deffd46c8
BLAKE2b-256 939a257428d5b458fc71b09b65580c6c5313eca526a7c8283e8fab0794cbed44

See more details on using hashes here.

File details

Details for the file llmkira-0.24.0-py3-none-any.whl.

File metadata

  • Download URL: llmkira-0.24.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.0 Linux/6.2.0-1012-azure

File hashes

Hashes for llmkira-0.24.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a15dfb6a8dbde3b4cda283742dc63b4118526cc1e76ab2ef6f89fe865fb65cc
MD5 75cc2b1fe593bad50abc0e1701489b66
BLAKE2b-256 97730aecf72b01ed52ac0fa1e2cb89add95db545bd33381bc1f865dbfe75fa59

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page