|
26 | 26 | </p>
|
27 | 27 |
|
28 | 28 | <p align="center">
|
29 |
| - <a href="https://llmkira.github.io/Docs/">🍩 部署文档</a> |
| 29 | + <a href="https://llmkira.github.io/Docs/">🍩 Deploy Docs</a> |
30 | 30 | &
|
31 |
| - <a href="https://llmkira.github.io/Docs/dev/basic">🧀 开发文档</a> |
| 31 | + <a href="https://llmkira.github.io/Docs/dev/basic">🧀 Dev Docs</a> |
32 | 32 | &
|
33 |
| - <a href="README_EN.md">📝 English Readme</a> |
34 |
| - & |
35 |
| - <a href=".github/CONTRIBUTING.md">🤝 贡献必看</a> |
| 33 | + <a href=".github/CONTRIBUTING.md">🤝 Contribute</a> |
36 | 34 | </p>
|
37 | 35 |
|
| 36 | +> Don't hesitate to Star ⭐️, Issue 📝, and PR 🛠️ |
38 | 37 |
|
39 |
| -> **Look for English README? Click [here](README_EN.md). We also have English |
40 |
| -documentation [here](https://llmkira.github.io/Docs/en).** |
41 |
| - |
42 |
| -> 部署遇到问题?提交 Issue 帮助我们提升可用性 |
| 38 | +> Python>=3.9 |
43 | 39 |
|
44 |
| -此项目为自部署,实用可扩展的机器人核心,以 `FunctionCall` `ToolCall` 为核心,支持多种消息平台。 |
| 40 | +This project uses the ToolCall feature. |
45 | 41 |
|
46 |
| -采用消息队列,很好处理函数请求,支持繁杂的插件和功能设计。良好支持文件系统。 |
| 42 | +It integrates a message queuing and snapshot system, offering plugin mechanisms and authentication prior to plugin |
| 43 | +execution. |
47 | 44 |
|
48 |
| -支持多种模型源,支持跨平台消息转发。 |
| 45 | +The model adheres to the Openai Schema, other models are not supported. Please adapt using gateways independently. |
49 | 46 |
|
50 | 47 | | Demo |
|
51 | 48 | |-----------------------------------|
|
52 | 49 | |  |
|
53 | 50 |
|
54 |
| -与之前的项目不同的是,此项目尝试基于消息平台复刻 ChatGpt 的插件系统,实现部分或更进一步的功能。 |
55 |
| - |
56 |
| -> 因为 func call 为 feature,所以只支持 Openai 类型的 api, 不打算支持没有 func call 的 LLM |
57 |
| -
|
58 | 51 | ## 🍔 Roadmap
|
59 | 52 |
|
60 |
| -- [ ] 去除历史遗留代码 |
61 |
| -- [ ] 删除计量系统 |
62 |
| -- [ ] 删除模型选择系统,统一为 OpenAI Schema |
63 |
| -- [ ] 使用更好的插件系统 |
64 |
| -- [ ] 简化项目结构 |
65 |
| -- [ ] 尝试用本地化方案替代 RabbitMQ |
66 |
| -- [ ] 去除 Provider 体系 |
67 |
| - |
68 |
| -## 📦 Feature |
69 |
| - |
70 |
| -- 🍪 完善的插件开发生态,采用经典设计,通过 `pip` 安装即可使用 |
71 |
| -- 📝 消息系统,不限时间,不限发送端,定义发送接收者,逻辑完全解耦 |
72 |
| -- 📎 路由消息,自定义消息路由,以路由决定运作方式 |
73 |
| -- 📬 公共开放限额/私人自配置后端/代理Token认证,提供灵活可扩展的鉴权开发方案 |
74 |
| -- 🍾 支持中间件拦截开发,开发扩展即可操作流程前后数据 |
75 |
| -- 🎵 细化的统计系统,轻松统计使用情况 |
76 |
| -- 🍰 支持插件人在回路验证,可鉴权,可设置插件黑名单 |
77 |
| -- 📦 完善标准的文件交互支持,上传/下载文件 |
78 |
| -- 🍖 支持个人单独配置环境密钥,为插件提供个人的私有环境变量 |
79 |
| -- 🍟 支持大语言模型增量支持,支持多平台扩展,继承标准类即可适配 |
80 |
| -- 🍔 同时支持 `FunctionCall` `ToolCall` 特性,根据模型动态构建需要的函数类 |
81 |
| - |
82 |
| -### 🧀 部分插件预览 |
83 |
| - |
84 |
| -| Sticker Converter | Timer Func | Translate Func | |
85 |
| -|-------------------------------------|---------------------------------|----------------------------------------------| |
86 |
| -|  |  |  | |
87 |
| - |
88 |
| -### 🧀 认证系统介绍 |
| 53 | +- [x] Removal of legacy code |
| 54 | +- [x] Deletion of metric system |
| 55 | +- [x] Deletion of model selection system, unified to OpenAI Schema |
| 56 | +- [x] Implementation of a more robust plugin system |
| 57 | +- [x] Project structure simplification |
| 58 | +- [x] Elimination of the Provider system |
89 | 59 |
|
90 |
| -我们采用的认证系统称为 `Service Provider`,即服务提供商,它的作用是为每个发送者分配 Endpoint/Key/Model ,用于鉴权。 |
91 |
| -拥有一个 `token` 作为绑定的 OpenKey。程序会调用设定的 `Service Provider` 读取私有 Key/配置 Token 来获取鉴权信息。 |
| 60 | +## 📦 Features |
92 | 61 |
|
93 |
| - |
| 62 | +- 🍪 A comprehensive plugin development ecosystem, adopting a classic design, and seamless integration with plugins |
| 63 | + through `pip` installation |
| 64 | +- 📝 Message system with no time or sender constraints, offering fully decoupled logics |
| 65 | +- 📬 Offers Login via a URL mechanism, providing a flexible and expandable authentication development solution |
| 66 | +- 🍰 Empowers users to authorize plugin execution. Users can configure plugin environment variables at their discretion |
| 67 | +- 📦 Support for plugins to access files |
| 68 | +- 🍟 Multi-platform support – extend new platforms by inheriting the base class |
| 69 | +- 🍔 Plugins can determine their appearance in new sessions dynamically, preventing performance degradation despite large |
| 70 | + amounts of plugins |
94 | 71 |
|
95 |
| -认证组件和后端均需要自行实现。 |
| 72 | +### 🍔 Login Modes |
96 | 73 |
|
97 |
| -### 🎬 平台支持 |
| 74 | +- `Login via url`: Use `/login token#https://provider.com` to Login. The program posts the token to the interface to |
| 75 | + retrieve configuration information |
| 76 | +- `Login`: Use `/login https://api.com/v1#key#model` to login |
98 | 77 |
|
99 |
| -| 平台 | 支持情况 | 文件系统 | 备注 | |
100 |
| -|----------|------|------|-------------| |
101 |
| -| Telegram | ✅ | ✅ | | |
102 |
| -| Discord | ✅ | ✅ | | |
103 |
| -| Kook | ✅ | ✅ | 不支持 `被回复启动` | |
104 |
| -| Slack | ✅ | ✅ | 不支持 `被回复启动` | |
105 |
| -| QQ | ❌ | | | |
106 |
| -| Wechat | ❌ | | | |
107 |
| -| Twitter | ❌ | | | |
108 |
| -| Matrix | ❌ | | | |
109 |
| -| IRC | ❌ | | | |
110 |
| -| ... | | | 创建Issue/PR | |
| 78 | +### 🧀 Plugin Previews |
111 | 79 |
|
112 |
| -## 📦 快速开始 |
| 80 | +| Sticker Converter | Timer Function | Translate Function | |
| 81 | +|-------------------------------------|---------------------------------|----------------------------------------------| |
| 82 | +|  |  |  | |
113 | 83 |
|
114 |
| -阅读 [🧀 部署文档](https://llmkira.github.io/Docs/) 获得更多信息。 |
| 84 | +### 🎬 Platform Support |
115 | 85 |
|
116 |
| -请提前用 `pdm run python3 start_sender.py` `pdm run python3 start_receiver.py` 测试是否能正常运行。 |
| 86 | +| Platform | Support | File System | Remarks | |
| 87 | +|----------|---------|-------------|----------------------------------------| |
| 88 | +| Telegram | ✅ | ✅ | | |
| 89 | +| Discord | ✅ | ✅ | | |
| 90 | +| Kook | ✅ | ✅ | Does not support `triggering by reply` | |
| 91 | +| Slack | ✅ | ✅ | Does not support `triggering by reply` | |
| 92 | +| QQ | ❌ | | | |
| 93 | +| Wechat | ❌ | | | |
| 94 | +| Twitter | ❌ | | | |
| 95 | +| Matrix | ❌ | | | |
| 96 | +| IRC | ❌ | | | |
| 97 | +| ... | | | Create Issue/PR | |
117 | 98 |
|
118 |
| -#### 性能指标测试(Until 2023/11/1) |
| 99 | +## 📦 Quick Start |
119 | 100 |
|
120 |
| -注意,不包括pm2,redis,rabbitmq,mongodb,docker等服务的内存占用。 |
| 101 | +Refer to the [🧀 Deployment Document](https://llmkira.github.io/Docs/) for more information. |
121 | 102 |
|
122 |
| -| 进程 | 内存均值 | 测算命令 | client | |
123 |
| -|------------|-----------|--------------------------------------------------|----------| |
124 |
| -| `receiver` | 120.202MB | `python3 -m memray run --live start_receiver.py` | telegram | |
125 |
| -| `sender` | 83.375MB | `python3 -m memray run --live start_sender.py` | telegram | |
| 103 | +```shell |
| 104 | +# Install RabbitMQ |
| 105 | +docker pull rabbitmq:3.10-management |
| 106 | +docker run -d -p 5672:5672 -p 15672:15672 \ |
| 107 | + -e RABBITMQ_DEFAULT_USER=admin \ |
| 108 | + -e RABBITMQ_DEFAULT_PASS=8a8a8a \ |
| 109 | + --hostname myRabbit \ |
| 110 | + --name rabbitmq \ |
| 111 | + rabbitmq:3.10-management |
| 112 | +docker ps -l |
| 113 | +# Install Project |
| 114 | +pip install pdm |
| 115 | +pdm install -G bot |
| 116 | +cp .env.exp .env && nano .env |
| 117 | +# Test |
| 118 | +pdm run python3 start_sender.py |
| 119 | +pdm run python3 start_receiver.py |
| 120 | +# Host |
| 121 | +pdm start pm2.json |
| 122 | +``` |
126 | 123 |
|
127 | 124 | ### 🥣 Docker
|
128 | 125 |
|
129 | 126 | Build Hub: [sudoskys/llmbot](https://hub.docker.com/repository/docker/sudoskys/llmbot/general)
|
130 | 127 |
|
131 |
| -#### 自动 Docker/Docker-compose安装 |
132 |
| - |
133 |
| -如果你在使用一台崭新的服务器,你可以使用下面的Shell来尝试自动安装本项目。 |
| 128 | +#### Automatic Docker/Docker-compose Installation |
134 | 129 |
|
135 |
| -此脚本会自动使用 Docker 方法安装所需服务并映射端口,如果您已经部署了 `redis` ,`rabbitmq` ,`mongodb` 。 |
| 130 | +If you are using a brand new server, you can use the following shell to automatically install this project. |
136 | 131 |
|
137 |
| -请自行修改 `docker-compose.yml` 文件。 |
| 132 | +This script automatically installs the required services and maps ports using Docker methods. If you have |
| 133 | +deployed `redis`, `rabbitmq`, `mongodb`, please modify the `docker-compose.yml` file accordingly. |
138 | 134 |
|
139 | 135 | ```shell
|
140 |
| - |
141 | 136 | curl -sSL https://raw.githubusercontent.com/LLMKira/Openaibot/main/deploy.sh | bash
|
142 | 137 | ```
|
143 | 138 |
|
144 |
| -#### 手动 Docker-compose安装 |
| 139 | +#### Manual Docker-compose Installation |
145 | 140 |
|
146 | 141 | ```shell
|
147 | 142 | git clone https://github.com/LlmKira/Openaibot.git
|
148 | 143 | cd Openaibot
|
149 | 144 | cp .env.exp .env&&nano .env
|
150 | 145 | docker-compose -f docker-compose.yml up -d
|
151 |
| - |
152 | 146 | ```
|
153 | 147 |
|
154 |
| -更新镜像使用 `docker-compose pull`。 |
| 148 | +Update image using `docker-compose pull`. |
155 | 149 |
|
156 |
| -在 docker 中查看 Shell,使用 `docker exec -it llmbot /bin/bash`,输入 `exit` 退出。 |
| 150 | +Use `docker exec -it llmbot /bin/bash` to view Shell in Docker, enter `exit` to exit. |
157 | 151 |
|
158 |
| -### 🍔 Shell |
159 |
| - |
160 |
| -人工使用Pm2启动,需要自行安装 `redis` ,`rabbitmq` ,`mongodb` 。 |
| 152 | +## 🍪 Slash Commands |
161 | 153 |
|
162 | 154 | ```shell
|
163 |
| -git clone https://github.com/LlmKira/Openaibot.git |
164 |
| -pip install pdm |
165 |
| -cd Openaibot |
166 |
| -pdm install -G bot |
167 |
| -cp .env.exp .env && nano .env |
168 |
| -apt install npm -y && npm install pm2 && pm2 start pm2.json |
169 |
| -pm2 monit |
170 |
| - |
171 |
| -``` |
172 |
| - |
173 |
| -重启程序使用 `pm2 restart pm2.json` 。 |
174 |
| - |
175 |
| -> 推荐使用 `pdm` 进行依赖管理,因为我们使用了 `pydantic^1.9.0`,为了防止出现版本冲突,我们使用了 `pdm` 进行依赖管理。 |
176 |
| -
|
177 |
| -## 🍪 Slash Command |
178 |
| - |
179 |
| -```shell |
180 |
| -clear - 删除聊天记录 |
181 |
| -help - 显示文档 |
182 |
| -chat - 对话 |
183 |
| -task - 启用函数以对话 |
184 |
| -ask - 禁止函数以对话 |
185 |
| -tool - 列出所有函数 |
186 |
| -set_endpoint - 设置私有 key 和 endpoint |
187 |
| -clear_endpoint - 清除私有 key 和 endpoint |
188 |
| -auth - 授权一个函数 |
189 |
| -env - 函数环境变量 |
190 |
| -token - 绑定令牌 |
191 |
| -token_clear - 清除令牌绑定 |
192 |
| -func_ban - 禁用一个函数 |
193 |
| -func_unban - 解禁一个函数 |
194 |
| -bind - 绑定消息源 |
195 |
| -unbind - 解绑消息源 |
| 155 | +clear - Deletes chat records |
| 156 | +help - Displays documentation |
| 157 | +chat - Conversation |
| 158 | +task - Use a function to converse |
| 159 | +ask - Disable function-based conversations |
| 160 | +tool - Lists all functions |
| 161 | +login - Login |
| 162 | +auth - Authorize a function |
| 163 | +env - Environment variables of the function |
196 | 164 | ```
|
197 | 165 |
|
198 |
| -## 💻 如何开发插件? |
199 |
| - |
200 |
| -插件开发文档请参考 `plugins` 目录下的示例插件和 [🧀 插件开发文档](https://llmkira.github.io/Docs/dev/basic) |
201 |
| - |
202 |
| -## 🤝 We need your help! |
203 |
| - |
204 |
| -This is a long term project and we started the development of the LLM APP very early! |
205 |
| - |
206 |
| -We applied a plugin-like system and search online before GPT3 OpenaiApi was released(davinci-003) |
207 |
| - |
208 |
| -After many iterations, we have worked hard to make this project more standardized, generic, and open. |
209 |
| - |
210 |
| -We can't do it on our own at the moment: |
211 |
| - |
212 |
| -- [ ] We need help with the documentation |
213 |
| -- [ ] Web UI |
| 166 | +## 💻 How to Develop Plugins? |
214 | 167 |
|
215 |
| -Feel free to submit a Pull Request or discuss, we'd love to receive your contribution! |
| 168 | +Refer to the example plugins in the `plugins` directory and |
| 169 | +the [🧀 Plugin Development Document](https://llmkira.github.io/Docs/dev/basic) for plugin development documentation. |
216 | 170 |
|
217 |
| -## 📜 告知 |
| 171 | +## 📜 Notice |
218 | 172 |
|
219 |
| -> 此项目与 Openai 官方无关,全称为 OpenAiBot,表示开放人工智能机器人,并不表示为 Openai 所属机器人。 |
| 173 | +> This project, named OpenAiBot, signifying "Open Artificial Intelligence Robot", is not officially affiliated with |
| 174 | +> OpenAI. |
220 | 175 |
|
221 |
| -> 如果您所在辖区禁止使用 Openai 服务,请勿使用此项目。 |
222 | 176 |
|
223 | 177 | [](https://app.fossa.com/projects/git%2Bgithub.com%2Fsudoskys%2FOpenaibot?ref=badge_small)
|
0 commit comments