mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
doc: 添加元数据说明
This commit is contained in:
@@ -84,7 +84,7 @@ export default sidebar({
|
||||
},
|
||||
{
|
||||
text: "配置详解",
|
||||
icon: "context",
|
||||
icon: "config",
|
||||
collapsible: true,
|
||||
prefix: "posts/config/",
|
||||
link: "posts/config/",
|
||||
@@ -109,11 +109,6 @@ export default sidebar({
|
||||
icon: "config",
|
||||
link: "command"
|
||||
},
|
||||
{
|
||||
text: "sensitive-words.json",
|
||||
icon: "config",
|
||||
link: "sensitive-words"
|
||||
},
|
||||
{
|
||||
text: "system.json",
|
||||
icon: "config",
|
||||
@@ -121,6 +116,30 @@ export default sidebar({
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
text: "元数据配置",
|
||||
icon: "enum",
|
||||
collapsible: true,
|
||||
prefix: "posts/metadata/",
|
||||
link: "posts/metadata/",
|
||||
children: [
|
||||
{
|
||||
text: "敏感词 sensitive-words.json",
|
||||
icon: "enum",
|
||||
link: "sensitive-words"
|
||||
},
|
||||
{
|
||||
text: "模型列表 llm-models.json",
|
||||
icon: "enum",
|
||||
link: "llm-models"
|
||||
},
|
||||
{
|
||||
text: "qq-botpy ID 映射 adapter-qq-botpy.json",
|
||||
icon: "enum",
|
||||
link: "adapter-qq-botpy"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
text: "常见问题",
|
||||
icon: "info",
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
---
|
||||
head:
|
||||
- - meta
|
||||
- name: keywords
|
||||
content: sensitive-words.json 配置文件
|
||||
title: sensitive-words.json 配置项
|
||||
icon: config
|
||||
order: 5
|
||||
author: RockChinQ
|
||||
date: 2024-02-18
|
||||
category:
|
||||
- 配置文件
|
||||
---
|
||||
|
||||
本地敏感词词库,参考 `data/config/sensitive-words.json` 内容进行修改即可。
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
head:
|
||||
- - meta
|
||||
- name: keywords
|
||||
content: ChatGPT QQ机器人教程,QChatGPT项目部署教程
|
||||
title: 元数据配置详解
|
||||
icon: config
|
||||
author: RockChinQ
|
||||
date: 2024-03-20
|
||||
index: false
|
||||
---
|
||||
|
||||
元数据配置是程序运行期间生成的,用于描述某些数据的数据文件,比如:大语言模型数据、敏感词库、QQ 官方 API 的 ID 映射关系等,这些数据相比于配置文件较为复杂,一般不需要用户手动修改。
|
||||
元数据文件均位于 `data/metadata/` 目录下,请点击左侧目录查看各个文件的详细配置项。
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
head:
|
||||
- - meta
|
||||
- name: keywords
|
||||
content: adapter-qq-botpy.json 元数据
|
||||
title: adapter-qq-botpy.json 元数据
|
||||
icon: config
|
||||
order: 3
|
||||
author: RockChinQ
|
||||
date: 2024-03-20
|
||||
category:
|
||||
- 配置文件
|
||||
---
|
||||
|
||||
`data/metadata/adapter-qq-botpy.json`,QQ 官方 API 适配器元数据。官方 API 在使用群聊接口时,群id和成员id为字符串,而 QChatGPT 内部只支持整型 id,为使重启后仍然是相同的对应关系,因此需要保存到一个文件中。
|
||||
|
||||
## 格式
|
||||
|
||||
```json
|
||||
{
|
||||
"mapping": {
|
||||
"groups": {
|
||||
"15944D6D2B525C6E3536134D4669F067": 443241151434655
|
||||
},
|
||||
"members": {
|
||||
"547A6244A731B4BEEBE5EE2AE4CD00A8": 232437565267568
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- `groups`: 群id映射关系,key为字符串群id,value为整型群id。
|
||||
- `members`: 成员id映射关系,key为字符串成员id,value为整型成员id。
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
head:
|
||||
- - meta
|
||||
- name: keywords
|
||||
content: llm-models.json 元数据
|
||||
title: llm-models.json 元数据
|
||||
icon: config
|
||||
order: 2
|
||||
author: RockChinQ
|
||||
date: 2024-03-20
|
||||
category:
|
||||
- 配置文件
|
||||
---
|
||||
|
||||
`data/metadata/llm-models.json`,受支持的大语言模型列表,本文件中指定了可用于 `data/config/provider.json` 中的 `model` 列表,指定每个模型对应的 `Key 管理器` 和 `API 请求器`。
|
||||
|
||||
## 格式
|
||||
|
||||
```json
|
||||
{
|
||||
"list": [
|
||||
{
|
||||
"name": "default",
|
||||
"requester": "openai-chat-completions",
|
||||
"token_mgr": "openai",
|
||||
"tool_call_supported": false
|
||||
},
|
||||
{
|
||||
"name": "gpt-3.5-turbo",
|
||||
"tool_call_supported": true
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
模型均列于`list`数组中,每个模型的字段如下:
|
||||
|
||||
- `name`: 模型名称,用于在 `data/config/provider.json` 中的 `model` 列表中指定。
|
||||
- `model_name`: 进行请求时使用的模型名称,用于区分使用不同请求器的相同模型,若未设置则使用 `name` 字段。
|
||||
- `requester`: 请求器名称,指定使用哪个请求器请求该模型的响应,不同的请求器对应不同的 API,当前支持的模型,可以在 `data/config/provider.json` 中的 `requester` 列表中找到。
|
||||
- `token_mgr`: Key 管理器,此模型使用的 key 组,对应 `data/config/provider.json` 中的 `keys` 列表。
|
||||
- `tool_call_supported`: 是否支持工具调用,标记此模型是否支持使用`内容函数`。
|
||||
|
||||
`default` 模型是必须的,这是模型的默认配置,其他模型可以不设置所有的字段,只需设置 `name` 字段即可,其他字段会继承 `default` 模型的配置。
|
||||
|
||||
## 自动更新机制
|
||||
|
||||
每次启动时,程序会自动从中央服务器获取最新的模型列表,相同的模型名称会被下载的新配置覆盖。
|
||||
|
||||
## 自定义模型
|
||||
|
||||
根据上述格式添加即可。
|
||||
|
||||
- 如果需要使用目前不支持的接口(请求器),需要自己扩展请求器,请参考插件开发文档。
|
||||
- key 组可以自己在 `data/config/provider.json` 中的 `keys` 列表中添加。
|
||||
- 修改模型配置一般是没有必要的,每次启动时下载的模型列表会覆盖本地的相同模型名称的配置。
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
head:
|
||||
- - meta
|
||||
- name: keywords
|
||||
content: sensitive-words.json 元数据
|
||||
title: sensitive-words.json 元数据
|
||||
icon: config
|
||||
order: 1
|
||||
author: RockChinQ
|
||||
date: 2024-02-18
|
||||
category:
|
||||
- 配置文件
|
||||
---
|
||||
|
||||
本地敏感词词库,参考 `data/metadata/sensitive-words.json` 内容进行修改即可。
|
||||
Reference in New Issue
Block a user