From 2ea65ca251134c2e0579949aa25b50b47f85f2bd Mon Sep 17 00:00:00 2001 From: sudoskys Date: Wed, 1 May 2024 09:54:27 +0000 Subject: [PATCH] deploy: 6c2b8d94a5905895577bc289ff18429e06f2e614 --- 404.html | 2 +- ...n3.js => en_guide_getting-started.md.wf9vgJEi.js} | 2 +- ... => en_guide_getting-started.md.wf9vgJEi.lean.js} | 2 +- ...wlLHt.js => guide_getting-started.md.CctWEGYW.js} | 8 ++++---- assets/guide_getting-started.md.CctWEGYW.lean.js | 1 + assets/guide_getting-started.md.D7bwlLHt.lean.js | 1 - dev/arch.html | 2 +- dev/basic.html | 2 +- dev/client.html | 2 +- en/dev/arch.html | 2 +- en/dev/basic.html | 2 +- en/dev/client.html | 2 +- en/guide/command.html | 2 +- en/guide/getting-started.html | 6 +++--- en/guide/maintain.html | 2 +- en/guide/service.html | 2 +- en/index.html | 2 +- guide/command.html | 2 +- guide/getting-started.html | 12 ++++++------ guide/maintain.html | 2 +- guide/service.html | 2 +- hashmap.json | 2 +- index.html | 2 +- 23 files changed, 32 insertions(+), 32 deletions(-) rename assets/{en_guide_getting-started.md.Bj1ZYln3.js => en_guide_getting-started.md.wf9vgJEi.js} (99%) rename assets/{en_guide_getting-started.md.Bj1ZYln3.lean.js => en_guide_getting-started.md.wf9vgJEi.lean.js} (86%) rename assets/{guide_getting-started.md.D7bwlLHt.js => guide_getting-started.md.CctWEGYW.js} (85%) create mode 100644 assets/guide_getting-started.md.CctWEGYW.lean.js delete mode 100644 assets/guide_getting-started.md.D7bwlLHt.lean.js diff --git a/404.html b/404.html index d8e2078..aa8c15d 100644 --- a/404.html +++ b/404.html @@ -16,7 +16,7 @@
Skip to content

404

PAGE NOT FOUND

But if you don't change your direction, and if you keep looking, you may end up where you are heading.

Released under the GFDL License.

