Revert "sub plan page (#885)" (#886)

This reverts commit 443ad37b6a.
This commit is contained in:
Archer
2024-02-23 17:48:15 +08:00
committed by GitHub
parent 443ad37b6a
commit fd9b6291af
246 changed files with 4281 additions and 6286 deletions

View File

@@ -13,7 +13,163 @@ weight: 708
这个配置文件中包含了系统级参数、AI 对话的模型、function 模型等……
## 4.6.8+ 版本新配置文件
## 4.6.8 以前版本完整配置参数
**使用时,请务必去除注释!**
以下配置适用于V4.6.6-alpha版本以后
```json
{
"systemEnv": {
"vectorMaxProcess": 15, // 向量生成最大进程,结合数据库性能和 key 来设置
"qaMaxProcess": 15, // QA 生成最大进程,结合数据库性能和 key 来设置
"pgHNSWEfSearch": 100 // pg vector 索引参数,越大精度高但速度慢
},
"chatModels": [ // 对话模型
{
"model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106",
"inputPrice": 0, // 输入价格。 xx元/1k tokens
"outputPrice": 0, // 输出价格。 xx元/1k tokens
"maxContext": 16000, // 最大上下文长度
"maxResponse": 4000, // 最大回复长度
"quoteMaxToken": 2000, // 最大引用内容长度
"maxTemperature": 1.2, // 最大温度值
"censor": false, // 是否开启敏感词过滤(商业版)
"vision": false, // 支持图片输入
"defaultSystemChatPrompt": ""
},
{
"model": "gpt-3.5-turbo-16k",
"name": "GPT35-16k",
"maxContext": 16000,
"maxResponse": 16000,
"inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 8000,
"maxTemperature": 1.2,
"censor": false,
"vision": false,
"defaultSystemChatPrompt": ""
},
{
"model": "gpt-4",
"name": "GPT4-8k",
"maxContext": 8000,
"maxResponse": 8000,
"inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 4000,
"maxTemperature": 1.2,
"censor": false,
"vision": false,
"defaultSystemChatPrompt": ""
},
{
"model": "gpt-4-vision-preview",
"name": "GPT4-Vision",
"maxContext": 128000,
"maxResponse": 4000,
"inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 100000,
"maxTemperature": 1.2,
"censor": false,
"vision": true,
"defaultSystemChatPrompt": ""
}
],
"qaModels": [ // QA 生成模型
{
"model": "gpt-3.5-turbo-16k",
"name": "GPT35-16k",
"maxContext": 16000,
"maxResponse": 16000,
"inputPrice": 0,
"outputPrice": 0
}
],
"cqModels": [ // 问题分类模型
{
"model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106",
"maxContext": 16000,
"maxResponse": 4000,
"inputPrice": 0,
"outputPrice": 0,
"toolChoice": true, // 是否支持openai的 toolChoice 不支持的模型需要设置为 false会走提示词生成
"functionPrompt": ""
},
{
"model": "gpt-4",
"name": "GPT4-8k",
"maxContext": 8000,
"maxResponse": 8000,
"inputPrice": 0,
"outputPrice": 0,
"toolChoice": true,
"functionPrompt": ""
}
],
"extractModels": [ // 内容提取模型
{
"model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106",
"maxContext": 16000,
"maxResponse": 4000,
"inputPrice": 0,
"outputPrice": 0,
"toolChoice": true,
"functionPrompt": ""
}
],
"qgModels": [ // 生成下一步指引
{
"model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106",
"maxContext": 1600,
"maxResponse": 4000,
"inputPrice": 0,
"outputPrice": 0
}
],
"vectorModels": [ // 向量模型
{
"model": "text-embedding-ada-002",
"name": "Embedding-2",
"inputPrice": 0,
"defaultToken": 700,
"maxToken": 3000
}
],
"reRankModels": [], // 重排模型,暂时填空数组
"audioSpeechModels": [
{
"model": "tts-1",
"name": "OpenAI TTS1",
"inputPrice": 0,
"baseUrl": "",
"key": "",
"voices": [
{ "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" },
{ "label": "Echo", "value": "echo", "bufferId": "openai-Echo" },
{ "label": "Fable", "value": "fable", "bufferId": "openai-Fable" },
{ "label": "Onyx", "value": "onyx", "bufferId": "openai-Onyx" },
{ "label": "Nova", "value": "nova", "bufferId": "openai-Nova" },
{ "label": "Shimmer", "value": "shimmer", "bufferId": "openai-Shimmer" }
]
}
],
"whisperModel": {
"model": "whisper-1",
"name": "Whisper1",
"inputPrice": 0
}
}
```
## 4.6.8 新配置文件
llm模型全部合并
@@ -33,10 +189,11 @@ llm模型全部合并
"maxResponse": 4000, // 最大回复
"quoteMaxToken": 13000, // 最大引用内容
"maxTemperature": 1.2, // 最大温度
"charsPointsPrice": 0,
"inputPrice": 0,
"outputPrice": 0,
"censor": false,
"vision": false, // 是否支持图片输入
"datasetProcess": false, // 是否设置为知识库处理模型QA务必保证至少有一个为true否则知识库会报错
"datasetProcess": false, // 是否设置为知识库处理模型
"toolChoice": true, // 是否支持工具选择
"functionCall": false, // 是否支持函数调用
"customCQPrompt": "", // 自定义文本分类提示词(不支持工具和函数调用的模型
@@ -51,7 +208,8 @@ llm模型全部合并
"maxResponse": 16000,
"quoteMaxToken": 13000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"inputPrice": 0,
"outputPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": true,
@@ -69,7 +227,8 @@ llm模型全部合并
"maxResponse": 4000,
"quoteMaxToken": 100000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"inputPrice": 0,
"outputPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": false,
@@ -87,9 +246,10 @@ llm模型全部合并
"maxResponse": 4000,
"quoteMaxToken": 100000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"inputPrice": 0,
"outputPrice": 0,
"censor": false,
"vision": true,
"vision": false,
"datasetProcess": false,
"toolChoice": true,
"functionCall": false,
@@ -103,7 +263,8 @@ llm模型全部合并
{
"model": "text-embedding-ada-002",
"name": "Embedding-2",
"charsPointsPrice": 0,
"inputPrice": 0,
"outputPrice": 0,
"defaultToken": 700,
"maxToken": 3000,
"weight": 100,
@@ -115,7 +276,8 @@ llm模型全部合并
{
"model": "tts-1",
"name": "OpenAI TTS1",
"charsPointsPrice": 0,
"inputPrice": 0,
"outputPrice": 0,
"voices": [
{ "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" },
{ "label": "Echo", "value": "echo", "bufferId": "openai-Echo" },
@@ -129,7 +291,8 @@ llm模型全部合并
"whisperModel": {
"model": "whisper-1",
"name": "Whisper1",
"charsPointsPrice": 0
"inputPrice": 0,
"outputPrice": 0
}
}
```
@@ -150,7 +313,7 @@ llm模型全部合并
{
"model": "bge-reranker-base", // 随意
"name": "检索重排-base", // 随意
"charsPointsPrice": 0,
"inputPrice": 0,
"requestUrl": "{{host}}/api/v1/rerank",
"requestAuth": "安全凭证,已自动补 Bearer"
}

View File

@@ -110,7 +110,6 @@ curl -O https://raw.githubusercontent.com/labring/FastGPT/main/projects/app/data
cd 项目目录
# 创建 mongo 密钥
openssl rand -base64 756 > ./mongodb.key
# 600不行可以用chmod 999
chmod 600 ./mongodb.key
chown 999:root ./mongodb.key
# 启动容器

View File

@@ -116,7 +116,8 @@ CHAT_API_KEY=sk-xxxxxx
"maxResponse": 4000, // 最大回复
"quoteMaxToken": 13000, // 最大引用内容
"maxTemperature": 1.2, // 最大温度
"charsPointsPrice": 0,
"inputPrice": 0,
"outputPrice": 0,
"censor": false,
"vision": false, // 是否支持图片输入
"datasetProcess": false, // 是否设置为知识库处理模型

View File

@@ -13,25 +13,12 @@ weight: 853
## 创建训练订单(4.6.9地址发生改动)
## 创建训练订单
{{< tabs tabTotal="2" >}}
{{< tab tabName="请求示例" >}}
{{< markdownify >}}
**新例子**
```bash
curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/usage/createTrainingUsage' \
--header 'Authorization: Bearer {{apikey}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "可选,自定义订单名称,例如:文档训练-fastgpt.docx"
}'
```
**x例子**
```bash
curl --location --request POST 'https://api.fastgpt.in/api/support/wallet/bill/createTrainingBill' \
--header 'Authorization: Bearer {{apikey}}' \
@@ -167,7 +154,7 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/list?paren
"vectorModel": {
"model": "text-embedding-ada-002",
"name": "Embedding-2",
"charsPointsPrice": 0,
"inputPrice": 0,
"defaultToken": 512,
"maxToken": 8000,
"weight": 100
@@ -226,7 +213,7 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/detail?id=
"vectorModel": {
"model": "text-embedding-ada-002",
"name": "Embedding-2",
"charsPointsPrice": 0,
"inputPrice": 0,
"defaultToken": 512,
"maxToken": 8000,
"weight": 100
@@ -236,7 +223,8 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/detail?id=
"name": "FastAI-16k",
"maxContext": 16000,
"maxResponse": 16000,
"charsPointsPrice": 0
"inputPrice": 0,
"outputPrice": 0
},
"intro": "",
"permission": "private",
@@ -812,33 +800,6 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/collect
## 数据
### 数据的结构
**Data结构**
| 字段 | 类型 | 说明 | 必填 |
| --- | --- | --- | --- |
| teamId | String | 团队ID | ✅ |
| tmbId | String | 成员ID | ✅ |
| datasetId | String | 知识库ID | ✅ |
| collectionId | String | 集合ID | ✅ |
| q | String | 主要数据 | ✅ |
| a | String | 辅助数据 | ✖ |
| fullTextToken | String | 分词 | ✖ |
| indexes | Index[] | 向量索引 | ✅ |
| updateTime | Date | 更新时间 | ✅ |
| chunkIndex | Number | 分块下表 | ✖ |
**Index结构**
每组数据的自定义索引最多5个
| 字段 | 类型 | 说明 | 必填 |
| --- | --- | --- | --- |
| defaultIndex | Boolean | 是否为默认索引 | ✅ |
| dataId | String | 关联的向量ID | ✅ |
| text | String | 文本内容 | ✅ |
### 为集合批量添加添加数据
注意,每次最多推送 200 组数据。
@@ -864,14 +825,11 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/data/pus
{
"q": "你会什么?",
"a": "我什么都会",
"indexes": [
{
"text":"自定义索引1"
},
{
"text":"自定义索引2"
}
]
"indexes": [{
"defaultIndex": false,
"type":"custom",
"text":"自定义索引,不使用默认索引"
}]
}
]
}'
@@ -892,7 +850,7 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/data/pus
- data具体数据
- q: 主要数据(必填)
- a: 辅助数据(选填)
- indexes: 自定义索引(选填)。可以不传或者传空数组默认都会使用q和a组成一个索引。
- indexes: 自定义索引(选填)不传入则默认使用q和a构建索引。也可以传入
{{% /alert %}}
{{< /markdownify >}}
@@ -908,6 +866,7 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/data/pus
"data": {
"insertLen": 1, // 最终插入成功的数量
"overToken": [], // 超出 token 的
"repeat": [], // 重复的数量
"error": [] // 其他错误
}
@@ -1091,16 +1050,7 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/data/updat
"id":"65abd4b29d1448617cba61db",
"q":"测试111",
"a":"sss",
"indexes":[
{
"dataId": "xxx",
"defaultIndex":false,
"text":"自定义索引1"
},
{
"text":"修改后的自定义索引2。会删除原来的自定义索引2并插入新的自定义索引2"
}
]
"indexes":[]
}'
```
@@ -1114,7 +1064,7 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/data/updat
- id: 数据的id
- q: 主要数据(选填)
- a: 辅助数据(选填)
- indexes: 自定义索引(选填),类型参考`为集合批量添加添加数据`。如果创建时候有自定义索引,
- indexes: 自定义索引(选填),类型参考`为集合批量添加添加数据`建议直接不传。更新q,a后如果有默认索引则会直接更新默认索引。
{{% /alert %}}
{{< /markdownify >}}

View File

@@ -169,6 +169,8 @@ curl --location --request POST '{{host}}/shareAuth/start' \
响应值与[chat 接口格式相同](/docs/development/openapi/chat/#响应),仅多了一个`token`
可以重点关注`responseData`里的`price`值,`price`与实际价格的倍率为`100000`,即 100000=1元。
```bash
curl --location --request POST '{{host}}/shareAuth/finish' \
--header 'Content-Type: application/json' \
@@ -176,117 +178,72 @@ curl --location --request POST '{{host}}/shareAuth/finish' \
"token": "{{authToken}}",
"responseData": [
{
"moduleName": "core.module.template.Dataset search",
"moduleType": "datasetSearchNode",
"totalPoints": 1.5278,
"query": "导演是谁\n《铃芽之旅》的导演是谁\n这部电影的导演是谁\n谁是《铃芽之旅》的导演",
"model": "Embedding-2(旧版,不推荐使用)",
"charsLength": 1524,
"similarity": 0.83,
"limit": 400,
"searchMode": "embedding",
"searchUsingReRank": false,
"extensionModel": "FastAI-4k",
"extensionResult": "《铃芽之旅》的导演是谁?\n这部电影的导演是谁\n谁是《铃芽之旅》的导演",
"runningTime": 2.15
"moduleName": "KB Search",
"price": 1.2000000000000002,
"model": "Embedding-2",
"tokens": 6,
"similarity": 0.61,
"limit": 3
},
{
"moduleName": "AI 对话",
"moduleType": "chatNode",
"totalPoints": 0.593,
"moduleName": "AI Chat",
"price": 454.5,
"model": "FastAI-4k",
"charsLength": 593,
"query": "导演是谁",
"maxToken": 2000,
"tokens": 303,
"question": "导演是谁",
"answer": "电影《铃芽之旅》的导演是新海诚。",
"maxToken": 2050,
"quoteList": [
{
"id": "65bb346a53698398479a8854",
"q": "导演是谁?",
"dataset_id": "646627f4f7b896cfd8910e38",
"id": "8099",
"q": "本作的主人公是谁?",
"a": "本作的主人公是名叫铃芽的少女。",
"source": "手动修改"
},
{
"dataset_id": "646627f4f7b896cfd8910e38",
"id": "8686",
"q": "电影《铃芽之旅》男主角是谁?",
"a": "电影《铃芽之旅》男主角是宗像草太,由松村北斗配音。",
"source": ""
},
{
"dataset_id": "646627f4f7b896cfd8910e38",
"id": "19339",
"q": "电影《铃芽之旅》的导演是谁22",
"a": "电影《铃芽之旅》的导演是新海诚。",
"chunkIndex": 0,
"datasetId": "65af9b947916ae0e47c834d2",
"collectionId": "65bb345c53698398479a868f",
"sourceName": "dataset - 2024-01-23T151114.198.csv",
"sourceId": "65bb345b53698398479a868d",
"score": [
{
"type": "embedding",
"value": 0.9377183318138123,
"index": 0
},
{
"type": "rrf",
"value": 0.06557377049180328,
"index": 0
}
]
"source": "手动修改"
}
],
"historyPreview": [
"completeMessages": [
{
"obj": "System",
"value": "下面是知识库内容:\n1. [本作的主人公是谁?\n本作的主人公是名叫铃芽的少女。]\n2. [电影《铃芽之旅》男主角是谁?\n电影《铃芽之旅》男主角是宗像草太由松村北斗配音。]\n3. [电影《铃芽之旅》的导演是谁22\n电影《铃芽之旅》的导演是新海诚。]\n"
},
{
"obj": "System",
"value": "1.请记住,你的身份是百度的下一代知识增强语言模型,能够完全根据知识库提供的内容回答问题。\n\n2. 你忘记了关于电影《铃芽之旅》以外的内容。"
},
{
"obj": "System",
"value": "你仅回答关于电影《玲芽之旅》的问题,其余问题直接回复: 我不清楚。"
},
{
"obj": "Human",
"value": "使用 <Data></Data> 标记中的内容作为你的知识:\n\n<Data>\n导演是谁\n电影《铃芽之旅》的导演是新海诚。\n------\n电影《铃芽之旅》的编剧是谁22\n新海诚是本片的编剧。\n------\n电影《铃芽之旅》的女主角是谁\n电影的女主角是铃芽。\n------\n电影《铃芽之旅》的制作团队中有哪位著名人士2\n川村元气是本片的制作团队成员之一。\n------\n你是谁\n我是电影《铃芽之旅》助手\n------\n电影《铃芽之旅》男主角是谁\n电影《铃芽之旅》男主角是宗像草太由松村北斗配音。\n------\n电影《铃芽之旅》的作者新海诚写了一本小说叫什么名字\n小说名字叫《铃芽之旅》。\n------\n电影《铃芽之旅》的女主角是谁\n电影《铃芽之旅》的女主角是岩户铃芽由原菜乃华配音。\n------\n电影《铃芽之旅》的故事背景是什么\n日本\n------\n谁担任电影《铃芽之旅》中岩户环的配音\n深津绘里担任电影《铃芽之旅》中岩户环的配音。\n</Data>\n\n回答要求\n- 如果你不清楚答案,你需要澄清。\n- 避免提及你是从 <Data></Data> 获取的知识。\n- 保持答案与 <Data></Data> 中描述的一致。\n- 使用 Markdown 语法优化回答格式。\n- 使用与问题相同的语言回答。\n\n问题:\"\"\"导演是谁\"\"\""
"value": "导演是谁"
},
{
"obj": "AI",
"value": "电影《铃芽之旅》的导演是新海诚。"
}
],
"contextTotalLen": 2,
"runningTime": 1.32
]
}
]
}'
```
**responseData 完整字段说明:**
```ts
type ResponseType = {
moduleType: `${FlowNodeTypeEnum}`; // 模块类型
moduleName: string; // 模块名
moduleLogo?: string; // logo
runningTime?: number; // 运行时间
query?: string; // 用户问题/检索词
textOutput?: string; // 文本输出
charsLength?: number; // 上下文总字数
model?: string; // 使用到的模型
contextTotalLen?: number; // 上下文总长度
totalPoints?: number; // 总消耗AI积分
temperature?: number; // 温度
maxToken?: number; // 模型的最大token
quoteList?: SearchDataResponseItemType[]; // 引用列表
historyPreview?: ChatItemType[]; // 上下文预览(历史记录会被裁剪)
similarity?: number; // 最低相关度
limit?: number; // 引用上限token
searchMode?: `${DatasetSearchModeEnum}`; // 搜索模式
searchUsingReRank?: boolean; // 是否使用rerank
extensionModel?: string; // 问题扩展模型
extensionResult?: string; // 问题扩展结果
extensionCharsLength?: number; // 问题扩展总字符长度
cqList?: ClassifyQuestionAgentItemType[]; // 分类问题列表
cqResult?: string; // 分类问题结果
extractDescription?: string; // 内容提取描述
extractResult?: Record<string, any>; // 内容提取结果
params?: Record<string, any>; // HTTP模块params
body?: Record<string, any>; // HTTP模块body
headers?: Record<string, any>; // HTTP模块headers
httpResult?: Record<string, any>; // HTTP模块结果
pluginOutput?: Record<string, any>; // 插件输出
pluginDetail?: ChatHistoryItemResType[]; // 插件详情
tfSwitchResult?: boolean; // 判断器结果
}
```
## 实践案例

View File

@@ -15,13 +15,13 @@ weight: 831
1. 主要是修改模型的`functionCall`字段,改成`toolChoice`即可。设置为`true`的模型,会默认走 openai 的 tools 模式;未设置或设置为`false`的,会走提示词生成模式。
问题优化模型与内容提取模型使用同一组配置。
问题补全模型与内容提取模型使用同一组配置。
2. 增加 `"ReRankModels": []`
## V4.6.5 功能介绍
1. 新增 - [问题优化模块](/docs/workflow/modules/coreferenceresolution/)
1. 新增 - [问题补全模块](/docs/workflow/modules/coreferenceresolution/)
2. 新增 - [文本编辑模块](/docs/workflow/modules/text_editor/)
3. 新增 - [判断器模块](/docs/workflow/modules/tfswitch/)
4. 新增 - [自定义反馈模块](/docs/workflow/modules/custom_feedback/)

View File

@@ -11,7 +11,7 @@ weight: 829
发起 1 个 HTTP 请求 ({{rootkey}} 替换成环境变量里的 `rootkey`{{host}} 替换成自己域名)
1. https://xxxxx/api/admin/initv467
1. https://xxxxx/api/admin/initv464
```bash
curl --location --request POST 'https://{{host}}/api/admin/initv467' \

View File

@@ -36,7 +36,6 @@ mongo:
cd 项目目录
# 创建 mongo 密钥
openssl rand -base64 756 > ./mongodb.key
# 600不行可以用chmod 999
chmod 600 ./mongodb.key
chown 999:root ./mongodb.key
# 重启 Mongo

View File

@@ -1,13 +0,0 @@
---
title: 'V4.6.9(进行中)'
description: 'FastGPT V4.6.9更新说明'
icon: 'upgrade'
draft: false
toc: true
weight: 827
---
## V4.6.9 更新说明
1. 优化 - 重写了计量模式