MCPcopy Index your code
hub / github.com/LlmKira/Openaibot

github.com/LlmKira/Openaibot @app_4.0.4 sqlite

repository ↗ · DeepWiki ↗ · release app_4.0.4 ↗
754 symbols 3,105 edges 140 files 251 documented · 33%
README

cover


docker docker workflow

telegram discord

license docker build

🍩 Deploy Docs & 🧀 Dev Docs & 🤝 Contribute

Don't hesitate to Star ⭐️, Issue 📝, and PR 🛠️

Python>=3.9

This project uses the ToolCall feature.

It integrates a message queuing and snapshot system, offering plugin mechanisms and authentication prior to plugin execution.

The bot adheres to the Openai Format Schema. Please adapt using gateway or one-api independently.

Demo Vision With Voice Code Interpreter
sticker vision code

🔨 Roadmap

The program has iterated to its fourth generation.

  • [x] Removal of legacy code
  • [x] Deletion of metric system
  • [x] Deletion of model selection system, unified to OpenAI Schema
  • [x] Implementation of a more robust plugin system
  • [x] Project structure simplification
  • [x] Elimination of the Provider system
  • [x] Hook support
  • [x] Access to TTS
  • [x] Add standalone support for gpt-4-turbo and vision
  • [ ] Add LLM reference support to the plugin environment. (extract && search in text)

📦 Features

  • 🍪 A comprehensive plugin development ecosystem, adopting a classic design, and seamless integration with plugins through pip installation
  • 📝 Message system with no time or sender constraints, offering fully decoupled logics
  • 📬 Offers Login via a URL mechanism, providing a flexible and expandable authentication development solution
  • 🍰 Empowers users to authorize plugin execution. Users can configure plugin environment variables at their discretion
  • 📦 Support for plugins to access files
  • 🍟 Multi-platform support – extend new platforms by inheriting the base class
  • 🍔 Plugins can determine their appearance in new sessions dynamically, preventing performance degradation despite large amounts of plugins

🍔 Login Modes

  • Login via url: Use /login <a token>$<something like https://provider.com/login> to Login. The program posts the token to the interface to retrieve configuration information, how to develop this.
  • Login: Use /login https://<api endpoint>/v1$<api key>$<the model> to login

🧀 Plugin Can Do More

Sticker Converter Timer Function(built-in)
sticker timer

🎬 Platform Support

Platform Support File System Remarks
Telegram
Discord
Kook Does not support triggering by reply
Slack Does not support triggering by reply
QQ
Wechat
Twitter
Matrix
IRC
... Create Issue/PR

📦 Quick Start

Refer to the 🧀 Deployment Document for more information.

📦 One-click Deployment

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

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

📦 Manual Installation

# Install Voice dependencies
apt install ffmpeg
# 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=8a8a8a \
  --hostname myRabbit \
  --name rabbitmq \
  rabbitmq:3.10-management
docker ps -l
# Install Project
git clone https://github.com/LlmKira/Openaibot/
cd Openaibot
pip install pdm
pdm install -G bot
cp .env.exp .env && nano .env
# Test
pdm run python3 start_sender.py
pdm run python3 start_receiver.py
# Host
apt install npm
npm install pm2 -g
pm2 start pm2.json

Be sure to change the default password for the command, or disable open ports to prevent the database from being scanned and attacked.

🥣 Docker

Build Hub: sudoskys/llmbot

Note that if you run this project using Docker, you will start Redis, MongoDB, and RabbitMQ. But if you're running locally, just RabbitMQ

Manual Docker-compose Installation

git clone https://github.com/LlmKira/Openaibot.git
cd Openaibot
cp .env.exp .env&&nano .env
docker-compose -f docker-compose.yml up -d

The Docker configuration file docker-compose.yml contains all databases. In fact, Redis and MongoDB are not required. You can remove these databases yourself and use the local file system.

Update image using docker-compose pull.

Use docker exec -it llmbot /bin/bash to view Shell in Docker, enter exit to exit.

🍪 Slash Commands

clear - Deletes chat records
help - Displays documentation
chat - Conversation
task - Use a function to converse
ask - Disable function-based conversations
tool - Lists all functions
login - Login
auth - Authorize a function
env - Environment variables of the function

💻 How to Develop Plugins?

Refer to the example plugins in the plugins directory and the 🧀 Plugin Development Document for plugin development documentation.

Hooks

Hooks control the EventMessage in sender and receiver. For example, we have voice_hook in built-in hooks.

you can enable it by setting VOICE_REPLY_ME=true in .env.

/env VOICE_REPLY_ME=yes
# must

/env REECHO_VOICE_KEY=<key in dev.reecho.ai>
# not must

use /env VOICE_REPLY_ME=NONE to disable this env.

check the source code in llmkira/extra/voice_hook.py, learn to write your own hooks.

🧀 Sponsor

sponsor

📜 Notice

This project, named OpenAiBot, signifying "Open Artificial Intelligence Robot", is not officially affiliated with OpenAI.

FOSSA Status

Core symbols most depended-on inside this repo

get
called by 92
app/sender/kook/__init__.py
append
called by 58
app/sender/kook/__init__.py
error
called by 45
app/receiver/kook/__init__.py
uid_make
called by 30
app/sender/util_func.py
is_command
called by 20
app/sender/util_func.py
append
called by 19
llmkira/memory/_base.py
reply
called by 17
app/receiver/kook/__init__.py
create_and_send
called by 14
llmkira/task/__init__.py

Shape

Method 434
Class 178
Function 141
Route 1

Languages

Python100%

Modules by API surface

llmkira/openai/cell.py32 symbols
docs/test_script/exp_from_nonebot.py32 symbols
llmkira/task/schema.py31 symbols
app/sender/kook/__init__.py23 symbols
llmkira/doc_manager/__init__.py22 symbols
llmkira/sdk/tools/schema.py20 symbols
app/sender/discord/__init__.py19 symbols
app/receiver/receiver_client.py19 symbols
llmkira/sdk/tools/model.py17 symbols
llmkira/openai/request.py17 symbols
app/sender/slack/__init__.py17 symbols
llmkira/cache/__init__.py15 symbols

Dependencies from manifests, versioned

httpx0.24.1 · 1×
loguru0.5.3 · 1×
pathlib1.0.1 · 1×
pydantic2.0.0 · 1×
redis4.5.4 · 1×

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add Openaibot \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact