Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Soulter committed Jul 27, 2024
1 parent e3984f6 commit b20a95e
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 99 deletions.
3 changes: 0 additions & 3 deletions docs/使用/可视化面板.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
:::info

在部署完后,打开 [http://localhost:6185](http://localhost:6185) 或者 `http://<公网ip>:6185` 即可看到本可视化面板页面。默认登录密码都为空。

可视化面板目前只实现了基本功能,会慢慢完善功能。
**可视化面板将会独立成为一个新的项目供其他机器人项目免费使用。**
:::


Expand Down
12 changes: 1 addition & 11 deletions docs/使用/大语言模型.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,4 @@ AstrBot 集成了大语言模型的一些功能。

记住修改完之后点击右下角的保存按钮。

有经济能力可以支持一下 https://github.com/chatanywhere/GPT_API_free 购买低价key,获得更多模型。

Enjoy~

## Claude、HuggingChat

需要安装 `llms` 插件。在 `可视化面板-插件` 中点击右下角安装。地址:`https://github.com/Soulter/LLMS`。安装完成之后,发送 `/llm` 查看插件细节。

## Gemini

正在接入中。当然可以自己写插件(最少只需 25 行!)。[插件开发](../开发/插件开发)
有经济能力可支持 https://github.com/chatanywhere/GPT_API_free 购买低价key,获得更多模型。
33 changes: 1 addition & 32 deletions docs/使用/指令.md
Original file line number Diff line number Diff line change
@@ -1,32 +1 @@

## 基本
- `/help`: 显示帮助信息
- `/update`: 更新项目
- `/update r`: 只重启机器人
- `/update latest`: 更新到最新版本
- `/update latest r`: 更新到最新版本,并重启机器人
- `/plugin`: 插件面板


## 使用 OpenAI 相关模型

:::caution

需要 添加 Key 才能生效

:::

- `/reset`: 重置会话
- `/画<内容>`: 调用 Dall-E 模型生成图片
- `/switch`: 切换到不同的语言模型账号
- `/web on`: 网页搜索
- `/models`: 查看可用模型
- `/model <id>` 切换到指定模型(编号或名字)
- `/set`: 人格设置

:::caution

可以通过安装插件的方式接入其他语言模型。如 `llms` 插件。

:::

可使用 `help` 指令查看所有可用指令。
25 changes: 2 additions & 23 deletions docs/开始.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,8 @@

:::info

如果在使用过程中遇到了任何问题,我们非常欢迎您提交 [issue](https://github.com/Soulter/AstrBot/issues)(推荐) 或者加群 322154837 讨论。
如果在使用过程中遇到了任何问题,欢迎提交 [issue](https://github.com/Soulter/AstrBot/issues) 或者加群 322154837 讨论。

此文档正在建设中,欢迎您参与建设!如果发现文档错误可以点击每篇文章末尾的 `Edit this page` 来修改文章。合并修改后,会自动更新页面。

:::



这是一个以聊天机器人为主的项目。涉及到的主要功能有:

- 可视化面板(beta)
- 同时部署机器人到 `QQ``QQ 频道`
- 大模型对话
- 大模型网页搜索能力 (目前仅支持OpenAI系模型,最新版本下使用 `web on` 指令打开)
- 插件(在QQ或QQ频道聊天框内输入 `plugin` 了解详情)
- 回复文字图片渲染(以图片 markdown 格式回复,大幅度降低被风控概率,需手动在 cmd_config.json 内开启 qq_pic_mode)
- 人格设置
- 关键词回复
- 热更新(更新本项目时仅需在 QQ 或 QQ 频道聊天框内输入 `update latest r`
- Windows 一键部署 https://github.com/Soulter/QQChatGPTLauncher/releases/latest

**在开始阅读教程之前,你需要了解以下知识**

- go-cqhttp(以下简称GOCQ)是由 Mrs4s 以及多位贡献者维护的一个第三方 QQ 消息接口(相当于第三方客户端),功能强大,支持QQ、QQ频道的消息接收与发送。本项目使用了 GOCQ 进行 QQ 和 QQ频道的消息接收与发送。不过由于腾讯频繁的更换协议,目前不太稳定(小部分QQ号会登录失败)。
- QQ 频道 SDK 是腾讯 QQ 频道团队开源的 QQ 频道消息接口。官方认证,因此很稳定。不过需要申请 appid、token(下面有教程)。并且对主动消息有限值。
各有优缺点,可以权衡一下(或者都启用)。
:::
17 changes: 4 additions & 13 deletions docs/部署/通过Docker部署.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@

:::caution

Docker 镜像尚处开发阶段,难免有 bug。在发现 bug 之后,可以提交 issue。

:::

## Linux 环境

只需执行:
Expand All @@ -14,22 +7,20 @@ mkdir -p /home/astrbot/data
docker run -itd -p 6185:6185 -p 6186:6186 -v /home/astrbot/data:/AstrBot/data --name astrbot soulter/astrbot:latest
```

> 注意:如果您打算使用反向 WebSocket 来连接到诸如 Lagrange、NapCat 等 OneBot 协议实现,您仍需要再暴露对应的端口。
> 注意:如果您打算使用反向 WebSocket 来连接到诸如 Lagrange、NapCat 等 OneBot 协议实现,您仍需要再暴露对应的端口。比如您打算使用 NapCat 通过 `ws://12.34.56.78:6199/ws` 连接到 AstrBot,那么您需要再暴露 6199 端口。
`v3.2` 版本之后, 你使用 AstrBot 中产生的数据将存储在 `/home/astrbot/data` 目录下, 包括:
使用 AstrBot 中产生的数据将存储在 `/home/astrbot/data` 目录下, 包括:
1. 插件的配置文件
2. AstrBot 的配置文件
3. AstrBot 会话, 统计产生的数据库文件(data.db)

如果出现 docker: command not found 的话,说明你还没有安装 docker,请先安装。

成功运行之后,请打开 `http://localhost:6185` (如果你的服务器有公网 ip,也可以打开 `http://[你的服务器公网 IP]:6185`,如果打不开,请检查 Linux 防火墙和服务器托管商处是否放行了 6185 端口)

打开之后即可看到本项目的可视化面板。如果提示需要登录,请直接点击登录按钮。密码和用户名可在之后修改。密码使用 MD5 加密,并且只存于本地。
成功运行之后,请打开 `http://localhost:6185` (如果你的服务器有公网 ip,也可以打开 `http://[你的服务器公网 IP]:6185`。如果打不开,请检查 Linux 防火墙和服务器托管商处是否放行了 6185 端口)

对于这个面板的使用,详见:[可视化面板的使用](../使用/可视化面板)

> 默认密码和用户名均为空。第一次登录面板请直接点击 `登录` 按钮。
> 默认密码和用户名均为空。第一次登录面板请直接点击 `登录` 按钮。密码和用户名可在之后修改。密码使用 MD5 加密且只存储于本地。
![可视化面板](image.png)

Expand Down
32 changes: 31 additions & 1 deletion docs/部署/通过Windows部署.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,34 @@

## 启动启动器

启动 `launcher` 程序即可.
启动 `launcher` 程序即可.


成功运行之后,控制台日志输出如下:

```log
2024-07-27 09:09:32.632| INFO |MainThread|astrbot.<module>|main.py:54 -
___ _______.___________..______ .______ ______ .___________.
/ \ / | || _ \ | _ \ / __ \ | |
/ ^ \ | (----`---| |----`| |_) | | |_) | | | | | `---| |----`
/ /_\ \ \ \ | | | / | _ < | | | | | |
/ _____ \ .----) | | | | |\ \----.| |_) | | `--' | | |
/__/ \__\ |_______/ |__| | _| `._____||______/ \______/ |__|
2024-07-27 09:09:32.693| INFO |MainThread|astrbot.__init__|bootstrap.py:32 - AstrBot v3.3.0
2024-07-27 09:09:32.693| INFO |MainThread|astrbot.__init__|bootstrap.py:47 - 未使用代理。
2024-07-27 09:09:32.693| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 help。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 wake。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 update。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 plugin。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 reboot。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 websearch。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 t2i。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 myid。
2024-07-27 09:09:32.707| INFO |MainThread|astrbot.plugin_reload|manager.py:177 - 插件 helloworld(Soulter) 加载成功。
2024-07-27 09:09:32.707| INFO |MainThread|astrbot.register|manager.py:54 - 已注册 Soulter/helloworld 的指令 helloworld。
2024-07-27 09:09:32.707| WARNING |MainThread|astrbot.load_platform|bootstrap.py:112 - 未启用任何消息平台。
2024-07-27 09:09:32.708| INFO |MainThread|astrbot.run_http_server|server.py:505 - HTTP 服务器已启动,可访问: http://198.18.0.1:6185 等来登录可视化面板。
2024-07-27 09:09:32.722| INFO |MainThread|astrbot.ws_server|server.py:493 - WebSocket 服务器已启动。
```
38 changes: 26 additions & 12 deletions docs/部署/通过命令行部署.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

:::caution

此项目需要 Python 版本 >= 3.9。如果你的 Linux/Mac/Windows 的 Python 版本小于这个版本的话,需要重新安装。或者,更简单的方式,你可以使用 Docker 容器来一键安装。 详见:[通过 Docker 部署](通过Docker部署)
请保证你的 OS 的 Python 版本 Python 版本 >= 3.9。或者可以采用更简单的部署方式,详见:[通过 Docker 部署](通过Docker部署)

:::

Expand All @@ -18,19 +18,33 @@ cd AstrBot
python3 main.py
```

成功运行之后,你会在控制台发现
成功运行之后,控制台日志输出如下

```log
[12-25 12:10:39] [INFO] [可视化面板]:
[12-25 12:10:39] [INFO] [可视化面板]: ==================
[12-25 12:10:39] [INFO] [可视化面板]: 您可以访问:
[12-25 12:10:39] [INFO] [可视化面板]:
[12-25 12:10:39] [INFO] [可视化面板]: http://198.18.0.1:6185
[12-25 12:10:39] [INFO] [可视化面板]: http://localhost:6185
[12-25 12:10:39] [INFO] [可视化面板]:
[12-25 12:10:39] [INFO] [可视化面板]: 来登录可视化面板。
[12-25 12:10:39] [INFO] [可视化面板]: 注意: 所有配置项现已全量迁移至 cmd_config.json 文件下。您可以登录可视化面板在线修改配置。
[12-25 12:10:39] [INFO] [可视化面板]: ==================
2024-07-27 09:09:32.632| INFO |MainThread|astrbot.<module>|main.py:54 -
___ _______.___________..______ .______ ______ .___________.
/ \ / | || _ \ | _ \ / __ \ | |
/ ^ \ | (----`---| |----`| |_) | | |_) | | | | | `---| |----`
/ /_\ \ \ \ | | | / | _ < | | | | | |
/ _____ \ .----) | | | | |\ \----.| |_) | | `--' | | |
/__/ \__\ |_______/ |__| | _| `._____||______/ \______/ |__|
2024-07-27 09:09:32.693| INFO |MainThread|astrbot.__init__|bootstrap.py:32 - AstrBot v3.3.0
2024-07-27 09:09:32.693| INFO |MainThread|astrbot.__init__|bootstrap.py:47 - 未使用代理。
2024-07-27 09:09:32.693| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 help。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 wake。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 update。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 plugin。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 reboot。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 websearch。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 t2i。
2024-07-27 09:09:32.694| INFO |MainThread|astrbot.register|manager.py:56 - 已注册指令 myid。
2024-07-27 09:09:32.707| INFO |MainThread|astrbot.plugin_reload|manager.py:177 - 插件 helloworld(Soulter) 加载成功。
2024-07-27 09:09:32.707| INFO |MainThread|astrbot.register|manager.py:54 - 已注册 Soulter/helloworld 的指令 helloworld。
2024-07-27 09:09:32.707| WARNING |MainThread|astrbot.load_platform|bootstrap.py:112 - 未启用任何消息平台。
2024-07-27 09:09:32.708| INFO |MainThread|astrbot.run_http_server|server.py:505 - HTTP 服务器已启动,可访问: http://198.18.0.1:6185 等来登录可视化面板。
2024-07-27 09:09:32.722| INFO |MainThread|astrbot.ws_server|server.py:493 - WebSocket 服务器已启动。
```

这时,你可以任意打开一个链接,即可看到本项目的可视化面板。如果提示需要登录,请直接点击登录按钮。密码和用户名可在之后修改。密码使用 MD5 加密,并且只存于本地。
Expand Down
1 change: 0 additions & 1 deletion docs/配置/其他功能配置.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/配置/平台配置.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Nakuru, AIOCQhttp 和 QQ官方机器人接口

- `Nakuru``AIOCQHttp` 是 AstrBot 中使用的对 OneBot 协议(QQ)的支持库。其中,`Nakuru` 更适合连接到 `go-cqhttp`,而 `AIOCQHttp` 适合连接到支持反向 Websocket 的 OneBot 协议实现,如 `NapCat`, `Lagrange`, `Shamrock` 等。
- `Nakuru``AioCQHttp` 是 AstrBot 中使用的对 OneBot 协议(QQ)的支持库。其中,`Nakuru` 更适合连接到 `go-cqhttp`,而 `AioCQHttp` 适合连接到支持反向 Websocket 的 OneBot 协议实现,如 `NapCat`, `Lagrange`, `Shamrock` 等。

> 更推荐使用 aiocqhttp 来接入。
Expand Down
1 change: 0 additions & 1 deletion docs/配置/插件配置.md

This file was deleted.

2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const sidebars = {
{
type: 'category',
label: '配置',
items: ['配置/平台配置', '配置/语言模型配置', '配置/插件配置', '配置/其他功能配置'],
items: ['配置/平台配置', '配置/语言模型配置'],
},
{
type: 'category',
Expand Down

0 comments on commit b20a95e

Please sign in to comment.