- + \ No newline at end of file diff --git a/assets/en_guide_getting-started.md.Bj1ZYln3.js b/assets/en_guide_getting-started.md.wf9vgJEi.js similarity index 99% rename from assets/en_guide_getting-started.md.Bj1ZYln3.js rename to assets/en_guide_getting-started.md.wf9vgJEi.js index ab30685..eb1c12a 100644 --- a/assets/en_guide_getting-started.md.Bj1ZYln3.js +++ b/assets/en_guide_getting-started.md.wf9vgJEi.js @@ -1,4 +1,4 @@ -import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F=JSON.parse('{"title":"📝 Deployment Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/getting-started.md","filePath":"en/guide/getting-started.md","lastUpdated":1714398384000}'),n={name:"en/guide/getting-started.md"},t=e(`

📝 Deployment Guide

📦 System Check

For Debian servers, please make sure that your system locale is set to UTF8. Otherwise, use dpkg-reconfigure locales command to configure the language.

Please ensure that your server has more than 1GB of memory.

Note

We have fallback options in case you don't deploy Redis and MongoDB. We will use an in-memory database in such cases, which is sufficient for general usage. However, if you need to store data for a long time, we recommend deploying Redis and MongoDB. But RabbitMQ is required.

📦 Quick Start

If you are using a fresh server, you can use the following shell command to automatically install this project.

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

🥽 Manual Installation

shell
# Install Voice dependencies
+import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F=JSON.parse('{"title":"📝 Deployment Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/getting-started.md","filePath":"en/guide/getting-started.md","lastUpdated":1714557226000}'),n={name:"en/guide/getting-started.md"},t=e(`

📝 Deployment Guide

📦 System Check

For Debian servers, please make sure that your system locale is set to UTF8. Otherwise, use dpkg-reconfigure locales command to configure the language.

Please ensure that your server has more than 1GB of memory.

Note

We have fallback options in case you don't deploy Redis and MongoDB. We will use an in-memory database in such cases, which is sufficient for general usage. However, if you need to store data for a long time, we recommend deploying Redis and MongoDB. But RabbitMQ is required.

📦 Quick Start

If you are using a fresh server, you can use the following shell command to automatically install this project.

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

🥽 Manual Installation

shell
# Install Voice dependencies
 apt install ffmpeg
 # Install RabbitMQ
 docker pull rabbitmq:3.10-management
diff --git a/assets/en_guide_getting-started.md.Bj1ZYln3.lean.js b/assets/en_guide_getting-started.md.wf9vgJEi.lean.js
similarity index 86%
rename from assets/en_guide_getting-started.md.Bj1ZYln3.lean.js
rename to assets/en_guide_getting-started.md.wf9vgJEi.lean.js
index 65bc448..c095681 100644
--- a/assets/en_guide_getting-started.md.Bj1ZYln3.lean.js
+++ b/assets/en_guide_getting-started.md.wf9vgJEi.lean.js
@@ -1 +1 @@
-import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F=JSON.parse('{"title":"📝 Deployment Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/getting-started.md","filePath":"en/guide/getting-started.md","lastUpdated":1714398384000}'),n={name:"en/guide/getting-started.md"},t=e("",99),l=[t];function h(p,o,r,d,k,c){return i(),a("div",null,l)}const u=s(n,[["render",h]]);export{F as __pageData,u as default};
+import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F=JSON.parse('{"title":"📝 Deployment Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/getting-started.md","filePath":"en/guide/getting-started.md","lastUpdated":1714557226000}'),n={name:"en/guide/getting-started.md"},t=e("",99),l=[t];function h(p,o,r,d,k,c){return i(),a("div",null,l)}const u=s(n,[["render",h]]);export{F as __pageData,u as default};
diff --git a/assets/guide_getting-started.md.D7bwlLHt.js b/assets/guide_getting-started.md.CctWEGYW.js
similarity index 85%
rename from assets/guide_getting-started.md.D7bwlLHt.js
rename to assets/guide_getting-started.md.CctWEGYW.js
index 982de4c..19a9d11 100644
--- a/assets/guide_getting-started.md.D7bwlLHt.js
+++ b/assets/guide_getting-started.md.CctWEGYW.js
@@ -1,4 +1,4 @@
-import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F=JSON.parse('{"title":"📝 部署指南","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started.md","filePath":"guide/getting-started.md","lastUpdated":1714398384000}'),n={name:"guide/getting-started.md"},t=e(`

📝 部署指南

📦 检查系统

对于 Debian 服务器,请确认您的系统语言集为 UTF8,否则输入 dpkg-reconfigure locales 配置语言。

请确认您服务器的内存大于 1G

提示

我们有 fallback 方案,如果您不部署 RedisMongoDB,我们会使用内存数据库。对于一般的使用,这是足够的。 不过如果您需要长时间存储数据,我们建议您部署 RedisMongoDB。 但是 RabbitMQ 是必须的。

📦 快速开始

如果您使用全新服务器,您可以使用以下 Shell 自动安装本项目。

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

🥽 手动安装

shell
# Install Voice dependencies
+import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const g=JSON.parse('{"title":"📝 部署指南","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started.md","filePath":"guide/getting-started.md","lastUpdated":1714557226000}'),n={name:"guide/getting-started.md"},t=e(`

📝 部署指南

📦 检查系统

对于 Debian 服务器,请确认您的系统语言集为 UTF8,否则输入 dpkg-reconfigure locales 配置语言。

请确认您服务器的内存大于 1G

提示

我们有 fallback 方案,如果您不部署 RedisMongoDB,我们会使用内存数据库。对于一般的使用,这是足够的。 不过如果您需要长时间存储数据,我们建议您部署 RedisMongoDB。 但是 RabbitMQ 是必须的。

📦 快速开始

如果您使用全新服务器,您可以使用以下 Shell 自动安装本项目。

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

🥽 手动安装

shell
# Install Voice dependencies
 apt install ffmpeg
 # Install RabbitMQ
 docker pull rabbitmq:3.10-management
@@ -21,7 +21,7 @@ import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F
 # Host
 apt install npm
 npm install pm2 -g
-pm2 start pm2.json

🥽 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

  • 使用 pip uninstall llm-kira 卸载旧内核。(如果有)

  • 使用 pip uninstall llmkira 卸载插件开发工具。(否则会造成冲突)

  • 确认您的 Python 版本为 3.9 或以上。

  • 安装 Docker

TIP

安装 Docker 可以参考 官方文档

安装 Docker Compose 可以参考 官方文档

或者 博客文章

Windows 用户可以安装 Docker Desktop

请确保您的数据库在一个网桥/局域网内,否则会链接失败。

此时您可以尝试使用 Docker 运行机器人,如果您不想使用 Docker,您可以继续阅读。

🍜 数据库支持

🍫 安装 Redis

提供两种方式安装缓存数据库,您可以选择其中一种。

通过命令行安装

bash
# 安装 Redis
+pm2 start pm2.json

🥽 Docker

提示

如果你使用 Docker 运行本项目,你会启动 Redis, MongoDB 和 RabbitMQ。如果你本地运行,可以只启动 RabbitMQ。

Build Hub: sudoskys/llmbot

  • 使用 pip uninstall llm-kira 卸载旧内核。(如果有)

  • 使用 pip uninstall llmkira 卸载插件开发工具。(否则会造成冲突)

  • 确认您的 Python 版本为 3.9 或以上。

  • 安装 Docker

TIP

安装 Docker 可以参考 官方文档

安装 Docker Compose 可以参考 官方文档

或者 博客文章

Windows 用户可以安装 Docker Desktop

请确保您的数据库在一个网桥/局域网内,否则会链接失败。

此时您可以尝试使用 Docker 运行机器人,如果您不想使用 Docker,您可以继续阅读。

🍜 数据库支持

🍫 安装 Redis

提供两种方式安装缓存数据库,您可以选择其中一种。

通过命令行安装

bash
# 安装 Redis
 apt-get install redis
 systemctl enable redis.service --now

通过 Docker 安装

bash
docker pull redis:latest
 docker run -d -p 6379:6379 \\
@@ -47,7 +47,7 @@ import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F
 pm2 start pm2.json

其他命令

shell
pm2 stop pm2.json # 停止
 pm2 restart pm2.json # 重启
 pm2 status pm2.json # 查看状态

Shell 运行

bash
python3 start_sender.py
-python3 start_receiver.py

提示

当您退出当前 Shell 时,机器人也会退出。您可以使用 nohup 命令来挂起机器人。不过我们不推荐这样做。

🫙 运行配置

配置相应的环境变量即可运行对应的机器人。

🥽 一些运行时环境变量

| 变量名 | 值| 描述 | |--------------------------------|------------------------------------|-- -------------------------------------------------- ----------| | STOP_REPLY | 1 | 如果值为 1,则停止接收回复 | | DEBUG | 调试| 如果被配置为任何值,则将长调试日志打印到终端上。 |

🥛 Telegram

ini
TELEGRAM_BOT_TOKEN = 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+python3 start_receiver.py

提示

当您退出当前 Shell 时,机器人也会退出。您可以使用 nohup 命令来挂起机器人。不过我们不推荐这样做。

🫙 运行配置

配置相应的环境变量即可运行对应的机器人。

🥽 一些运行时环境变量

变量名描述
STOP_REPLY1如果值为 1,则停止接收回复
DEBUG调试如果被配置为任何值,则将长调试日志打印到终端上。

🥛 Telegram

ini
TELEGRAM_BOT_TOKEN = 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
 TELEGRAM_BOT_PROXY_ADDRESS = socks5://127.0.0.1:7890
变量名称说明获取
TELEGRAM_BOT_TOKENTelegramBotTelegram Bot
TELEGRAM_BOT_PROXY_ADDRESSAiohttp

🍖 Discord

ini
DISCORD_BOT_TOKEN = Y0NzY0NzY0NzY0NzY0NzY0.DsYQDQ.0
 DISCORD_BOT_PREFIX = !
 DISCORD_BOT_PROXY_ADDRESS = socks5://

申请 Discord Bot 请移步 官方平台

点开 oauth2/url-generator,选中权限组 bot 您需要勾选的权限如下:

ini
\`Send Messages\`
@@ -66,4 +66,4 @@ import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F
 SLACK_BOT_PROXY_ADDRESS = http

打开 Slack App Center,创建一个新的应用程序。

  • 配置密钥

在主页上找到 Signing Secret 选项卡,寻找 SLACK_SIGNING_SECRET

找到 App-Level Tokens 选项卡,寻找 SLACK_APP_TOKEN

打开 Oauth 选项卡,找到 Bot User OAuth Token,将其作为 SLACK_BOT_TOKEN

  • 启用套接字模式

开启 Socket Mode

  • 开启事件订阅

前往 event-subscriptions ,在页面上启用 Event Subscriptions ,订阅以下事件:message.channelsmessage.immessage.groups

  • 开启读写权限

前往 oauth ,找到 Bot Token Scopes ,并选择以下权限:chat:writechannels:readcommandsfiles:readfiles:writeim:readim:historygroup:historyim:writechannel:writechannel:history (可能会有额外的一些权限)。

  • 注册所有 Slash 命令

前往 Slash Commands ,注册所有 Slash 命令。命令表见 命令指南

重新安装 APP,并将您的机器人邀请到频道中,使用 @BOT 调用您的机器人.

🍔 Kook

ini
KOOK_BOT_TOKEN = 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890

转到 Kook 开发者中心,左上角新建应用。

获取,填入您的 Kook 机器人 Token 即可。

🍤 配置Openai端点

登陆采用两个方案。

  • 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>$<tool model such as gpt-3.5-turbo> to login

当然,你可以配置全局模型,给没有登陆的用户使用。

dotenv
GLOBAL_OAI_KEY=sk-xxx
 GLOBAL_OAI_MODEL=gpt-3.5-turbo
 GLOBAL_OAI_TOOL_MODEL=gpt-3.5-turbo
-GLOBAL_OAI_ENDPOINT=https://api.openai.com/v1/

提示

GLOBAL_OAI_TOOL_MODEL 是全局工具模型,只是用于逻辑判断,调用频率会比较高。

🍟 使用非 Openai 模型

你可以使用 gatewayone-api 作为转换器。或者使用在线服务商,如 OhMyGpt

如果你在使用 Azure ,请确认你使用的版本支持 functions。

`,103),l=[t];function p(h,k,o,d,r,c){return i(),a("div",null,l)}const y=s(n,[["render",p]]);export{F as __pageData,y as default}; +GLOBAL_OAI_ENDPOINT=https://api.openai.com/v1/

提示

GLOBAL_OAI_TOOL_MODEL 是全局工具模型,只是用于逻辑判断,调用频率会比较高。

🍟 使用非 Openai 模型

你可以使用 gatewayone-api 作为转换器。或者使用在线服务商,如 OhMyGpt

如果你在使用 Azure ,请确认你使用的版本支持 functions。

`,103),l=[t];function p(h,k,d,o,r,c){return i(),a("div",null,l)}const y=s(n,[["render",p]]);export{g as __pageData,y as default}; diff --git a/assets/guide_getting-started.md.CctWEGYW.lean.js b/assets/guide_getting-started.md.CctWEGYW.lean.js new file mode 100644 index 0000000..00b72d0 --- /dev/null +++ b/assets/guide_getting-started.md.CctWEGYW.lean.js @@ -0,0 +1 @@ +import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const g=JSON.parse('{"title":"📝 部署指南","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started.md","filePath":"guide/getting-started.md","lastUpdated":1714557226000}'),n={name:"guide/getting-started.md"},t=e("",103),l=[t];function p(h,k,d,o,r,c){return i(),a("div",null,l)}const y=s(n,[["render",p]]);export{g as __pageData,y as default}; diff --git a/assets/guide_getting-started.md.D7bwlLHt.lean.js b/assets/guide_getting-started.md.D7bwlLHt.lean.js deleted file mode 100644 index 8c4e4d6..0000000 --- a/assets/guide_getting-started.md.D7bwlLHt.lean.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as s,c as a,o as i,a1 as e}from"./chunks/framework.D0kgyeKq.js";const F=JSON.parse('{"title":"📝 部署指南","description":"","frontmatter":{},"headers":[],"relativePath":"guide/getting-started.md","filePath":"guide/getting-started.md","lastUpdated":1714398384000}'),n={name:"guide/getting-started.md"},t=e("",103),l=[t];function p(h,k,o,d,r,c){return i(),a("div",null,l)}const y=s(n,[["render",p]]);export{F as __pageData,y as default}; diff --git a/dev/arch.html b/dev/arch.html index 56be257..ec0942d 100644 --- a/dev/arch.html +++ b/dev/arch.html @@ -19,7 +19,7 @@
Skip to content

Released under the GFDL License.

- + \ No newline at end of file diff --git a/dev/basic.html b/dev/basic.html index a8fabd1..03fa87a 100644 --- a/dev/basic.html +++ b/dev/basic.html @@ -277,7 +277,7 @@ - name: Publish package distributions to PyPI run: pdm publish

🔧 发布

仓库主界面右下角新建 Release, 新建 pypi- 开头的标签,创建后即可触发自动发布。

- + \ No newline at end of file diff --git a/dev/client.html b/dev/client.html index 3635960..5c05299 100644 --- a/dev/client.html +++ b/dev/client.html @@ -19,7 +19,7 @@
Skip to content

📝 平台开发手册

🗞 响应特性指标

指标描述ID
追溯触发识别被回复后响应0
AT触发被At后触发1
私聊事件私聊2
群聊事件群聊3
文件支持支持文件上传下载4
媒体支持媒体上传下载5
链运行支持是否支持多回复6
富文本支持Markdown7
定时器支持是否随时可通知8

Released under the GFDL License.

- + \ No newline at end of file diff --git a/en/dev/arch.html b/en/dev/arch.html index a7ab267..0d992f1 100644 --- a/en/dev/arch.html +++ b/en/dev/arch.html @@ -19,7 +19,7 @@
Skip to content

Released under the GFDL License.

- + \ No newline at end of file diff --git a/en/dev/basic.html b/en/dev/basic.html index 0184a06..09a0cfe 100644 --- a/en/dev/basic.html +++ b/en/dev/basic.html @@ -245,7 +245,7 @@ - name: Publish package distributions to PyPI run: pdm publish

🔧 Publish

Create a Release from the repository main page, create a tag starting with pypi-, and it will trigger the automatic publishing.

- + \ No newline at end of file diff --git a/en/dev/client.html b/en/dev/client.html index c900c34..451f437 100644 --- a/en/dev/client.html +++ b/en/dev/client.html @@ -19,7 +19,7 @@
Skip to content

Released under the GFDL License.

- + \ No newline at end of file diff --git a/en/guide/command.html b/en/guide/command.html index 8369b32..190c945 100644 --- a/en/guide/command.html +++ b/en/guide/command.html @@ -30,7 +30,7 @@ learn - Learn your instructions, /learn reset to clear

Suggestions

In some platforms, such as Slack platform, auth chat task ask commands need to start with !.

Some platforms additionally support the @Bot method, such as the Slack platform. The @Bot command is equivalent to the chat command.

🥽 Diff of modes

ini
chat - chat
 task - task
 ask - just answer

Among them, chat mode is the default mode, task mode enables function response, and ask mode disables function response.

🧁 ENV

shell
env - virtual environment settings

This command provides an interactive env between the plugin and the user. The user can submit the constants required by the plugin through this command.

For example /env VAR=551;VAR2=asdasd;VAR3="1231"

All keys(name) will be formatted and upper.

- + \ No newline at end of file diff --git a/en/guide/getting-started.html b/en/guide/getting-started.html index 16282dc..6de18e9 100644 --- a/en/guide/getting-started.html +++ b/en/guide/getting-started.html @@ -12,7 +12,7 @@ - + @@ -86,8 +86,8 @@ SLACK_BOT_PROXY_ADDRESS = http

To create an application in the Slack platform, add it to your workspace.

On the homepage, find the Signing Secret tab to get the SLACK_SIGNING_SECRET.

Find the App-Level Tokens tab to get the SLACK_APP_TOKEN.

Open the Oauth tab, find the Bot User OAuth Token, and use it as the SLACK_BOT_TOKEN.

Enable Socket Mode.

Go to Event Subscriptions and enable it on the page, subscribe to the following events: message.channels, message.im, message.groups.

Go to oauth, find the Bot Token Scopes, and select the following scopes: chat:write, channels:read, commands, files:read, files:write, im:read, im:history, group:history, im:write, channel:write, channel:history (there may be additional scopes).

Go to Slash Commands and register all the slash commands. Refer to the Command Guide for the command table.

Reinstall the app and invite your bot to the channels by calling it with @BOT.

🍔 Kook

ini
KOOK_BOT_TOKEN = 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890

Go to Kook Developer Center, create a new application on the top left corner.

Get and fill in your Kook bot token.

🍤 Configure OpenAI Endpoint

Login can be done in two ways.

Alternatively, you can configure a global model to be used by users who haven't logged in.

dotenv
GLOBAL_OAI_KEY=sk-xxx
 GLOBAL_OAI_MODEL=gpt-3.5-turbo
 GLOBAL_OAI_TOOL_MODEL=gpt-3.5-turbo
-GLOBAL_OAI_ENDPOINT=https://api.openai.com/v1/

Note

GLOBAL_OAI_TOOL_MODEL is the global tool model and is only used for logical judgment with a higher invocation frequency.

🍟 Using Non-OpenAI Models

You can use gateway or one-api as a converter. Alternatively, you can use online service providers such as OhMyGpt.

If you are using Azure, make sure your version supports functions.

- +GLOBAL_OAI_ENDPOINT=https://api.openai.com/v1/

Note

GLOBAL_OAI_TOOL_MODEL is the global tool model and is only used for logical judgment with a higher invocation frequency.

🍟 Using Non-OpenAI Models

You can use gateway or one-api as a converter. Alternatively, you can use online service providers such as OhMyGpt.

If you are using Azure, make sure your version supports functions.

+ \ No newline at end of file diff --git a/en/guide/maintain.html b/en/guide/maintain.html index b054478..3ae00e1 100644 --- a/en/guide/maintain.html +++ b/en/guide/maintain.html @@ -19,7 +19,7 @@
Skip to content

Released under the GFDL License.

- + \ No newline at end of file diff --git a/en/guide/service.html b/en/guide/service.html index 4dec1df..08b69f5 100644 --- a/en/guide/service.html +++ b/en/guide/service.html @@ -19,7 +19,7 @@
Skip to content

Service

Backup Database

TODO

Released under the GFDL License.

- + \ No newline at end of file diff --git a/en/index.html b/en/index.html index c6d4987..86768c4 100644 --- a/en/index.html +++ b/en/index.html @@ -19,7 +19,7 @@
Skip to content

Openaibot

Development guides and tutorials.

LLM-based Chain Message ChatBot framework

Released under the GFDL License.

- + \ No newline at end of file diff --git a/guide/command.html b/guide/command.html index cbd34e6..c5e9d0b 100644 --- a/guide/command.html +++ b/guide/command.html @@ -30,7 +30,7 @@ learn - Learn your instructions, /learn reset to clear

提示

在部分平台中,比如 Slack 平台,auth chat task ask 命令需要以 ! 开头。

部分平台额外支持了 @Bot 的方式,比如 Slack 平台,@Bot 命令等同于 chat 命令。

🥽 模式的不同

ini
chat - 聊天
 task - 任务
 ask - 问答

其中 chat 模式是默认模式,task 模式启用函数响应,ask 模式则禁用函数响应。

🧁 虚拟环境

shell
env - 虚拟环境设置

此命令为插件和用户间提供了一个交互环境,用户可以通过此命令提交插件需要的常量。

比如 /env VAR=551;VAR2=asdasd;VAR3="1231"

所有键名会被自动格式化并大写。

- + \ No newline at end of file diff --git a/guide/getting-started.html b/guide/getting-started.html index c04bfd6..5fd71d4 100644 --- a/guide/getting-started.html +++ b/guide/getting-started.html @@ -12,13 +12,13 @@ - + -
Skip to content

📝 部署指南

📦 检查系统

对于 Debian 服务器,请确认您的系统语言集为 UTF8,否则输入 dpkg-reconfigure locales 配置语言。

请确认您服务器的内存大于 1G

提示

我们有 fallback 方案,如果您不部署 RedisMongoDB,我们会使用内存数据库。对于一般的使用,这是足够的。 不过如果您需要长时间存储数据,我们建议您部署 RedisMongoDB。 但是 RabbitMQ 是必须的。

📦 快速开始

如果您使用全新服务器,您可以使用以下 Shell 自动安装本项目。

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

🥽 手动安装

shell
# Install Voice dependencies
+    
Skip to content

📝 部署指南

📦 检查系统

对于 Debian 服务器,请确认您的系统语言集为 UTF8,否则输入 dpkg-reconfigure locales 配置语言。

请确认您服务器的内存大于 1G

提示

我们有 fallback 方案,如果您不部署 RedisMongoDB,我们会使用内存数据库。对于一般的使用,这是足够的。 不过如果您需要长时间存储数据,我们建议您部署 RedisMongoDB。 但是 RabbitMQ 是必须的。

📦 快速开始

如果您使用全新服务器,您可以使用以下 Shell 自动安装本项目。

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

🥽 手动安装

shell
# Install Voice dependencies
 apt install ffmpeg
 # Install RabbitMQ
 docker pull rabbitmq:3.10-management
@@ -41,7 +41,7 @@
 # Host
 apt install npm
 npm install pm2 -g
-pm2 start pm2.json

🥽 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

  • 使用 pip uninstall llm-kira 卸载旧内核。(如果有)

  • 使用 pip uninstall llmkira 卸载插件开发工具。(否则会造成冲突)

  • 确认您的 Python 版本为 3.9 或以上。

  • 安装 Docker

TIP

安装 Docker 可以参考 官方文档

安装 Docker Compose 可以参考 官方文档

或者 博客文章

Windows 用户可以安装 Docker Desktop

请确保您的数据库在一个网桥/局域网内,否则会链接失败。

此时您可以尝试使用 Docker 运行机器人,如果您不想使用 Docker,您可以继续阅读。

🍜 数据库支持

🍫 安装 Redis

提供两种方式安装缓存数据库,您可以选择其中一种。

通过命令行安装

bash
# 安装 Redis
+pm2 start pm2.json

🥽 Docker

提示

如果你使用 Docker 运行本项目,你会启动 Redis, MongoDB 和 RabbitMQ。如果你本地运行,可以只启动 RabbitMQ。

Build Hub: sudoskys/llmbot

  • 使用 pip uninstall llm-kira 卸载旧内核。(如果有)

  • 使用 pip uninstall llmkira 卸载插件开发工具。(否则会造成冲突)

  • 确认您的 Python 版本为 3.9 或以上。

  • 安装 Docker

TIP

安装 Docker 可以参考 官方文档

安装 Docker Compose 可以参考 官方文档

或者 博客文章

Windows 用户可以安装 Docker Desktop

请确保您的数据库在一个网桥/局域网内,否则会链接失败。

此时您可以尝试使用 Docker 运行机器人,如果您不想使用 Docker,您可以继续阅读。

🍜 数据库支持

🍫 安装 Redis

提供两种方式安装缓存数据库,您可以选择其中一种。

通过命令行安装

bash
# 安装 Redis
 apt-get install redis
 systemctl enable redis.service --now

通过 Docker 安装

bash
docker pull redis:latest
 docker run -d -p 6379:6379 \
@@ -67,7 +67,7 @@
 pm2 start pm2.json

其他命令

shell
pm2 stop pm2.json # 停止
 pm2 restart pm2.json # 重启
 pm2 status pm2.json # 查看状态

Shell 运行

bash
python3 start_sender.py
-python3 start_receiver.py

提示

当您退出当前 Shell 时,机器人也会退出。您可以使用 nohup 命令来挂起机器人。不过我们不推荐这样做。

🫙 运行配置

配置相应的环境变量即可运行对应的机器人。

🥽 一些运行时环境变量

| 变量名 | 值| 描述 | |--------------------------------|------------------------------------|-- -------------------------------------------------- ----------| | STOP_REPLY | 1 | 如果值为 1,则停止接收回复 | | DEBUG | 调试| 如果被配置为任何值,则将长调试日志打印到终端上。 |

🥛 Telegram

ini
TELEGRAM_BOT_TOKEN = 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
+python3 start_receiver.py

提示

当您退出当前 Shell 时,机器人也会退出。您可以使用 nohup 命令来挂起机器人。不过我们不推荐这样做。

🫙 运行配置

配置相应的环境变量即可运行对应的机器人。

🥽 一些运行时环境变量

变量名描述
STOP_REPLY1如果值为 1,则停止接收回复
DEBUG调试如果被配置为任何值,则将长调试日志打印到终端上。

🥛 Telegram

ini
TELEGRAM_BOT_TOKEN = 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
 TELEGRAM_BOT_PROXY_ADDRESS = socks5://127.0.0.1:7890
变量名称说明获取
TELEGRAM_BOT_TOKENTelegramBotTelegram Bot
TELEGRAM_BOT_PROXY_ADDRESSAiohttp

🍖 Discord

ini
DISCORD_BOT_TOKEN = Y0NzY0NzY0NzY0NzY0NzY0.DsYQDQ.0
 DISCORD_BOT_PREFIX = !
 DISCORD_BOT_PROXY_ADDRESS = socks5://

申请 Discord Bot 请移步 官方平台

点开 oauth2/url-generator,选中权限组 bot 您需要勾选的权限如下:

ini
`Send Messages`
@@ -86,8 +86,8 @@
 SLACK_BOT_PROXY_ADDRESS = http

打开 Slack App Center,创建一个新的应用程序。

  • 配置密钥

在主页上找到 Signing Secret 选项卡,寻找 SLACK_SIGNING_SECRET

找到 App-Level Tokens 选项卡,寻找 SLACK_APP_TOKEN

打开 Oauth 选项卡,找到 Bot User OAuth Token,将其作为 SLACK_BOT_TOKEN

  • 启用套接字模式

开启 Socket Mode

  • 开启事件订阅

前往 event-subscriptions ,在页面上启用 Event Subscriptions ,订阅以下事件:message.channelsmessage.immessage.groups

  • 开启读写权限

前往 oauth ,找到 Bot Token Scopes ,并选择以下权限:chat:writechannels:readcommandsfiles:readfiles:writeim:readim:historygroup:historyim:writechannel:writechannel:history (可能会有额外的一些权限)。

  • 注册所有 Slash 命令

前往 Slash Commands ,注册所有 Slash 命令。命令表见 命令指南

重新安装 APP,并将您的机器人邀请到频道中,使用 @BOT 调用您的机器人.

🍔 Kook

ini
KOOK_BOT_TOKEN = 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890

转到 Kook 开发者中心,左上角新建应用。

获取,填入您的 Kook 机器人 Token 即可。

🍤 配置Openai端点

登陆采用两个方案。

  • 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>$<tool model such as gpt-3.5-turbo> to login

当然,你可以配置全局模型,给没有登陆的用户使用。

dotenv
GLOBAL_OAI_KEY=sk-xxx
 GLOBAL_OAI_MODEL=gpt-3.5-turbo
 GLOBAL_OAI_TOOL_MODEL=gpt-3.5-turbo
-GLOBAL_OAI_ENDPOINT=https://api.openai.com/v1/

提示

GLOBAL_OAI_TOOL_MODEL 是全局工具模型,只是用于逻辑判断,调用频率会比较高。

🍟 使用非 Openai 模型

你可以使用 gatewayone-api 作为转换器。或者使用在线服务商,如 OhMyGpt

如果你在使用 Azure ,请确认你使用的版本支持 functions。

Released under the GFDL License.

- +GLOBAL_OAI_ENDPOINT=https://api.openai.com/v1/

提示

GLOBAL_OAI_TOOL_MODEL 是全局工具模型,只是用于逻辑判断,调用频率会比较高。

🍟 使用非 Openai 模型

你可以使用 gatewayone-api 作为转换器。或者使用在线服务商,如 OhMyGpt

如果你在使用 Azure ,请确认你使用的版本支持 functions。

Released under the GFDL License.

+ \ No newline at end of file diff --git a/guide/maintain.html b/guide/maintain.html index 3bf3820..3bbd38d 100644 --- a/guide/maintain.html +++ b/guide/maintain.html @@ -19,7 +19,7 @@
Skip to content

Released under the GFDL License.

- + \ No newline at end of file diff --git a/guide/service.html b/guide/service.html index b4cb901..c8c733b 100644 --- a/guide/service.html +++ b/guide/service.html @@ -19,7 +19,7 @@
Skip to content

Service

Backup Database

TODO

Released under the GFDL License.

- + \ No newline at end of file diff --git a/hashmap.json b/hashmap.json index 7e9d77d..d403053 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"en_dev_arch.md":"CFGyXUxf","dev_arch.md":"BPp5nzK3","en_index.md":"BgMGvFfT","en_guide_maintain.md":"Cu6Tuxnj","en_guide_service.md":"D70vvW4s","en_dev_client.md":"Db1HuZXF","guide_command.md":"Dk11sHxU","dev_client.md":"sIYrJ8uM","guide_service.md":"esD99RYd","en_guide_command.md":"BizKrSqG","guide_maintain.md":"CkHm5-Dv","index.md":"Ti_0qVNE","en_guide_getting-started.md":"Bj1ZYln3","en_dev_basic.md":"Chv-IMYf","guide_getting-started.md":"D7bwlLHt","dev_basic.md":"681OQhEy"} +{"en_dev_client.md":"Db1HuZXF","guide_command.md":"Dk11sHxU","guide_getting-started.md":"CctWEGYW","en_guide_command.md":"BizKrSqG","dev_client.md":"sIYrJ8uM","dev_basic.md":"681OQhEy","index.md":"Ti_0qVNE","guide_maintain.md":"CkHm5-Dv","en_guide_getting-started.md":"wf9vgJEi","en_guide_maintain.md":"Cu6Tuxnj","en_guide_service.md":"D70vvW4s","dev_arch.md":"BPp5nzK3","en_dev_arch.md":"CFGyXUxf","en_index.md":"BgMGvFfT","guide_service.md":"esD99RYd","en_dev_basic.md":"Chv-IMYf"} diff --git a/index.html b/index.html index f57fabb..09d8070 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@
Skip to content

Openaibot

开发部署指南和教程

链式对话代理机器人平台

Released under the GFDL License.

- + \ No newline at end of file