diff --git a/README.md b/README.md index c4e93192f..7d59050a9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# [QChatGPT](https://github.com/RockChinQ/QChatGPT) 官方文档 +# [LangBot](https://github.com/RockChinQ/LangBot) 官方文档 -> 此仓库是 QChatGPT 的文档仓库,代码仓库: -> [QChatGPT 代码仓库](https://github.com/RockChinQ/QChatGPT) +> 此仓库是 LangBot 的文档仓库,代码仓库: +> [LangBot 代码仓库](https://github.com/RockChinQ/LangBot) ## 参与编写 @@ -40,6 +40,6 @@ npm run docs:dev ### 一些规范化标准 - 文件夹和文件的命名:**一律使用全小写,单词直接`-`隔开,如**`plugin-intro.md` -- 子文件(夹)的命名,**不加前缀**(即文件夹的名称),如:`deploy`文件夹下的,文件夹`qchatgpt`,`qchatgpt`文件夹下的`manual`文件称之为`manual.md` +- 子文件(夹)的命名,**不加前缀**(即文件夹的名称),如:`deploy`文件夹下的,文件夹`langbot`,`langbot`文件夹下的`manual`文件称之为`manual.md` - 由于这是有关于文档的规范化命名,所以任何文件的名称都可以以教程的角度来理解,如`deploy`是有关部署的教程 - 除了配置文件板块的文档,其他的页面都不要在顶部加目录 diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 7855a4cb4..aaa9d79c6 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -2,9 +2,9 @@ import { defineConfig } from "vitepress"; // https://vitepress.dev/reference/site-config export default defineConfig({ - title: "QChatGPT 文档", + title: "LangBot 文档", description: - "😎高稳定性、🧩支持插件、🦄多模态的 LLM QQ / QQ频道 / OneBot 机器人 / Agent 平台", + "原名 QChatGPT;😎高稳定、🧩支持插件、🦄多模态的 LLM QQ / QQ频道 / OneBot 机器人 / Agent 平台", themeConfig: { // https://vitepress.dev/reference/default-theme-config logo: "/langbot-logo-0.5x.png", @@ -12,7 +12,7 @@ export default defineConfig({ nav: [ { text: "首页", link: "/" }, { text: "概述", link: "/insight/guide" }, - { text: "部署", link: "/deploy/qchatgpt/manual" }, + { text: "部署", link: "/deploy/langbot/manual" }, { text: "插件", link: "/plugin/plugin-intro" }, ], @@ -22,18 +22,18 @@ export default defineConfig({ items: [ { text: "新手指引(必看)", link: "/insight/guide" }, { text: "项目介绍", link: "/insight/intro" }, + { text: "社区资源", link: "/insight/community" }, ], }, { text: "部署", items: [ { - text: "部署 QChatGPT", + text: "部署 LangBot", collapsed: true, items: [ - { text: "手动部署", link: "/deploy/qchatgpt/manual" }, - { text: "Docker部署", link: "/deploy/qchatgpt/docker" }, - { text: "社区资源", link: "/deploy/qchatgpt/community" } + { text: "手动部署", link: "/deploy/langbot/manual" }, + { text: "Docker部署", link: "/deploy/langbot/docker" }, ], }, { @@ -64,10 +64,10 @@ export default defineConfig({ }, ], }, - { - text: "mirai", - link: "/deploy/platforms/mirai", - }, + // { + // text: "mirai", + // link: "/deploy/platforms/mirai", + // }, { text: "go-cqhttp", link: "/deploy/platforms/gocq", @@ -128,12 +128,27 @@ export default defineConfig({ // collapsed: true, items: [ { text: "插件介绍", link: "/plugin/plugin-intro" }, - { text: "插件开发", link: "/plugin/plugin-dev" }, - { text: "组件拓展", link: "/plugin/extension" }, - { text: "API参考", link: "/plugin/api-ref" }, - { text: "技术信息", link: "/plugin/tech-info" }, + { + text: "插件开发", + collapsed: true, + items: [ + { text: "基础教程", link: "/plugin/dev/tutor" }, + { text: "消息平台实体", link: "/plugin/dev/messages" }, + { text: "API 参考", link: "/plugin/dev/api-ref" }, + { text: "组件扩展", link: "/plugin/dev/extension" }, + ] + }, + // { text: "技术信息", link: "/plugin/tech-info" }, ], }, + { + text: "管理面板(Beta测试)", + items: [ + { text: "介绍 & 使用", link: "/webui/intro" }, + { text: "系统操作", link: "/webui/system" }, + { text: "设置项管理", link: "/webui/settings" }, + ] + }, // { // text: "规模化和商用", // // collapsed: true, @@ -145,8 +160,9 @@ export default defineConfig({ // ], // }, - { text: "实践", items: [ - { text: "如何在 QChatGPT 上接入 Dify?", link: "/workshop/dify-integration" }, + { + text: "实践", items: [ + { text: "如何在 LangBot 上接入 Dify?", link: "/workshop/dify-integration" }, { text: "如何接入 OneAPI、LinkAI 等第三方 OpenAI 格式接口?", link: "/workshop/one-api" }, ] }, diff --git a/docs/assets/image/plugin_dev_messages_01.png b/docs/assets/image/plugin_dev_messages_01.png new file mode 100644 index 000000000..4d23b9a9a Binary files /dev/null and b/docs/assets/image/plugin_dev_messages_01.png differ diff --git a/docs/assets/image/webui_intro_01.png b/docs/assets/image/webui_intro_01.png new file mode 100644 index 000000000..2a11303c5 Binary files /dev/null and b/docs/assets/image/webui_intro_01.png differ diff --git a/docs/assets/image/webui_settings_01.png b/docs/assets/image/webui_settings_01.png new file mode 100644 index 000000000..25f5e25f6 Binary files /dev/null and b/docs/assets/image/webui_settings_01.png differ diff --git a/docs/assets/image/webui_settings_02.png b/docs/assets/image/webui_settings_02.png new file mode 100644 index 000000000..0268da370 Binary files /dev/null and b/docs/assets/image/webui_settings_02.png differ diff --git a/docs/assets/image/webui_settings_03.png b/docs/assets/image/webui_settings_03.png new file mode 100644 index 000000000..157e9af36 Binary files /dev/null and b/docs/assets/image/webui_settings_03.png differ diff --git a/docs/assets/image/webui_settings_04.png b/docs/assets/image/webui_settings_04.png new file mode 100644 index 000000000..88e30481a Binary files /dev/null and b/docs/assets/image/webui_settings_04.png differ diff --git a/docs/assets/image/webui_settings_05.png b/docs/assets/image/webui_settings_05.png new file mode 100644 index 000000000..e34a1cbfc Binary files /dev/null and b/docs/assets/image/webui_settings_05.png differ diff --git a/docs/assets/image/webui_system_02.png b/docs/assets/image/webui_system_02.png new file mode 100644 index 000000000..c96e2a8a3 Binary files /dev/null and b/docs/assets/image/webui_system_02.png differ diff --git a/docs/assets/image/webui_system_03.png b/docs/assets/image/webui_system_03.png new file mode 100644 index 000000000..a60fe981b Binary files /dev/null and b/docs/assets/image/webui_system_03.png differ diff --git a/docs/assets/image/webui_system_04.png b/docs/assets/image/webui_system_04.png new file mode 100644 index 000000000..029b441a9 Binary files /dev/null and b/docs/assets/image/webui_system_04.png differ diff --git a/docs/config/function/platform.md b/docs/config/function/platform.md index 41fdd197c..f4392f150 100644 --- a/docs/config/function/platform.md +++ b/docs/config/function/platform.md @@ -10,14 +10,6 @@ ```json "platform-adapters": [ - { - "adapter": "yiri-mirai", - "enable": false, - "host": "127.0.0.1", - "port": 8080, - "verifyKey": "yirimirai", - "qq": 123456789 - }, { "adapter": "nakuru", "enable": false, @@ -30,7 +22,7 @@ "adapter": "aiocqhttp", "enable": false, "host": "0.0.0.0", - "port": 8080, + "port": 2280, "access-token": "", }, { @@ -46,7 +38,7 @@ ], ``` -目前支持 `mirai`、`go-cqhttp`、`aiocqhttp`、`qq-botpy` 四种消息平台适配器,也可以同时启用多个同种类或不同种类的平台适配器。 +目前支持 `go-cqhttp`、`aiocqhttp`、`qq-botpy` 四种消息平台适配器,也可以同时启用多个同种类或不同种类的平台适配器。 各个消息平台的配置方式请查看部署文档。 ### 多开示例 @@ -54,12 +46,11 @@ ```json "platform-adapters": [ { - "adapter": "yiri-mirai", - "enable": true, - "host": "127.0.0.1", - "port": 8080, - "verifyKey": "yirimirai", - "qq": 123456789 + "adapter": "aiocqhttp", + "enable": false, + "host": "0.0.0.0", + "port": 2280, + "access-token": "", }, { "adapter": "nakuru", diff --git a/docs/config/function/system.md b/docs/config/function/system.md index 87fd6e41b..5d4966df1 100644 --- a/docs/config/function/system.md +++ b/docs/config/function/system.md @@ -21,7 +21,7 @@ ``` ::: info -1. 如果你使用的是 QQ 官方的 API,session id 为映射之后的值,具体可以查看 [qq-botpy 元数据](https://qchatgpt.rockchin.top/config/metadata/adapter-qq-botpy.html),或者查看程序处理消息时的控制台输出。 +1. 如果你使用的是 QQ 官方的 API,session id 为映射之后的值,具体可以查看 [qq-botpy 元数据](https://docs.langbot.app/config/metadata/adapter-qq-botpy.html),或者查看程序处理消息时的控制台输出。 2. 如果 session 指定了一个群,那么群内所有人的所有消息都会被认为是管理员消息。 ::: @@ -84,7 +84,7 @@ ## 遥测服务器url qcg-center-url -QChatGPT 运行期间推送遥测数据的目标地址,默认为官方地址,若您自己部署了[qcg-center](https://github.com/RockChinQ/qcg-center),可以改为你的地址。 +LangBot 运行期间推送遥测数据的目标地址,默认为官方地址,若您自己部署了[qcg-center](https://github.com/RockChinQ/qcg-center),可以改为你的地址。 ```json "qcg-center-url": "https://api.qchatgpt.rockchin.top/api/v2" @@ -93,7 +93,7 @@ QChatGPT 运行期间推送遥测数据的目标地址,默认为官方地址 ## 帮助消息 help-message ```json -"help-message": "QChatGPT - 😎高稳定性、🧩支持插件、🦄多模态的 ChatGPT QQ 机器人🤖\n链接:https://q.rkcn.top" +"help-message": "LangBot - 😎高稳定性、🧩支持插件、🦄多模态的 ChatGPT QQ 机器人🤖\n链接:https://langbot.app" ``` `help-message`:帮助消息,用户发送 !help 命令时的输出 \ No newline at end of file diff --git a/docs/config/metadata/adapter-qq-botpy.md b/docs/config/metadata/adapter-qq-botpy.md index 9d29fa40b..7ab8c596f 100644 --- a/docs/config/metadata/adapter-qq-botpy.md +++ b/docs/config/metadata/adapter-qq-botpy.md @@ -1,6 +1,6 @@ # adapter-qq-botpy.json 元数据 -`data/metadata/adapter-qq-botpy.json`,QQ 官方 API 适配器元数据。官方 API 在使用群聊接口时,群id和成员id为字符串,而 QChatGPT 内部只支持整型 id,为使重启后仍然是相同的对应关系,因此需要保存到一个文件中。 +`data/metadata/adapter-qq-botpy.json`,QQ 官方 API 适配器元数据。官方 API 在使用群聊接口时,群id和成员id为字符串,而 LangBot 内部只支持整型 id,为使重启后仍然是相同的对应关系,因此需要保存到一个文件中。 ## 格式 diff --git a/docs/deploy/qchatgpt/docker.md b/docs/deploy/langbot/docker.md similarity index 74% rename from docs/deploy/qchatgpt/docker.md rename to docs/deploy/langbot/docker.md index b7d007e7c..e824d2946 100644 --- a/docs/deploy/qchatgpt/docker.md +++ b/docs/deploy/langbot/docker.md @@ -1,14 +1,12 @@ # Docker部署(仅推荐在Linux上使用) :::warning -请您确保您**确实**需要 Docker 部署,您**必须**具有以下能力: +要使用 Docker 部署,请**确保**您具有以下能力: - 了解 `Docker` 和 `Docker Compose` 的使用 - 了解容器间网络通信配置方式 - - 了解容器文件挂载机制 - - 了解容器调试操作 + - 了解容器文件挂载机制 - 动手能力强、资料查找能力强 - 若您不完全具有以上能力,请勿使用 Docker 部署,由于误操作导致的配置不正确,我们将不会解答您的问题并不负任何责任。 **不建议**您在除 Linux 之外的系统上使用 Docker 进行部署。 ::: @@ -22,12 +20,15 @@ version: "3" services: - qchatgpt: - image: rockchin/qchatgpt:latest + langbot: + image: rockchin/langbot:latest volumes: - ./data:/app/data - ./plugins:/app/plugins restart: on-failure + ports: + - 5300:5300 # 供 WebUI 使用 + - 2280-2290:2280-2290 # 供消息平台适配器方向连接 # 根据具体环境配置网络 ``` diff --git a/docs/deploy/qchatgpt/manual.md b/docs/deploy/langbot/manual.md similarity index 66% rename from docs/deploy/qchatgpt/manual.md rename to docs/deploy/langbot/manual.md index 981f9a92a..530a673dd 100644 --- a/docs/deploy/qchatgpt/manual.md +++ b/docs/deploy/langbot/manual.md @@ -7,7 +7,7 @@ ## 安装主程序 -1. 前往[Release](https://github.com/RockChinQ/QChatGPT/releases)页面下载最新版本的压缩包(推荐)并解压,在解压目录打开命令行(终端) +1. 前往[Release](https://github.com/RockChinQ/LangBot/releases)页面下载最新版本的压缩包(推荐)`langbot-xxx-all.zip`(请勿下载 Source Code,因为其中不包含 WebUI)。解压,在解压目录打开命令行(终端) ![下载Release](/assets/image/dl_release.png) @@ -16,8 +16,13 @@ 您也可以使用以下命令克隆最新代码(有可能包含不稳定的代码)并使用: ```bash -git clone https://github.com/RockChinQ/QChatGPT -cd QChatGPT +git clone https://github.com/RockChinQ/LangBot +cd LangBot + +# 构建前端,需要 NodeJS >= 22 +cd web +npm install && npm run build +cd .. ``` ::: @@ -51,14 +56,14 @@ python main.py 提示如下信息 ``` + _ ___ _ +| | __ _ _ _ __ _| _ ) ___| |_ +| |__/ _` | ' \/ _` | _ \/ _ \ _| +|____\__,_|_||_\__, |___/\___/\__| + |___/ - ___ ___ _ _ ___ ___ _____ - / _ \ / __| |_ __ _| |_ / __| _ \_ _| -| (_) | (__| ' \/ _` | _| (_ | _/ | | - \__\_\\___|_||_\__,_|\__|\___|_| |_| - -⭐️开源地址: https://github.com/RockChinQ/QChatGPT -📖文档地址: https://q.rkcn.top +⭐️开源地址: https://github.com/RockChinQ/LangBot +📖文档地址: https://docs.langbot.app 以下文件不存在,已自动生成,请按需修改配置文件后重启: - plugins/__init__.py diff --git a/docs/deploy/platforms/aiocqhttp/lagrange.md b/docs/deploy/platforms/aiocqhttp/lagrange.md index 481b40c6f..5f4e9df12 100644 --- a/docs/deploy/platforms/aiocqhttp/lagrange.md +++ b/docs/deploy/platforms/aiocqhttp/lagrange.md @@ -2,7 +2,7 @@ ## Lagrange介绍 -Lagrange 是一个 QQNT 协议逆向工程框架,比 Shamrock 或 Mirai 更加轻便,在目前也较为稳定。通过 OneBot 11 协议接入,需选择使用`aiocqhttp`作为适配器,填写配置时可参考 Shamrock 的方式。 +Lagrange 是一个 QQNT 协议逆向工程框架,轻便且相对稳定。通过 OneBot 11 协议接入,需选择使用`aiocqhttp`作为适配器。 ::: warning 需要使用 NT QQ 与机器人交互,旧版QQ无法正常使用 @@ -44,10 +44,11 @@ Lagrange 是一个 QQNT 协议逆向工程框架,比 Shamrock 或 Mirai 更加 ## 修改配置 -需要配置 Lagrange 以让其连接上 QChatGPT,请编辑 Lagrange 的配置文件 appsettings.json,确保 Implementations 中的连接配置符合下图内容: +需要配置 Lagrange 以让其连接上 LangBot,请编辑 Lagrange 的配置文件 appsettings.json,确保 Implementations 中的连接配置符合下图内容: ![配置连接](/assets/image/config_lgr.png) 其中 Type 必须为 `ReverseWebSocket`; -Host 为 QChatGPT 运行的主机 IP,若在同一主机上,可以写 `127.0.0.1`; -Suffix 必须为 `/ws` \ No newline at end of file +Host 为 LangBot 运行的主机 IP,若在同一主机上,可以写 `127.0.0.1`; +Suffix 必须为 `/ws`; +Port 必须与 LangBot 消息平台配置中的 aiocqhttp 适配器监听的端口相同。 \ No newline at end of file diff --git a/docs/deploy/platforms/aiocqhttp/llonebot.md b/docs/deploy/platforms/aiocqhttp/llonebot.md index 4519a6a89..be3da77ed 100644 --- a/docs/deploy/platforms/aiocqhttp/llonebot.md +++ b/docs/deploy/platforms/aiocqhttp/llonebot.md @@ -6,4 +6,6 @@ 安装LiteLoaderQQNT的教程:https://llonebot.github.io/zh-CN/guide/getting-started -![image-20240515185909108](/assets/image/llob_cfg.png) \ No newline at end of file +![image-20240515185909108](/assets/image/llob_cfg.png) + +确保地址中 IP地址 是 LangBot 运行的主机的地址(若在同一网络内运行则为 127.0.0.1),端口必须与 LangBot 消息平台配置中的 aiocqhttp 适配器监听的端口相同,后缀必须为`/ws`: \ No newline at end of file diff --git a/docs/deploy/platforms/aiocqhttp/napcat.md b/docs/deploy/platforms/aiocqhttp/napcat.md index 15d9c8354..b5aba0510 100644 --- a/docs/deploy/platforms/aiocqhttp/napcat.md +++ b/docs/deploy/platforms/aiocqhttp/napcat.md @@ -20,7 +20,7 @@ NapCat 是一个 QQNT 协议逆向工程框架。 登录后,可以在config文件夹中,找到并修改文件(数字对应机器人QQ号):![image-20240514231529613](/assets/image/napcat_cfg_1.png) -参考下图红框修改内容,确保地址中 IP地址 是 QChatGPT 运行的主机的地址(若在同一网络内运行则为 127.0.0.1),后缀须为`/ws`: +参考下图红框修改内容,确保地址中 IP地址 是 LangBot 运行的主机的地址(若在同一网络内运行则为 127.0.0.1),端口必须与 LangBot 消息平台配置中的 aiocqhttp 适配器监听的端口相同,后缀必须为`/ws`: ![image-20240514231932514](/assets/image/napcat_cfg_2.png) diff --git a/docs/deploy/platforms/aiocqhttp/shamrock.md b/docs/deploy/platforms/aiocqhttp/shamrock.md index 4e1cd43cd..4820ecc34 100644 --- a/docs/deploy/platforms/aiocqhttp/shamrock.md +++ b/docs/deploy/platforms/aiocqhttp/shamrock.md @@ -10,7 +10,7 @@ ## OpenShamrock简介 -Mirai、go-cqhttp 之类的是模拟 QQ 的协议进行通信,而 Shamrock 使用的是 安卓的 Hook 来操作 QQ 模拟点击,稳定性较高。 +go-cqhttp 之类的是模拟 QQ 的协议进行通信,而 Shamrock 使用的是 安卓的 Hook 来操作 QQ 模拟点击,稳定性较高。 可选平台(or设备): @@ -43,13 +43,13 @@ Mirai、go-cqhttp 之类的是模拟 QQ 的协议进行通信,而 Shamrock 使 1. 在 Shamrock 的设置页面修改设置如图: -启用被动 Websocket,并填写 QChatGPT 的 aiocqhttp 适配器监听的地址和端口(详见填写配置信息页)。 +启用被动 Websocket,并填写 LangBot 的 aiocqhttp 适配器监听的地址和端口(详见填写配置信息页)。 ![img](/assets/image/sham_cfg_1.png) ![img](/assets/image/sham_cfg_2.png) -填写的被动 Websocket 地址为 QChatGPT 的 aiocqhttp 适配器监听的地址和端口,且路径必须为 `/ws`,例如 `ws://127.0.0.1:8080/ws`,详见填写配置信息页。 +填写的被动 Websocket 地址为 LangBot 的 aiocqhttp 适配器监听的地址和端口,且路径必须为 `/ws`,例如 `ws://127.0.0.1:2280/ws`,详见填写配置信息页。 2. 并前往 LSPosed 的模块管理页面 启用模块 Shamrock diff --git a/docs/deploy/platforms/gocq.md b/docs/deploy/platforms/gocq.md index ca957ae21..09eaf3cfb 100644 --- a/docs/deploy/platforms/gocq.md +++ b/docs/deploy/platforms/gocq.md @@ -131,7 +131,7 @@ default-middlewares: &default ![获取token](/assets/image/get_gocq_login_token.png) -ticket 后那一坨就是要输入回 mirai 的内容,但不包括首尾的双引号 +ticket 后那一坨就是要输入回 go-cqhttp 的内容,但不包括首尾的双引号 **注意** diff --git a/docs/deploy/platforms/mirai.md b/docs/deploy/platforms/mirai.md index 728d8b99c..8017c51fe 100644 --- a/docs/deploy/platforms/mirai.md +++ b/docs/deploy/platforms/mirai.md @@ -18,7 +18,7 @@ 2. 创建子文件夹 - 双击进入刚刚创建的文件夹,分别新建两个文件夹(建议命名保持一致):mirai、QChatGPT + 双击进入刚刚创建的文件夹,分别新建两个文件夹(建议命名保持一致):mirai、LangBot ## 安装 mirai-console diff --git a/docs/deploy/quick-config/config.md b/docs/deploy/quick-config/config.md index 94d6e2967..cf812f0ec 100644 --- a/docs/deploy/quick-config/config.md +++ b/docs/deploy/quick-config/config.md @@ -1,6 +1,6 @@ # 填写配置信息 -修改以下配置文件即可启用 QChatGPT 的基本功能,当你阅读完此页面后,建议查看[配置详解](../../config/function/platform.md),以了解更多的配置项详解 +修改以下配置文件即可启用 LangBot 的基本功能,当你阅读完此页面后,建议查看[配置详解](../../config/function/platform.md),以了解更多的配置项详解 - `data/config/platform.json` - `data/config/provider.json` @@ -9,19 +9,19 @@ ## platform.json 修改此配置文件以指定需要连接的消息平台,只需要关注`platform-adapters`字段。 -目前支持 `mirai`、`go-cqhttp`、`aiocqhttp`、`qq-botpy` 四种消息平台适配器,也可以同时启用多个同种类或不同种类的平台适配器。 +目前支持 `go-cqhttp`、`aiocqhttp`、`qq-botpy` 消息平台适配器,也可以同时启用多个同种类或不同种类的平台适配器。 请根据你部署的消息平台的情况选择填写。 ### aiocqhttp 适配器 -用于接入 Lagrange 等兼容 OneBot 协议的机器人框架(仅支持反向ws)。 +用于接入 Lagrange/NapCat/LLOneBot 等兼容 OneBot 协议的机器人端(仅支持反向ws)。 ```json { "adapter": "aiocqhttp", "enable": false, "host": "0.0.0.0", - "port": 8080, + "port": 2280, "access-token": "" }, ``` @@ -30,11 +30,11 @@ `enable`:是否启用,配置完成后请将其设为`true` -`host`:监听的 IP 地址,一般就保持 0.0.0.0 就可以了。使用 aiocqhttp 时,QChatGPT 作为服务端被动等待框架连接,请在 Shamrock 等框架中设置`被动 ws 地址`或者`反向 ws 地址`(具体视框架而定)为 QChatGPT 监听的地址,且路径为`/ws`,例如:`ws://127.0.0.1:8080/ws`。 +`host`:监听的 IP 地址,一般就保持 0.0.0.0 就可以了。使用 aiocqhttp 时,LangBot 作为服务端被动等待框架连接,请在 Shamrock 等框架中设置`被动 ws 地址`或者`反向 ws 地址`(具体视框架而定)为 LangBot 监听的地址,且路径为`/ws`,例如:`ws://127.0.0.1:2280/ws`。 -`port`:设置监听的端口,默认8080,需在 Shamrock 等框架中设置为与此处一致的端口 +`port`:设置监听的端口,默认2280,需在 Napcat 等框架中设置为与此处一致的端口。使用容器启动的 LangBot 默认暴露了 2280-2290 端口,请选用其中任意一个端口。 -`access-token`:设置访问密钥,与 Shamrock 等框架中设置的保持一致 +`access-token`:设置访问密钥,与 Napcat 等框架中设置的保持一致 ### qq-botpy 适配器 @@ -68,33 +68,6 @@ - `direct_message` QQ 频道私聊消息 - `public_messages` Q群 和 列表私聊消息 -### YiriMirai 适配器 - -用于接入 Mirai。 - -```json -{ - "adapter": "yiri-mirai", - "enable": false, - "host": "127.0.0.1", - "port": 8080, - "verifyKey": "yirimirai", - "qq": 123456789 -}, -``` - -`"adapter": "yiri-mirai"`,无需改动。 - -`enable`:是否启用,配置完成后请将其设为`true` - -`host`:运行 mirai 的主机地址,一般不改动 - -`port`:设置端口,默认8080,与`mirai-api-http`里面设置的保持一致 - -`verifyKey`:密钥,默认yirimirai,与`mirai-api-http`里面设置的保持一致 - -`qq`:设置机器人QQ号,与当前mirai登录的机器人的QQ号保持一致 - ### Nakuru 适配器 用于接入 go-cqhttp。 @@ -173,6 +146,6 @@ ::: tip -阅读并完成以上教程后,请根据你部署 QChatGPT 的方式重启,你应该可以成功使用QChatGPT了,如果不能请再次阅读(你或许漏做或错做某些步骤),如果完全阅读并充分理解本文档后仍然确实无法使用,你可以在[这里](/deploy/qchatgpt/community.html)找到交流群。 +阅读并完成以上教程后,请根据你部署 LangBot 的方式重启,你应该可以成功使用了,如果不能请再次阅读(你或许漏做或错做某些步骤),如果完全阅读并充分理解本文档后仍然确实无法使用,你可以在[这里](/deploy/langbot/community.html)找到交流群。 ::: \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 606abdb3f..76346271d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,19 +3,19 @@ layout: home hero: - name: "QChatGPT" + name: "LangBot" image: src: /langbot-logo-block.png alt: LangBot-logo text: "" - tagline: "😎高稳定性、🧩支持插件、🦄多模态的 LLM QQ / QQ频道 / OneBot 机器人 / Agent 平台" + tagline: "原名 QChatGPT;😎高稳定、🧩支持插件、🦄多模态的 LLM QQ / QQ频道 / OneBot 机器人 / Agent 平台" actions: - theme: brand text: 查看文档 link: /insight/guide - theme: alt text: 代码仓库 - link: https://github.com/RockChinQ/QChatGPT + link: https://github.com/RockChinQ/LangBot features: - title: 丰富生态 diff --git a/docs/deploy/qchatgpt/community.md b/docs/insight/community.md similarity index 51% rename from docs/deploy/qchatgpt/community.md rename to docs/insight/community.md index 590895212..b84b31e22 100644 --- a/docs/deploy/qchatgpt/community.md +++ b/docs/insight/community.md @@ -12,16 +12,10 @@ > 遇到问题请先认真阅读文档,如无法解决再加群提问 -Lazy的交流群一:891448839(已满) - -Lazy的交流群二:738382634(已满) - -Lazy的交流群三:248432104(已满) - -Lazy的交流群四:619154800 ([链接](https://qm.qq.com/q/1K9GjQuza)) +Lazy的交流群:619154800 ([链接](https://qm.qq.com/q/1K9GjQuza)) ### 官方群 > 官方群不解答部署问题 -四群:195992197 [链接](https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=cSekvWmyezfCE4O8gXS7lSjkmPinjzpP&authKey=G4jHfz2%2BtQawxCRhn1ZRrQiI8bTvlepQubZL6F9fymFuz8jqZZ4FkYh6lhKLMCd9&noverify=0&group_code=195992197) \ No newline at end of file +四群:195992197 ([链接](https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=cSekvWmyezfCE4O8gXS7lSjkmPinjzpP&authKey=G4jHfz2%2BtQawxCRhn1ZRrQiI8bTvlepQubZL6F9fymFuz8jqZZ4FkYh6lhKLMCd9&noverify=0&group_code=195992197)) \ No newline at end of file diff --git a/docs/insight/guide.md b/docs/insight/guide.md index 366f26f8a..03e1b042c 100644 --- a/docs/insight/guide.md +++ b/docs/insight/guide.md @@ -4,8 +4,8 @@ 部署使用本项目请严格按照以下三步进行,其中每一步可以选择不同的方式进行。 - - 阅读 部署 QChatGPT 页,根据个人情况选择部署方式 - - 阅读 部署消息平台页 + - 阅读 部署 LangBot 页,选择部署方式 + - 阅读 部署消息平台页,选择要使用的消息平台 - 阅读 填写配置信息页,根据情况填写配置 ## 使用板块 - 阅读命令语法了解机器人可用命令,可以在对话中实现切换预设、切换模型等 diff --git a/docs/plugin/api-ref.md b/docs/plugin/dev/api-ref.md similarity index 70% rename from docs/plugin/api-ref.md rename to docs/plugin/dev/api-ref.md index 95ed8b3d2..70307af43 100644 --- a/docs/plugin/api-ref.md +++ b/docs/plugin/dev/api-ref.md @@ -1,5 +1,9 @@ # API 参考 +:::info 目录 +[[toc]] +::: + 以下 API 仅针对 事件插件 可用,组件扩展形式请自行阅读源码。 ## 消息处理 @@ -7,26 +11,26 @@ ### 回复消息 ```python -ctx.reply(message_chain: mirai.MessageChain) +ctx.reply(message_chain: MessageChain) ``` 回复此次事件的发起会话。 -- `message_chain`:[YiriMirai 的 MessageChain 对象](https://yiri-mirai.wybxc.cc/docs/basic/message-chain),若用户使用的不是 YiriMirai 适配器,程序也能自动转换为目标消息链 +- `message_chain`:[消息链对象](./messages.md),程序能自动转换为目标消息平台消息链 ### 发送主动消息 > 由于 QQ 官方 API 对主动消息的支持性很差,故若用户使用的是 QQ 官方 API,发送主动消息可能会失败 ```python -ctx.send_message(target_type: str, target_id: str, message_chain: mirai.MessageChain) +ctx.send_message(target_type: str, target_id: str, message_chain: MessageChain) ``` 发送主动消息给目标。 - `target_type`:目标类型,可选值:`"person"`、`"group"` - `target_id`:目标 ID(QQ 号或群号) -- `message_chain`:[YiriMirai 的 MessageChain 对象](https://yiri-mirai.wybxc.cc/docs/basic/message-chain),若用户使用的不是 YiriMirai 适配器,程序也能自动转换为目标消息链 +- `message_chain`:[消息链对象](./messages.md),程序能自动转换为目标消息平台消息链 ## 事件处理 diff --git a/docs/plugin/extension.md b/docs/plugin/dev/extension.md similarity index 96% rename from docs/plugin/extension.md rename to docs/plugin/dev/extension.md index 2865b61fb..0d80fde25 100644 --- a/docs/plugin/extension.md +++ b/docs/plugin/dev/extension.md @@ -1,6 +1,6 @@ # 组件扩展 -> 请先阅读[插件介绍页](./plugin-intro.md) +> 请先阅读[插件介绍页](/plugin/plugin-intro) :::info 目录 [[toc]] diff --git a/docs/plugin/dev/messages.md b/docs/plugin/dev/messages.md new file mode 100644 index 000000000..c329eab10 --- /dev/null +++ b/docs/plugin/dev/messages.md @@ -0,0 +1,74 @@ +# 消息平台实体 + +:::info 目录 +[[toc]] +::: + +LangBot 支持多种消息平台,但每个消息平台的`消息实体`格式均不相同,为了屏蔽这些差异,LangBot 具有一套统一的标准。插件开发者只需要掌握并在插件中使用此页所述的消息实体,LangBot 内部的消息处理逻辑能够自动完成消息的解析和转换。 + +:::info +LangBot 的消息平台实体是基于 [YiriMirai](https://github.com/YiriMiraiProject/YiriMirai) 的实现改造的 +::: + +## 消息链 + +消息平台的`消息`不同于用于 AI 交互的消息,消息平台的消息以`消息链`的形式描述,QQ 上展示的每一个独立的消息就是一条消息链,消息链中可以包含`文字`、`图片`、`@组件`等多种`消息链组件`,例如: + +![](/assets/image/plugin_dev_messages_01.png) + +这就是一个消息链,包含 一个 Plain 组件(Hello World)和 一个 Image 组件(乌萨奇) + +消息链和消息链组件的定义位于`pkg/platform/types/messages.py`中。 + +### 构造消息链 + +请先引入`pkg.platform.types`包,才能使用其中的消息组件。 + +```python +from pkg.platform.types import * + +# 构建一个包含文字 Hello LangBot 和图片(从URL获取)的消息 +msg_chain = MessageChain([ + Plain("Hello LangBot"), + Image(url='https://qchatgpt.rockchin.top/langbot-logo.png') +]) + +# 构建一个包含 @全体成员 和文字 Hello LangBot 的消息 +msg_chain = MessageChain([ + AtAll(), + Plain("Hello LangBot") +]) + +# 构建一个包含 @指定成员 和文字 Hello LangBot 的消息 +msg_chain = MessageChain([ + At(123456), + Plain("Hello LangBot") +]) +``` + +目前支持的消息链组件: + +- `Source` 源消息链信息,如果是从消息平台收到的消息,都会在消息链最前端包含此组件,记录消息信息 +- `Plain` 纯文本消息 +- `Quote` 引用消息 +- `Image` 图片消息 +- `AtAll` @全体成员消息 +- `At` @指定成员消息 +- `Voice` 语音消息 + - 需要检查消息平台支持性 +- `Forward` 转发消息 + - 在很多平台不受支持,不建议使用 +- `File` 文件消息 + +具体使用方式可以查看源码`pkg/platform/types/messages.py`中的定义。 + +## 消息平台事件 + +这些事件不同于 LangBot 插件事件,是消息平台系统独立的一套事件系统。这些事件是 LangBot 插件事件的源事件,可以从每个 Query.message_event 取得。 + +消息平台事件定义位于`pkg/platform/types/events.py`中。 + +## 其他实体 + +除了上述实体之外,还有`好友 Friend`和`群 Group`等实体,这些实体的定义位于`pkg/platform/types/entities.py`中。 +他们一般被包含于上述事件对象中,可以从中取得一些未被包含在插件事件中的信息。 diff --git a/docs/plugin/plugin-dev.md b/docs/plugin/dev/tutor.md similarity index 93% rename from docs/plugin/plugin-dev.md rename to docs/plugin/dev/tutor.md index eb4f01fd5..e3a943fac 100644 --- a/docs/plugin/plugin-dev.md +++ b/docs/plugin/dev/tutor.md @@ -1,6 +1,6 @@ -# 插件开发 +# 插件开发教程 -> 请先阅读[插件介绍页](./plugin-intro.md) +> 请先阅读[插件介绍页](/plugin/plugin-intro) > 建议先阅读本项目源码,了解项目架构 > 问题、需求请到仓库issue发起 @@ -15,7 +15,7 @@ 本页讲解普通插件开发步骤,插件内部有两种方法:事件监听器、内容函数。 事件监听器能在某些事件触发时进行响应,更改行为。内容函数可供大语言模型调用,具体请查看插件介绍页。 -QChatGPT 还支持组件扩展,可以不局限于监听预定事件,做到整个组件替换,具体请阅读完此页后查看**组件扩展**页。 +LangBot 还支持组件扩展,可以不局限于监听预定事件,做到整个组件替换,具体请阅读完此页后查看**组件扩展**页。 ## 💻快速开始 @@ -208,7 +208,7 @@ async def access_web(self, query, url: str): 若一个事件是一次请求(用户发送消息)中的事件,其事件对象中会含有`query`对象,这个对象中包含了此次请求(即用户发送一条消息的处理过程,一个请求过程可能会触发多个事件)处理过程中的上下文数据。 所有支持的事件,请查看`pkg.plugin.events`文件中的每个事件类的注释。 -关于`YiriMirai`支持的消息链组件,请查看 [YiriMirai的文档](https://yiri-mirai.wybxc.cc/docs/basic/message-chain) +关于`消息链组件`,请查看 [消息平台实体](./messages) ### BasePlugin 结构 @@ -218,4 +218,8 @@ async def access_web(self, query, url: str): #### self.host -在插件的方法中访问`self.host`即为`pkg.plugin.context.APIHost`类的对象,提供了主程序的一些API,详细请查看其源码。 \ No newline at end of file +在插件的方法中访问`self.host`即为`pkg.plugin.context.APIHost`类的对象,提供了主程序的一些API,详细请查看其源码。 + +### API 参考 + +关于插件可以调用的 API,请查看 [API 参考](./api-ref) diff --git a/docs/plugin/plugin-intro.md b/docs/plugin/plugin-intro.md index 344bd7a3c..8f6b1275f 100644 --- a/docs/plugin/plugin-intro.md +++ b/docs/plugin/plugin-intro.md @@ -6,15 +6,15 @@ ## 插件分类 -**插件**,是QChatGPT的扩展模块,其中包含**事件监听器**和**内容函数**两种可执行内容。事件监听器由主程序运行中的事件驱动,而内容函数由GPT生成的内容驱动。这两种驱动方式都统一包装在插件类中。 +**插件**,是LangBot的扩展模块,其中包含**事件监听器**和**内容函数**两种可执行内容。事件监听器由主程序运行中的事件驱动,而内容函数由GPT生成的内容驱动。这两种驱动方式都统一包装在插件类中。 ### 事件监听器 -插件监听 QChatGPT 运行期间的各种事件,QChatGPT 在事件发生时,携带事件相关信息调用插件注册的监听器。插件可以通过注册监听器以在指定情况下被触发。 +插件监听 LangBot 运行期间的各种事件,LangBot 在事件发生时,携带事件相关信息调用插件注册的监听器。插件可以通过注册监听器以在指定情况下被触发。 ### 内容函数 -内容函数不同于 通过事件触发插件,而是在对话期间,当对话内容符合内容函数的描述时,由 GPT 指定要调用的函数,并由 QChatGPT 进行调用。 +内容函数不同于 通过事件触发插件,而是在对话期间,当对话内容符合内容函数的描述时,由 GPT 指定要调用的函数,并由 LangBot 进行调用。 这是基于 [GPT的Function Calling能力](https://platform.openai.com/docs/guides/gpt/function-calling) 实现的,这是一种嵌入对话中,由GPT自动调用的函数。 > 就是 ChatGPT官方插件 那种东西 @@ -28,7 +28,7 @@ Q:阅读并总结这篇文章:https://zhuanlan.zhihu.com/p/607570830 Q:搜一下清远今天天气如何 ``` -GPT将会回复一个对`access_the_web`的函数调用请求,QChatGPT将调用插件提供的内容函数,并返回调用结果给GPT使其生成新的回复。 +GPT将会回复一个对`access_the_web`的函数调用请求,LangBot将调用插件提供的内容函数,并返回调用结果给GPT使其生成新的回复。 当然,函数调用功能不止局限于网络访问,还可以实现图片处理、科学计算、行程规划等需要调用函数的功能,理论上我们可以通过内容函数实现与`ChatGPT Plugins`相同的功能。 ## 插件用法 diff --git a/docs/plugin/tech-info.md b/docs/plugin/tech-info.md index bcec00397..1f5852027 100644 --- a/docs/plugin/tech-info.md +++ b/docs/plugin/tech-info.md @@ -1,8 +1,8 @@ # 技术信息 -以下是QChatGPT实现原理等技术信息,贡献之前请仔细阅读 +以下是LangBot实现原理等技术信息,贡献之前请仔细阅读 -> 此文档为 QChatGPT 2.x 的技术文档,已过时,3.x 版本请直接查看源码。 +> 此文档为 LangBot 2.x 的技术文档,已过时,3.x 版本请直接查看源码。 > 请先阅读OpenAI API的相关文档 https://beta.openai.com/docs/ ,以下信息假定您已了解OpenAI模型的相关特性及其接口的调用方法。 ## 术语 diff --git a/docs/tob/index.md b/docs/tob/index.md index ce11df867..2d4065434 100644 --- a/docs/tob/index.md +++ b/docs/tob/index.md @@ -1,5 +1,5 @@ # 规模使用和商用指南 -QChatGPT 已经具备了一定的生产能力,目前已在多家公司的生产环境运行并承担一定的业务。我们相信您非常重视合规性和稳定性方面的问题,此章节将基于一些已有的案例讲解商用最佳实践。 +LangBot 已经具备了一定的生产能力,目前已在多家公司的生产环境运行并承担一定的业务。我们相信您非常重视合规性和稳定性方面的问题,此章节将基于一些已有的案例讲解商用最佳实践。 请点击左侧目录查看具体内容。 \ No newline at end of file diff --git a/docs/tob/platform.md b/docs/tob/platform.md index 5fb995d84..3a8fa0a69 100644 --- a/docs/tob/platform.md +++ b/docs/tob/platform.md @@ -22,7 +22,7 @@ ## 使用 QQ 官方机器人 API -腾讯官方在23年下半年开放了Q群机器人API,QChatGPT 很好地支持这个 API,可以查看部署教程中的配置方式使用。 +腾讯官方在23年下半年开放了Q群机器人API,LangBot 很好地支持这个 API,可以查看部署教程中的配置方式使用。 但 QQ 官方机器人API具有以下已知的局限性: diff --git a/docs/tob/provider.md b/docs/tob/provider.md index cf6055f61..d8a2b4fd1 100644 --- a/docs/tob/provider.md +++ b/docs/tob/provider.md @@ -4,7 +4,7 @@ > > - [生成式人工智能服务管理暂行办法](https://www.cac.gov.cn/2023-07/13/c_1690898327029107.htm) -在内容管控方面,QChatGPT 内置了`关键词检测`、`百度智能云审核`等内容过滤器,具体请查看配置文件章节。 +在内容管控方面,LangBot 内置了`关键词检测`、`百度智能云审核`等内容过滤器,具体请查看配置文件章节。 在实践中,应该辅以群内管理员禁言之类的方式管控内容,模型方面,以下是推荐的方案(按推荐顺序): diff --git a/docs/usage/command.md b/docs/usage/command.md index ed50eb927..3ebf380c4 100644 --- a/docs/usage/command.md +++ b/docs/usage/command.md @@ -1,4 +1,4 @@ -# QChatGPT的命令讲解 +# LangBot 命令详解 > `<>` 中的为必填参数,使用时请不要包含`<>` > `[]` 中的为可选参数,使用时请不要包含`[]` diff --git a/docs/usage/faq.md b/docs/usage/faq.md index 375ed99d3..bbb8e4791 100644 --- a/docs/usage/faq.md +++ b/docs/usage/faq.md @@ -1,4 +1,4 @@ -# QChatGPT的常见问题 +# LangBot 常见问题 ## Q:官方机器人 IP 白名单怎么填? diff --git a/docs/usage/plugin-list.md b/docs/usage/plugin-list.md index 10daa7686..280829e65 100644 --- a/docs/usage/plugin-list.md +++ b/docs/usage/plugin-list.md @@ -3,16 +3,16 @@ 以下是部分插件列表,所有插件请查看[RockChinQ的Star集](https://github.com/stars/RockChinQ/lists/qchatgpt-%E6%8F%92%E4%BB%B6) - [WebwlkrPlugin](https://github.com/RockChinQ/WebwlkrPlugin) - 让机器人能联网!! -- [https://github.com/the-lazy-me/NewChatVoice](https://github.com/the-lazy-me/miHoYoVoice) - QChatGPT语音插件,可利用多个TTS平台实现语音聊天 +- [https://github.com/the-lazy-me/NewChatVoice](https://github.com/the-lazy-me/miHoYoVoice) - LangBot语音插件,可利用多个TTS平台实现语音聊天 - [Yuumi0221/URLMaskerPlugin](https://github.com/Yuumi0221/URLMaskerPlugin) - 用于掩码(替换)URL,以应对QQ官方机器人API对消息中URL的限制 -- [ElvisChenML/Waifu](https://github.com/ElvisChenML/Waifu) - 一个QChatGPT的插件,旨在利用程式逻辑搭配LLM创建真实感聊天机器人,探索真实的聊天体验。 -- [Pevernow/QChatGPT_Plugin_Emoticon_v3](https://github.com/Pevernow/QChatGPT_Plugin_Emoticon_v3) - QChatGPT v3可用,基于在线api的表情包插件。 -- [https://github.com/kirifujinagisa/RussianRoulette](https://github.com/kirifujinagisa/RussianRoulette) - 一个qchatgpt俄罗斯轮盘赌的游戏插件 -- [https://github.com/kirifujinagisa/FileSender](https://github.com/kirifujinagisa/FileSender) - 基于qchatgpt的将本机指定文件发送给申请人的插件 -- [https://github.com/ElvisChenML/GalgameMaker](https://github.com/ElvisChenML/GalgameMaker) - QChatGPT 插件,用于快速生成在QQ对话中进行的Galgame。 +- [ElvisChenML/Waifu](https://github.com/ElvisChenML/Waifu) - 一个LangBot的插件,旨在利用程式逻辑搭配LLM创建真实感聊天机器人,探索真实的聊天体验。 +- [Pevernow/LangBot_Plugin_Emoticon_v3](https://github.com/Pevernow/QChatGPT_Plugin_Emoticon_v3) - LangBot v3可用,基于在线api的表情包插件。 +- [https://github.com/kirifujinagisa/RussianRoulette](https://github.com/kirifujinagisa/RussianRoulette) - 一个 LangBot 俄罗斯轮盘赌的游戏插件 +- [https://github.com/kirifujinagisa/FileSender](https://github.com/kirifujinagisa/FileSender) - 基于 LangBot 的将本机指定文件发送给申请人的插件 +- [https://github.com/ElvisChenML/GalgameMaker](https://github.com/ElvisChenML/GalgameMaker) - LangBot 插件,用于快速生成在QQ对话中进行的Galgame。 - [https://github.com/zzseki/QChatGPT_Plugin_News](https://github.com/zzseki/QChatGPT_Plugin_News) - 无介绍(看仓库名猜一下吧) - [https://github.com/zzseki/QChatGPT_Plugin_Weather ](https://github.com/zzseki/QChatGPT_Plugin_Weather)- 无介绍(看仓库名猜一下吧) - [https://github.com/zzseki/QChatGPT_Plugin_Music](https://github.com/zzseki/QChatGPT_Plugin_Music) - 无介绍(看仓库名猜一下吧) -- [https://github.com/inkOrCloud/Markdown2IMG](https://github.com/inkOrCloud/Markdown2IMG) - QChatGPT插件,将markdown文本转为图片输出 +- [https://github.com/inkOrCloud/Markdown2IMG](https://github.com/inkOrCloud/Markdown2IMG) - LangBot插件,将markdown文本转为图片输出 - [https://github.com/Annalasu/QcPlugin_Md2QQImage](https://github.com/Annalasu/QcPlugin_Md2QQImage) - 将消息中的md图片链接显示为正常图片 -- [https://github.com/the-lazy-me/SillyTavernPlugin](https://github.com/the-lazy-me/SillyTavernPlugin) - QChatGPT插件,可将酒馆SillyTavern的角色卡转写,以适配QChatGPT的人格预设 \ No newline at end of file +- [https://github.com/the-lazy-me/SillyTavernPlugin](https://github.com/the-lazy-me/SillyTavernPlugin) - LangBot插件,可将酒馆SillyTavern的角色卡转写,以适配LangBot的人格预设 \ No newline at end of file diff --git a/docs/webui/intro.md b/docs/webui/intro.md new file mode 100644 index 000000000..f34a1ef9b --- /dev/null +++ b/docs/webui/intro.md @@ -0,0 +1,21 @@ +# 管理面板(Beta测试) + +管理面板(WebUI)将在 v3.4.0 版本开始 Beta 测试,有任何问题或建议欢迎反馈到:https://github.com/RockChinQ/LangBot/issues + +![WebUI](/assets/image/webui_intro_01.png) + +## 部署 WebUI + +依据本文档所述的部署方式新部署的实例,均自带 WebUI,默认启用。 + +### 从低于 3.4.0 版本升级的实例? + +若是使用 Docker 拉取最新的镜像,也自带有 WebUI;若是手动部署的实例,请从 [Releases](https://github.com/RockChinQ/LangBot) 页面下载最新版的 `langbot-xxx-all.zip` 文件,解压覆盖之前部署的代码目录。 + +## 未实现功能 + +- Prompt 编辑器:单独一页,实现一个直观、便捷的 Prompt 编辑器。 +- 消息平台管理页:现在仅支持在 设置 页修改消息平台,后续将把消息平台的修改、重载、统计整合到单独一页。 +- 元数据文件编辑:目前暂不支持元数据编辑,请先根据文档修改文件内容来编辑。 +- 模型数据更改:动态编辑模型元数据、所使用的模型、各会话区分模型等功能将在元数据编辑支持后规划,目前请先根据文档手动编辑文件。 + diff --git a/docs/webui/settings.md b/docs/webui/settings.md new file mode 100644 index 000000000..41c9b9d4f --- /dev/null +++ b/docs/webui/settings.md @@ -0,0 +1,31 @@ +# 设置项管理 + +设置项编辑页的内容均对应[功能配置页](/config/function/platform.html)中各个配置文件的内容。目前支持`可视化编辑`和`JSON编辑`两种,JSON 编辑器与功能配置页中的配置文件内容一致,可直接编辑。 + +## 可视化编辑 + +### 基本字段 + +基本的字段直接编辑或者选择即可。 + +![开关](/assets/image/webui_settings_01.png) + +![文本框](/assets/image/webui_settings_02.png) + +### 字符串数组 + +输入要添加的字符串,按回车键即可添加。 + +![字符串数组](/assets/image/webui_settings_03.png) + +### 对象数组 + +例如消息平台适配器,数组内均为对象,可以点击下方`添加`按钮,添加新的适配器,选择类型后会展示对应需要填写的参数,按照文档所述填写。 + +![对象数组](/assets/image/webui_settings_04.png) + +![添加对象](/assets/image/webui_settings_05.png) + +::: tip +消息平台适配器更改之后需要手动进行[`热重载`](/webui/system.html#%E7%83%AD%E9%87%8D%E8%BD%BD)以生效 +::: \ No newline at end of file diff --git a/docs/webui/system.md b/docs/webui/system.md new file mode 100644 index 000000000..7a4e42e9d --- /dev/null +++ b/docs/webui/system.md @@ -0,0 +1,17 @@ +# 系统操作 + +## 任务列表 + +任务列表中跟踪了`插件更新`、`插件安装`、`插件删除`等耗时任务的进度。 +点击侧栏下方的任务列表按钮,在任务列表对话框,可以查看任务执行步骤、日志等信息。 + +![任务列表对话框](/assets/image/webui_system_02.png) + +![任务日志](/assets/image/webui_system_03.png) + +## 热重载 + +目前支持热重载 消息平台 和 插件,点击侧栏下方的系统信息中的对应按钮即可。 +在修改了 `消息平台适配器配置` 之后需要手动热重载,插件更改则会自动热重载。 + +![热重载](/assets/image/webui_system_04.png) \ No newline at end of file diff --git a/docs/workshop/dify-integration.md b/docs/workshop/dify-integration.md index b7abc0123..6bd9ec7b8 100644 --- a/docs/workshop/dify-integration.md +++ b/docs/workshop/dify-integration.md @@ -1,18 +1,18 @@ -# 在 QChatGPT 上接入 Dify(NewAPI 中转方案) +# 在 LangBot 上接入 Dify(NewAPI 中转方案) ::: info 本文由社区贡献者编写。 ::: -[Dify](https://dify.ai/) 是一个开源的 AI 应用开发平台,支持多种 AI 模型和丰富的插件,用于快速搭建 AI Agent、Workflow 等应用。通过中间件,我们可以在 QChatGPT 上使用 Dify 功能。 +[Dify](https://dify.ai/) 是一个开源的 AI 应用开发平台,支持多种 AI 模型和丰富的插件,用于快速搭建 AI Agent、Workflow 等应用。通过中间件,我们可以在 LangBot 上使用 Dify 功能。 ::: warning -本教程使用的为 Linux 系统且已配置好 QChatGPT 的消息平台为前提,如您完全没有听说过 Linux 或者没有听说过 Debian 请不要使用此教程。如 QChatGPT 没部署,请先配置好 QChatGPT 再来参考此教程。 +本教程使用的为 Linux 系统且已配置好 LangBot 的消息平台为前提,如您完全没有听说过 Linux 或者没有听说过 Debian 请不要使用此教程。如 LangBot 没部署,请先配置好 LangBot 再来参考此教程。 ::: ## 安装并配置 Docker -Dify 推荐使用 Docker 安装,如果你已经使用 Docker 启动 QChatGPT,那么你可以跳过此步骤。 +Dify 推荐使用 Docker 安装,如果你已经使用 Docker 启动 LangBot,那么你可以跳过此步骤。 ```bash # Debian使用: @@ -227,10 +227,10 @@ http://你的服务器地址:3000/ new-api基本配置完成其余内容自行根据需要配置。 -## 配置 QChatGPT +## 配置 LangBot 使用 OpenAI provider,将 NewAPI 的 地址作为 API 地址,将 NewAPI 的 key 作为 API Key。 -![QChatGPT 修改 key](/assets/image/dify_14.png) +![LangBot 修改 key](/assets/image/dify_14.png) -重启 QChatGPT 项目,接入 dify 已完成。 +重启 LangBot 项目,接入 dify 已完成。 diff --git a/docs/workshop/one-api.md b/docs/workshop/one-api.md index 349b513bf..d5543f5bf 100644 --- a/docs/workshop/one-api.md +++ b/docs/workshop/one-api.md @@ -1,12 +1,12 @@ -# 在 QChatGPT 上接入 OneAPI、LinkAI 等第三方 OpenAI 格式接口 +# 在 LangBot 上接入 OneAPI、LinkAI 等第三方 OpenAI 格式接口 ::: info 转载自:[https://rockchin.top/?p=295](https://rockchin.top/?p=295) ::: -自从 OneAPI 流行之后,各种“牛鬼蛇神”模型都能以 OpenAI 的格式访问了,还有中转站也开始流行,OpenAI 的格式也成为了 AI App 平台等各种 AI 工具的访问格式,本文介绍如何将上述的支持 OpenAI 格式的接口接入 QChatGPT。 +自从 OneAPI 流行之后,各种“牛鬼蛇神”模型都能以 OpenAI 的格式访问了,还有中转站也开始流行,OpenAI 的格式也成为了 AI App 平台等各种 AI 工具的访问格式,本文介绍如何将上述的支持 OpenAI 格式的接口接入 LangBot。 -首先我们先按照 QChatGPT 的文档,部署好 消息平台、QChatGPT 主程序,并将其连接上,进行到 provider.json 配置这一步时,看此文档。 +首先我们先按照 LangBot 的文档,部署好 消息平台、LangBot 主程序,并将其连接上,进行到 provider.json 配置这一步时,看此文档。 以下我们不再区分 LinkAI、OneAPI、中转站,统一以 OneAPI接口 代指 第三方OpenAI接口。 @@ -30,23 +30,23 @@ 其他的中转站请看其文档或咨询负责人。 -## 填写到 QChatGPT 配置文件 +## 填写到 LangBot 配置文件 修改 data/config/provider.json 中的 provider 配置,使用 openai-chat-completions 请求器: -![填写到 QChatGPT 配置文件](/assets/image/one-api-03.png) +![填写到 LangBot 配置文件](/assets/image/one-api-03.png) 把你刚刚的地址填写到图中显示位置的 base-url 中,本例是我的 OneAPI 站(自用)。 接着把你刚刚的密钥填写到 keys 的 openai 组中: -![填写到 QChatGPT 配置文件](/assets/image/one-api-04.png) +![填写到 LangBot 配置文件](/assets/image/one-api-04.png) 请注意符合 JSON 语法。 最后配置所使用的模型,填写你 OneAPI 上提供的模型名称。 -![填写到 QChatGPT 配置文件](/assets/image/one-api-05.png) +![填写到 LangBot 配置文件](/assets/image/one-api-05.png) 注意,可用的模型名称已经预设了一些在 data/metadata/llm-models.json 元数据里,如果你使用的模型没有相应的元数据,需要自己添加。 diff --git a/package-lock.json b/package-lock.json index 7a583c02a..80b86a8dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "QChatGPT-Wiki", + "name": "LangBot Docs", "lockfileVersion": 3, "requires": true, "packages": {