mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-18 17:51:24 +00:00
fix: doc path (#5393)
This commit is contained in:
@@ -29,16 +29,16 @@ export default function NotFound() {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
const tryRedirect = async () => {
|
||||
(async () => {
|
||||
if (exactMap[pathname]) {
|
||||
router.replace(exactMap[pathname]);
|
||||
window.location.replace(exactMap[pathname]);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const [oldPrefix, newPrefix] of Object.entries(prefixMap)) {
|
||||
if (pathname.startsWith(oldPrefix)) {
|
||||
const rest = pathname.slice(oldPrefix.length);
|
||||
router.replace(newPrefix + rest);
|
||||
window.location.replace(newPrefix + rest);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -54,17 +54,15 @@ export default function NotFound() {
|
||||
|
||||
if (validPage) {
|
||||
console.log('validPage', validPage);
|
||||
router.replace(validPage);
|
||||
window.location.replace(validPage);
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('meta.json fallback failed:', e);
|
||||
}
|
||||
|
||||
router.replace(fallbackRedirect);
|
||||
};
|
||||
|
||||
tryRedirect();
|
||||
window.location.replace(fallbackRedirect);
|
||||
})();
|
||||
}, [pathname, router]);
|
||||
|
||||
return null;
|
||||
|
@@ -3,7 +3,7 @@ title: 配置文件介绍
|
||||
description: FastGPT 配置参数介绍
|
||||
---
|
||||
|
||||
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/development/docker/) 来挂载配置文件。
|
||||
由于环境变量不利于配置复杂的内容,新版 FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/introduction/development/docker/) 来挂载配置文件。
|
||||
|
||||
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
|
||||
|
||||
@@ -70,4 +70,4 @@ description: FastGPT 配置参数介绍
|
||||
|
||||
### 使用 Marker 解析 PDF 文件
|
||||
|
||||
[点击查看 Marker 接入教程](/docs/development/custom-models/marker)
|
||||
[点击查看 Marker 接入教程](/docs/introduction/development/custom-models/marker)
|
||||
|
@@ -9,9 +9,9 @@ FastGPT 默认使用了 OpenAI 的 LLM 模型和向量模型,如果想要私
|
||||
|
||||
## 部署镜像
|
||||
|
||||
+ 镜像名: `stawky/chatglm2-m3e:latest`
|
||||
+ 国内镜像名: `registry.cn-hangzhou.aliyuncs.com/fastgpt_docker/chatglm2-m3e:latest`
|
||||
+ 端口号: 6006
|
||||
- 镜像名: `stawky/chatglm2-m3e:latest`
|
||||
- 国内镜像名: `registry.cn-hangzhou.aliyuncs.com/fastgpt_docker/chatglm2-m3e:latest`
|
||||
- 端口号: 6006
|
||||
|
||||
```
|
||||
# 设置安全凭证(即oneapi中的渠道密钥)
|
||||
@@ -21,7 +21,7 @@ FastGPT 默认使用了 OpenAI 的 LLM 模型和向量模型,如果想要私
|
||||
|
||||
## 接入 OneAPI
|
||||
|
||||
文档链接:[One API](/docs/development/modelconfig/one-api/)
|
||||
文档链接:[One API](/docs/introduction/development/modelconfig/one-api/)
|
||||
|
||||
为 chatglm2 和 m3e-large 各添加一个渠道,参数如下:
|
||||
|
||||
|
@@ -81,7 +81,6 @@ ollama pull [模型名]
|
||||
|
||||

|
||||
|
||||
|
||||
### 测试通信
|
||||
|
||||
在安装完成后,需要进行检测测试,首先进入 FastGPT 所在的容器,尝试访问自己的 Ollama ,命令如下:
|
||||
@@ -108,7 +107,7 @@ ollama ls
|
||||
|
||||
### 2. AI Proxy 接入
|
||||
|
||||
如果你采用的是 FastGPT 中的默认配置文件部署[这里](/docs/development/docker.md),即默认采用 AI Proxy 进行启动。
|
||||
如果你采用的是 FastGPT 中的默认配置文件部署[这里](/docs/introduction/development/docker.md),即默认采用 AI Proxy 进行启动。
|
||||
|
||||

|
||||
|
||||
@@ -116,7 +115,7 @@ ollama ls
|
||||
|
||||

|
||||
|
||||
在 FastGPT 中点击账号->模型提供商->模型配置->新增模型,添加自己的模型即可,添加模型时需要保证模型ID和 OneAPI 中的模型名称一致。详细参考[这里](/docs/development/modelConfig/intro.md)
|
||||
在 FastGPT 中点击账号->模型提供商->模型配置->新增模型,添加自己的模型即可,添加模型时需要保证模型ID和 OneAPI 中的模型名称一致。详细参考[这里](/docs/introduction/development/modelConfig/intro.md)
|
||||
|
||||

|
||||
|
||||
@@ -177,4 +176,5 @@ docker run -it --network [ FastGPT 网络 ] --name 容器名 intel/oneapi-hpckit
|
||||

|
||||
|
||||
### 6. 补充
|
||||
|
||||
上述接入 Ollama 的代理地址中,主机安装 Ollama 的地址为“http://[主机IP]:[端口]”,容器部署 Ollama 地址为“http://[容器名]:[端口]”
|
||||
|
@@ -13,8 +13,8 @@ Xinference 支持多种推理引擎作为后端,以满足不同场景下部署
|
||||
|
||||
如果你的目标是在一台 Linux 或者 Window 服务器上部署大模型,可以选择 Transformers 或 vLLM 作为 Xinference 的推理后端:
|
||||
|
||||
+ [Transformers](https://huggingface.co/docs/transformers/index):通过集成 Huggingface 的 Transformers 库作为后端,Xinference 可以最快地 集成当今自然语言处理(NLP)领域的最前沿模型(自然也包括 LLM)。
|
||||
+ [vLLM](https://vllm.ai/): vLLM 是由加州大学伯克利分校开发的一个开源库,专为高效服务大型语言模型(LLM)而设计。它引入了 PagedAttention 算法, 通过有效管理注意力键和值来改善内存管理,吞吐量能够达到 Transformers 的 24 倍,因此 vLLM 适合在生产环境中使用,应对高并发的用户访问。
|
||||
- [Transformers](https://huggingface.co/docs/transformers/index):通过集成 Huggingface 的 Transformers 库作为后端,Xinference 可以最快地 集成当今自然语言处理(NLP)领域的最前沿模型(自然也包括 LLM)。
|
||||
- [vLLM](https://vllm.ai/): vLLM 是由加州大学伯克利分校开发的一个开源库,专为高效服务大型语言模型(LLM)而设计。它引入了 PagedAttention 算法, 通过有效管理注意力键和值来改善内存管理,吞吐量能够达到 Transformers 的 24 倍,因此 vLLM 适合在生产环境中使用,应对高并发的用户访问。
|
||||
|
||||
假设你服务器配备 NVIDIA 显卡,可以参考[这篇文章中的指令来安装 CUDA](https://xorbits.cn/blogs/langchain-streamlit-doc-chat),从而让 Xinference 最大限度地利用显卡的加速功能。
|
||||
|
||||
@@ -98,7 +98,7 @@ xinference launch -n qwen-chat -s 14 -f pytorch
|
||||
|
||||
## 将本地模型接入 One API
|
||||
|
||||
One API 的部署和接入请参考[这里](/docs/development/modelconfig/one-api/)。
|
||||
One API 的部署和接入请参考[这里](/docs/introduction/development/modelconfig/one-api/)。
|
||||
|
||||
为 qwen1.5-chat 添加一个渠道,这里的 Base URL 需要填 Xinference 服务的端点,并且注册 qwen-chat (模型的 UID) 。
|
||||
|
||||
@@ -153,9 +153,6 @@ curl --location --request POST 'https://[oneapi_url]/v1/chat/completions' \
|
||||
|
||||
然后重启 FastGPT 就可以在应用配置中选择 Qwen 模型进行对话:
|
||||
|
||||

|
||||
---
|
||||
|
||||
+ 参考:[FastGPT + Xinference:一站式本地 LLM 私有化部署和应用开发](https://xorbits.cn/blogs/fastgpt-weather-chat)
|
||||
|
||||
## 
|
||||
|
||||
- 参考:[FastGPT + Xinference:一站式本地 LLM 私有化部署和应用开发](https://xorbits.cn/blogs/fastgpt-weather-chat)
|
||||
|
@@ -58,7 +58,7 @@ Zilliz Cloud 由 Milvus 原厂打造,是全托管的 SaaS 向量数据库服
|
||||
|
||||
### 1. 确保网络环境
|
||||
|
||||
如果使用`OpenAI`等国外模型接口,请确保可以正常访问,否则会报错:`Connection error` 等。 方案可以参考:[代理方案](/docs/development/proxy/)
|
||||
如果使用`OpenAI`等国外模型接口,请确保可以正常访问,否则会报错:`Connection error` 等。 方案可以参考:[代理方案](/docs/introduction/development/proxy/nginx)
|
||||
|
||||
### 2. 准备 Docker 环境
|
||||
|
||||
@@ -181,7 +181,7 @@ docker-compose up -d
|
||||
### 6. 配置模型
|
||||
|
||||
- 首次登录FastGPT后,系统会提示未配置`语言模型`和`索引模型`,并自动跳转模型配置页面。系统必须至少有这两类模型才能正常使用。
|
||||
- 如果系统未正常跳转,可以在`账号-模型提供商`页面,进行模型配置。[点击查看相关教程](/docs/development/modelconfig/ai-proxy)
|
||||
- 如果系统未正常跳转,可以在`账号-模型提供商`页面,进行模型配置。[点击查看相关教程](/docs/introduction/development/modelConfig/ai-proxy)
|
||||
- 目前已知可能问题:首次进入系统后,整个浏览器 tab 无法响应。此时需要删除该tab,重新打开一次即可。
|
||||
|
||||
## FAQ
|
||||
@@ -271,7 +271,7 @@ docker-compose up -d
|
||||
|
||||
### 如何更新版本?
|
||||
|
||||
1. 查看[更新文档](/docs/development/upgrading/index/),确认要升级的版本,避免跨版本升级。
|
||||
1. 查看[更新文档](/docs/upgrading),确认要升级的版本,避免跨版本升级。
|
||||
2. 修改镜像 tag 到指定版本
|
||||
3. 执行下面命令会自动拉取镜像:
|
||||
|
||||
@@ -284,7 +284,7 @@ docker-compose up -d
|
||||
|
||||
### 如何自定义配置文件?
|
||||
|
||||
修改`config.json`文件,并执行`docker-compose down`再执行`docker-compose up -d`重起容器。具体配置,参考[配置详解](/docs/development/configuration)。
|
||||
修改`config.json`文件,并执行`docker-compose down`再执行`docker-compose up -d`重起容器。具体配置,参考[配置详解](/docs/introduction/development/configuration)。
|
||||
|
||||
### 如何检查自定义配置文件是否挂载
|
||||
|
||||
|
@@ -18,7 +18,7 @@ description: FastGPT 私有部署常见问题
|
||||
|
||||
### OneAPI 错误
|
||||
|
||||
带有`requestId`的,都是 OneAPI 提示错误,大部分都是因为模型接口报错。可以参考 [OneAPI 常见错误](/docs/development/faq/#三常见的-oneapi-错误)
|
||||
带有`requestId`的,都是 OneAPI 提示错误,大部分都是因为模型接口报错。可以参考 [OneAPI 常见错误](/docs/introduction/development/faq/#三常见的-oneapi-错误)
|
||||
|
||||
## 二、通用问题
|
||||
|
||||
@@ -64,8 +64,10 @@ description: FastGPT 私有部署常见问题
|
||||
|
||||
1. 关闭翻译
|
||||
2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。
|
||||
* 95%情况是配置文件不对。会提示 xxx undefined
|
||||
* 提示`URI malformed`,请 Issue 反馈具体操作和页面,这是由于特殊字符串编码解析报错。
|
||||
|
||||
- 95%情况是配置文件不对。会提示 xxx undefined
|
||||
- 提示`URI malformed`,请 Issue 反馈具体操作和页面,这是由于特殊字符串编码解析报错。
|
||||
|
||||
3. 某些api不兼容问题(较少)
|
||||
|
||||
### 开启内容补全后,响应速度变慢
|
||||
@@ -120,7 +122,8 @@ FastGPT 模型配置文件中的 model 必须与 OneAPI 渠道中的模型对应
|
||||
|
||||
### 点击模型测试失败
|
||||
|
||||
OneAPI 只会测试渠道的第一个模型,并且只会测试对话模型,向量模型无法自动测试,需要手动发起请求进行测试。[查看测试模型命令示例](/docs/development/faq/#如何检查模型问题)
|
||||
OneAPI 只会测试渠道的第一个模型,并且只会测试对话模型,向量模型无法自动测试,需要手动发起请求进行测试。[查看测试模型命令示例](/docs/introduction/development/faq/#如何检查模型问题)
|
||||
|
||||
### get request url failed: Post `"https://xxx"` dial tcp: xxxx
|
||||
|
||||
OneAPI 与模型网络不通,需要检查网络配置。
|
||||
@@ -137,7 +140,6 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
|
||||
2. 模型接口参数异常(温度、max token等可能不适配)
|
||||
3. ....
|
||||
|
||||
|
||||
### Tiktoken 下载失败
|
||||
|
||||
由于 OneAPI 会在启动时从网络下载一个 tiktoken 的依赖,如果网络异常,就会导致启动失败。可以参考[OneAPI 离线部署](https://blog.csdn.net/wanh/article/details/139039216)解决。
|
||||
|
@@ -24,6 +24,7 @@ import FastGPTLink from '@/components/docs/linkFastGPT';
|
||||
|
||||
1. 用户默认的时区为 `Asia/Shanghai`,非 linux 环境时候,获取系统时间会异常,本地开发时候,可以将用户的时区调整成 UTC(+0)。
|
||||
2. 建议先服务器装好**数据库**,再进行本地开发。
|
||||
|
||||
</Alert>
|
||||
|
||||
### 1. Fork 存储库
|
||||
@@ -46,9 +47,11 @@ git clone git@github.com:<github_username>/FastGPT.git
|
||||
|
||||
### 3. 安装数据库
|
||||
|
||||
第一次开发,需要先部署数据库,建议本地开发可以随便找一台 2C2G 的轻量小数据库实践,或者新建文件夹并配置相关文件用以运行docker。数据库部署教程:[Docker 快速部署](/docs/development/docker/)。部署完了,可以本地访问其数据库。
|
||||
第一次开发,需要先部署数据库,建议本地开发可以随便找一台 2C2G 的轻量小数据库实践,或者新建文件夹并配置相关文件用以运行docker。数据库部署教程:[Docker 快速部署](/docs/introduction/development/docker/)。部署完了,可以本地访问其数据库。
|
||||
|
||||
<Alert context="warning">
|
||||
Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnection=true` 参数,才能连接上副本集的数据库。
|
||||
Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnection=true`
|
||||
参数,才能连接上副本集的数据库。
|
||||
</Alert>
|
||||
|
||||
### 4. 初始配置
|
||||
@@ -61,7 +64,7 @@ Mongo 数据库需要注意,需要注意在连接地址中增加 `directConnec
|
||||
|
||||
**2. config 配置文件**
|
||||
|
||||
复制 `data/config.json` 文件,生成一个 `data/config.local.json` 配置文件,具体配置参数说明,可参考 [config 配置说明](/docs/development/configuration)
|
||||
复制 `data/config.json` 文件,生成一个 `data/config.local.json` 配置文件,具体配置参数说明,可参考 [config 配置说明](/docs/introduction/development/configuration)
|
||||
|
||||
**注意:json 配置文件不能包含注释,介绍中为了方便看才加入的注释**
|
||||
|
||||
@@ -128,7 +131,7 @@ make build name=app image=registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8
|
||||
FastGPT 在`pnpm i`后会执行`postinstall`脚本,用于自动生成`ChakraUI`的`Type`。如果没有权限,可以先执行`chmod -R +x ./scripts/`,再执行`pnpm i`。
|
||||
|
||||
仍不可行的话,可以手动执行`./scripts/postinstall.sh`里的内容。
|
||||
*如果是Windows下的话,可以使用git bash给`postinstall`脚本添加执行权限并执行sh脚本*
|
||||
_如果是Windows下的话,可以使用git bash给`postinstall`脚本添加执行权限并执行sh脚本_
|
||||
|
||||
### TypeError: Cannot read properties of null (reading 'useMemo' )
|
||||
|
||||
@@ -148,7 +151,11 @@ FastGPT 在`pnpm i`后会执行`postinstall`脚本,用于自动生成`ChakraUI
|
||||
|
||||
遇到困难了吗?有任何问题吗? 加入飞书群与开发者和用户保持沟通。
|
||||
|
||||
<img width="400px" src="https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png" className="medium-zoom-image" />
|
||||
<img
|
||||
width="400px"
|
||||
src="https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png"
|
||||
className="medium-zoom-image"
|
||||
/>
|
||||
|
||||
## 代码结构说明
|
||||
|
||||
|
@@ -47,12 +47,12 @@ AI proxy 相关功能,可以在`账号-模型提供商`页面找到。
|
||||
|
||||
1. 渠道名:展示在外部的渠道名称,仅作标识;
|
||||
2. 厂商:模型对应的厂商,不同厂商对应不同的默认地址和 API 密钥格式;
|
||||
3. 模型:当前渠道具体可以使用的模型,系统内置了主流的一些模型,如果下拉框中没有想要的选项,可以点击“新增模型”,[增加自定义模型](/docs/development/modelconfig/intro/#新增自定义模型);
|
||||
3. 模型:当前渠道具体可以使用的模型,系统内置了主流的一些模型,如果下拉框中没有想要的选项,可以点击“新增模型”,[增加自定义模型](/docs/introduction/development/modelconfig/intro/#新增自定义模型);
|
||||
4. 模型映射:将 FastGPT 请求的模型,映射到具体提供的模型上。例如:
|
||||
|
||||
```json
|
||||
{
|
||||
"gpt-4o-test": "gpt-4o",
|
||||
"gpt-4o-test": "gpt-4o"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -81,7 +81,7 @@ FatGPT 中的模型为 `gpt-4o-test`,向 AI Proxy 发起请求时也是 `gpt-4
|
||||
|
||||
### 3. 启用模型
|
||||
|
||||
最后在`模型配置`中,可以选择启用对应的模型,这样就能在平台中使用了,更多模型配置可以参考[模型配置](/docs/development/modelconfig/intro)
|
||||
最后在`模型配置`中,可以选择启用对应的模型,这样就能在平台中使用了,更多模型配置可以参考[模型配置](/docs/introduction/development/modelconfig/intro)
|
||||
|
||||

|
||||
|
||||
|
@@ -15,11 +15,11 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
#### AI Proxy
|
||||
|
||||
从 4.8.23 版本开始, FastGPT 支持在页面上配置模型提供商,即使用 [AI Proxy 接入教程](/docs/development/modelconfig/ai-proxy) 来进行模型聚合,从而可以对接更多模型提供商。
|
||||
从 4.8.23 版本开始, FastGPT 支持在页面上配置模型提供商,即使用 [AI Proxy 接入教程](/docs/introduction/development/modelconfig/ai-proxy) 来进行模型聚合,从而可以对接更多模型提供商。
|
||||
|
||||
#### One API
|
||||
|
||||
也可以使用 [OneAPI 接入教程](/docs/development/modelconfig/one-api)。你需要先在各服务商申请好 API 接入 OneAPI 后,才能在 FastGPT 中使用这些模型。示例流程如下:
|
||||
也可以使用 [OneAPI 接入教程](/docs/introduction/development/modelconfig/one-api)。你需要先在各服务商申请好 API 接入 OneAPI 后,才能在 FastGPT 中使用这些模型。示例流程如下:
|
||||
|
||||

|
||||
|
||||
@@ -223,7 +223,7 @@ FastGPT 页面上提供了每类模型的简单测试,可以初步检查模型
|
||||
|
||||
#### 私有部署模型
|
||||
|
||||
[点击查看部署 ReRank 模型教程](/docs/development/custom-models/bge-rerank/)
|
||||
[点击查看部署 ReRank 模型教程](/docs/introduction/development/custom-models/bge-rerank/)
|
||||
|
||||
### 接入语音识别模型
|
||||
|
||||
@@ -253,7 +253,7 @@ OneAPI 的语言识别接口,无法正确的识别其他模型(会始终识
|
||||
|
||||
所有接口均遵循 OpenAI 提供的模型格式,可参考 [OpenAI API 文档](https://platform.openai.com/docs/api-reference/introduction) 进行配置。
|
||||
|
||||
由于 OpenAI 没有提供 ReRank 模型,遵循的是 Cohere 的格式。[点击查看接口请求示例](/docs/development/faq/#如何检查模型问题)
|
||||
由于 OpenAI 没有提供 ReRank 模型,遵循的是 Cohere 的格式。[点击查看接口请求示例](/docs/introduction/development/faq/#如何检查模型问题)
|
||||
|
||||
### 模型价格配置
|
||||
|
||||
@@ -276,13 +276,13 @@ OneAPI 的语言识别接口,无法正确的识别其他模型(会始终识
|
||||
|
||||
### 添加模型
|
||||
|
||||
你可以在`FastGPT-plugin`项目中`modules/model/provider`目录下,找对应模型提供商的配置文件,并追加模型配置。请自行全文检查,`model`字段,必须在所有模型中唯一。具体配置字段说明,参考[模型配置字段说明](/docs/development/modelconfig/intro/#通过配置文件配置)
|
||||
你可以在`FastGPT-plugin`项目中`modules/model/provider`目录下,找对应模型提供商的配置文件,并追加模型配置。请自行全文检查,`model`字段,必须在所有模型中唯一。具体配置字段说明,参考[模型配置字段说明](/docs/introduction/development/modelconfig/intro/#通过配置文件配置)
|
||||
|
||||
## 旧版模型配置说明
|
||||
|
||||
配置好 OneAPI 后,需要在`config.json`文件中,手动的增加模型配置,并重启。
|
||||
|
||||
由于环境变量不利于配置复杂的内容,FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/development/docker/) 来挂载配置文件。
|
||||
由于环境变量不利于配置复杂的内容,FastGPT 采用了 ConfigMap 的形式挂载配置文件,你可以在 `projects/app/data/config.json` 看到默认的配置文件。可以参考 [docker-compose 快速部署](/docs/introduction/development/docker/) 来挂载配置文件。
|
||||
|
||||
**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。
|
||||
**Docker部署**,修改`config.json` 文件,需要重启容器。
|
||||
|
@@ -8,7 +8,8 @@ import { Alert } from '@/components/docs/Alert';
|
||||
FastGPT 还可以通过 PPIO LLM API 接入模型。
|
||||
|
||||
<Alert context="warning">
|
||||
以下内容搬运自 [FastGPT 接入 PPIO LLM API](https://ppinfra.com/docs/third-party/fastgpt-use),可能会有更新不及时的情况。
|
||||
以下内容搬运自 [FastGPT 接入 PPIO LLM
|
||||
API](https://ppinfra.com/docs/third-party/fastgpt-use),可能会有更新不及时的情况。
|
||||
</Alert>
|
||||
|
||||
FastGPT 是一个将 AI 开发、部署和使用全流程简化为可视化操作的平台。它使开发者不需要深入研究算法,
|
||||
@@ -32,15 +33,25 @@ PPIO 派欧云提供简单易用的 API 接口,让开发者能够轻松调用
|
||||
登录派欧云控制台 [API 秘钥管理](https://www.ppinfra.com/settings/key-management) 页面,点击创建按钮。
|
||||
注册账号填写邀请码【VOJL20】得 50 代金券
|
||||
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/BKWqbzI5PoYG6qxwAPxcinQDnob.png" alt="创建 API 密钥" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/BKWqbzI5PoYG6qxwAPxcinQDnob.png"
|
||||
alt="创建 API 密钥"
|
||||
/>
|
||||
|
||||
(3) 生成并保存 【API 密钥】
|
||||
|
||||
<Alert context="warning">
|
||||
秘钥在服务端是加密存储,请在生成时保存好秘钥;若遗失可以在控制台上删除并创建一个新的秘钥。
|
||||
秘钥在服务端是加密存储,请在生成时保存好秘钥;若遗失可以在控制台上删除并创建一个新的秘钥。
|
||||
</Alert>
|
||||
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/OkUwbbWrcoCY2SxwVMIcM2aZnrs.png" alt="生成 API 密钥" />
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/GExfbvcosoJhVKxpzKVczlsdn3d.png" alt="保存 API 密钥" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/OkUwbbWrcoCY2SxwVMIcM2aZnrs.png"
|
||||
alt="生成 API 密钥"
|
||||
/>
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/GExfbvcosoJhVKxpzKVczlsdn3d.png"
|
||||
alt="保存 API 密钥"
|
||||
/>
|
||||
|
||||
(4) 获取需要使用的模型 ID
|
||||
|
||||
@@ -55,7 +66,7 @@ deepseek 系列:
|
||||
## 2. 部署最新版 FastGPT 到本地环境
|
||||
|
||||
<Alert context="warning">
|
||||
请使用 v4.8.22 以上版本,部署参考: https://doc.tryfastgpt.ai/docs/development/intro/
|
||||
请使用 v4.8.22 以上版本,部署参考: https://doc.fastgpt.io/docs/introduction/development/intro/
|
||||
</Alert>
|
||||
|
||||
## 3. 模型配置(下面两种方式二选其一)
|
||||
@@ -68,33 +79,62 @@ OPENAI_BASE_URL= http://OneAPI-IP:OneAPI-PORT/v1
|
||||
|
||||
- 修改后重启 FastGPT,按下图在模型提供商中选择派欧云
|
||||
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/Fvqzb3kTroys5Uxkjlzco7kwnsb.png" alt="选择派欧云" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/Fvqzb3kTroys5Uxkjlzco7kwnsb.png"
|
||||
alt="选择派欧云"
|
||||
/>
|
||||
|
||||
- 测试连通性
|
||||
以 deepseek 为例,在模型中选择使用 deepseek/deepseek-r1/community,点击图中②的位置进行连通性测试,出现图中绿色的的成功显示证明连通成功,可以进行后续的配置对话了
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/FzKGbGsSPoX4Eexobj2cxcaTnib.png" alt="测试连通性" />
|
||||
以 deepseek 为例,在模型中选择使用 deepseek/deepseek-r1/community,点击图中②的位置进行连通性测试,出现图中绿色的的成功显示证明连通成功,可以进行后续的配置对话了
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/FzKGbGsSPoX4Eexobj2cxcaTnib.png"
|
||||
alt="测试连通性"
|
||||
/>
|
||||
|
||||
(2)不使用 OneAPI 接入 PPIO 模型
|
||||
|
||||
按照下图在模型提供商中选择派欧云
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/QbcdbPqRsoAmuyx2nlycQWFanrc.png" alt="选择派欧云" />
|
||||
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/QbcdbPqRsoAmuyx2nlycQWFanrc.png"
|
||||
alt="选择派欧云"
|
||||
/>
|
||||
|
||||
- 配置模型 自定义请求地址中输入:`https://api.ppinfra.com/v3/openai/chat/completions`
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/ZVyAbDIaxo7ksAxLI3HcexYYnZf.png" alt="配置模型" />
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/Ha9YbggkwoQsVdx1Z4Gc9zUSnle.png" alt="配置模型" />
|
||||
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/ZVyAbDIaxo7ksAxLI3HcexYYnZf.png"
|
||||
alt="配置模型"
|
||||
/>
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/Ha9YbggkwoQsVdx1Z4Gc9zUSnle.png"
|
||||
alt="配置模型"
|
||||
/>
|
||||
|
||||
- 测试连通性
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/V1f0b89uloab9uxxj7IcKT0rn3e.png" alt="测试连通性" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/V1f0b89uloab9uxxj7IcKT0rn3e.png"
|
||||
alt="测试连通性"
|
||||
/>
|
||||
|
||||
出现图中绿色的的成功显示证明连通成功,可以进行对话配置
|
||||
|
||||
## 4. 配置对话
|
||||
|
||||
(1)新建工作台
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/ZaGpbBH6QoVubIx2TsLcwYEInfe.png" alt="新建工作台" />
|
||||
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/ZaGpbBH6QoVubIx2TsLcwYEInfe.png"
|
||||
alt="新建工作台"
|
||||
/>
|
||||
(2)开始聊天
|
||||
<img src="https://static.ppinfra.com/docs/image/llm/HzcTb4gobokVRQxTlU7cD5OunMf.png" alt="开始聊天" />
|
||||
<img
|
||||
src="https://static.ppinfra.com/docs/image/llm/HzcTb4gobokVRQxTlU7cD5OunMf.png"
|
||||
alt="开始聊天"
|
||||
/>
|
||||
|
||||
## PPIO 全新福利重磅来袭 🔥
|
||||
|
||||
顺利完成教程配置步骤后,您将解锁两大权益:1. 畅享 PPIO 高速通道与 FastGPT 的效能组合;2.立即激活 **「新用户邀请奖励」** ————通过专属邀请码邀好友注册,您与好友可各领 50 元代金券,硬核福利助力 AI 工具效率倍增!
|
||||
|
||||
🎁 新手专享:立即使用邀请码【VOJL20】完成注册,50 元代金券奖励即刻到账!
|
||||
|
@@ -5,11 +5,10 @@ description: 通过 SiliconCloud 体验开源模型
|
||||
|
||||
[SiliconCloud(硅基流动)](https://cloud.siliconflow.cn/i/TR9Ym0c4) 是一个以提供开源模型调用为主的平台,并拥有自己的加速引擎。帮助用户低成本、快速的进行开源模型的测试和使用。实际体验下来,他们家模型的速度和稳定性都非常不错,并且种类丰富,覆盖语言、向量、重排、TTS、STT、绘图、视频生成模型,可以满足 FastGPT 中所有模型需求。
|
||||
|
||||
如果你想部分模型使用 SiliconCloud 的模型,可额外参考[OneAPI接入硅基流动](/docs/development/modelconfig/one-api/#硅基流动--开源模型大合集)。
|
||||
如果你想部分模型使用 SiliconCloud 的模型,可额外参考[OneAPI接入硅基流动](/docs/introduction/development/modelconfig/one-api/#硅基流动--开源模型大合集)。
|
||||
|
||||
本文会介绍完全使用 SiliconCloud 模型来部署 FastGPT 的方案。
|
||||
|
||||
|
||||
## 1. 注册 SiliconCloud 账号
|
||||
|
||||
1. [点击注册硅基流动账号](https://cloud.siliconflow.cn/i/TR9Ym0c4)
|
||||
@@ -38,7 +37,7 @@ CHAT_API_KEY=sk-xxxxxx
|
||||
随便新建一个简易应用,选择对应模型,并开启图片上传后进行测试:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
可以看到,72B 的模型,性能还是非常快的,这要是本地没几个 4090,不说配置环境,输出怕都要 30s 了。
|
||||
@@ -48,7 +47,7 @@ CHAT_API_KEY=sk-xxxxxx
|
||||
新建一个知识库(由于只配置了一个向量模型,页面上不会展示向量模型选择)
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
导入本地文件,直接选择文件,然后一路下一步即可。79 个索引,大概花了 20s 的时间就完成了。现在我们去测试一下知识库问答。
|
||||
@@ -56,13 +55,13 @@ CHAT_API_KEY=sk-xxxxxx
|
||||
首先回到我们刚创建的应用,选择知识库,调整一下参数后即可开始对话:
|
||||
|
||||
| | | |
|
||||
| --- | --- | --- |
|
||||
| ------------------------------- | ------------------------------- | ------------------------------- |
|
||||
|  |  |  |
|
||||
|
||||
对话完成后,点击底部的引用,可以查看引用详情,同时可以看到具体的检索和重排得分:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
### 测试语音播放
|
||||
@@ -80,7 +79,7 @@ CHAT_API_KEY=sk-xxxxxx
|
||||
开启后,对话输入框中,会增加一个话筒的图标,点击可进行语音输入:
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
## 总结
|
||||
|
@@ -3,8 +3,6 @@ title: 对话接口
|
||||
description: FastGPT OpenAPI 对话接口
|
||||
---
|
||||
|
||||
import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
# 如何获取 AppId
|
||||
|
||||
可在应用详情的路径里获取 AppId。
|
||||
@@ -13,33 +11,29 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
# 发起对话
|
||||
|
||||
<Alert icon="🤖" context="success">
|
||||
* 该接口的 API Key 需使用`应用特定的 key`,否则会报错。
|
||||
- 该接口的 API Key 需使用`应用特定的 key`,否则会报错。
|
||||
- 有些包调用时,`BaseUrl`需要添加`v1`路径,有些不需要,如果出现404情况,可补充`v1`重试。
|
||||
|
||||
{/* * 对话现在有`v1`和`v2`两个接口,可以按需使用,v2 自 4.9.4 版本新增,v1 接口同时不再维护 */}
|
||||
|
||||
* 有些包调用时,`BaseUrl`需要添加`v1`路径,有些不需要,如果出现404情况,可补充`v1`重试。
|
||||
</Alert>
|
||||
|
||||
## 请求简易应用和工作流
|
||||
|
||||
`v1`对话接口兼容`GPT`的接口!如果你的项目使用的是标准的`GPT`官方接口,可以直接通过修改`BaseUrl`和 `Authorization`来访问 FastGpt 应用,不过需要注意下面几个规则:
|
||||
|
||||
<Alert icon="🤖" context="success">
|
||||
* 传入的`model`,`temperature`等参数字段均无效,这些字段由编排决定,不会根据 API 参数改变。
|
||||
* 不会返回实际消耗`Token`值,如果需要,可以设置`detail=true`,并手动计算 `responseData` 里的`tokens`值。
|
||||
</Alert>
|
||||
|
||||
### 请求
|
||||
|
||||
<Tabs items={['基础请求示例','图片/文件请求示例','参数说明']}>
|
||||
<Tabs items={["基础请求示例","图片/文件请求示例","参数说明"]}>
|
||||
|
||||
<Tab value="基础请求示例">
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"chatId": "my_chatId",
|
||||
"stream": false,
|
||||
"detail": false,
|
||||
@@ -54,21 +48,21 @@ curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
|
||||
"content": "导演是谁"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
}'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="图片/文件请求示例">
|
||||
|
||||
- 仅`messages`有部分区别,其他参数一致。
|
||||
- 目前不支持上传文件,需上传到自己的对象存储中,获取对应的文件链接。
|
||||
|
||||
* 仅`messages`有部分区别,其他参数一致。
|
||||
* 目前不支持上传文件,需上传到自己的对象存储中,获取对应的文件链接。
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"chatId": "abcd",
|
||||
"stream": false,
|
||||
"messages": [
|
||||
@@ -93,280 +87,29 @@ curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
|
||||
]
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
}'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
<Tab value="参数说明">
|
||||
|
||||
<Alert context="info">
|
||||
<div>
|
||||
- headers.Authorization: Bearer [apikey]
|
||||
- chatId: string | undefined 。
|
||||
- 为 `undefined` 时(不传入),不使用 FastGpt 提供的上下文功能,完全通过传入的 messages 构建上下文。
|
||||
- 为`非空字符串`时,意味着使用 chatId 进行对话,自动从 FastGpt 数据库取历史记录,并使用 messages 数组最后一个内容作为用户问题,其余 message 会被忽略。请自行确保 chatId 唯一,长度小于250,通常可以是自己系统的对话框ID。
|
||||
- messages: 结构与 [GPT接口](https://platform.openai.com/docs/api-reference/chat/object) chat模式一致。
|
||||
- responseChatItemId: string | undefined 。如果传入,则会将该值作为本次对话的响应消息的 ID,FastGPT 会自动将该 ID 存入数据库。请确保,在当前`chatId`下,`responseChatItemId`是唯一的。
|
||||
- detail: 是否返回中间值(模块状态,响应的完整结果等),`stream模式`下会通过`event`进行区分,`非stream模式`结果保存在`responseData`中。
|
||||
- 为时(不传入),不使用 FastGpt 提供的上下文功能,完全通过传入的 messages 构建上下文。
|
||||
- 为`非空字符串`时,意味着使用 chatId 进行对话,自动从 FastGpt 数据库取历史记录,并使用 messages数组最后一个内容作为用户问题,其余 message 会被忽略。请自行确保 chatId唯一,长度小于250,通常可以是自己系统的对话框ID。
|
||||
- messages: 结构与[GPT接口](https://platform.openai.com/docs/api-reference/chat/object) chat模式一致。
|
||||
- responseChatItemId: string | undefined 。如果传入,则会将该值作为本次对话的响应消息的 ID,FastGPT会自动将该 ID 存入数据库。请确保,在当前`chatId`下,`responseChatItemId`是唯一的。
|
||||
- detail:是否返回中间值(模块状态,响应的完整结果等),`stream模式`下会通过`event`进行区分,`非stream模式`结果保存在`responseData`中。
|
||||
- variables: 模块变量,一个对象,会替换模块中,输入框内容里的`[key]`
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
{/* #### v2
|
||||
|
||||
v1,v2 接口请求参数一致,仅请求地址不一样。
|
||||
|
||||
<Tabs items={['基础请求示例','图片/文件请求示例,'参数说明']}>
|
||||
<Tab value="基础请求示例">
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/v2/chat/completions' \
|
||||
--header 'Authorization: fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"chatId": "my_chatId",
|
||||
"stream": false,
|
||||
"detail": false,
|
||||
"responseChatItemId": "my_responseChatItemId",
|
||||
"variables": {
|
||||
"uid": "asdfadsfasfd2323",
|
||||
"name": "张三"
|
||||
},
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "你是谁"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="图片/文件请求示例">
|
||||
|
||||
|
||||
* 仅`messages`有部分区别,其他参数一致。
|
||||
* 目前不支持上传文件,需上传到自己的对象存储中,获取对应的文件链接。
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/v2/chat/completions' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxxx' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"chatId": "abcd",
|
||||
"stream": false,
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "导演是谁"
|
||||
},
|
||||
{
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": "图片链接"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "file_url",
|
||||
"name": "文件名",
|
||||
"url": "文档链接,支持 txt md html word pdf ppt csv excel"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
<Alert context="info">
|
||||
- headers.Authorization: Bearer [apikey]
|
||||
- chatId: string | undefined 。
|
||||
- 为 `undefined` 时(不传入),不使用 FastGpt 提供的上下文功能,完全通过传入的 messages 构建上下文。
|
||||
- 为`非空字符串`时,意味着使用 chatId 进行对话,自动从 FastGpt 数据库取历史记录,并使用 messages 数组最后一个内容作为用户问题,其余 message 会被忽略。请自行确保 chatId 唯一,长度小于250,通常可以是自己系统的对话框ID。
|
||||
- messages: 结构与 [GPT接口](https://platform.openai.com/docs/api-reference/chat/object) chat模式一致。
|
||||
- responseChatItemId: string | undefined 。如果传入,则会将该值作为本次对话的响应消息的 ID,FastGPT 会自动将该 ID 存入数据库。请确保,在当前`chatId`下,`responseChatItemId`是唯一的。
|
||||
- detail: 是否返回中间值(模块状态,响应的完整结果等),`stream模式`下会通过`event`进行区分,`非stream模式`结果保存在`responseData`中。
|
||||
- variables: 模块变量,一个对象,会替换模块中,输入框内容里的`[key]`
|
||||
</Alert>
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
#### v1
|
||||
|
||||
|
||||
|
||||
### 响应
|
||||
|
||||
#### v2
|
||||
|
||||
v2 接口比起 v1,主要变变化在于:会在每个节点运行结束后及时返回 response,而不是等工作流结束后再统一返回。
|
||||
|
||||
<Tabs items={['detail=false,stream=false 响应','detail=false,stream=true 响应','detail=true,stream=false 响应','detail=true,stream=true 响应','event值']}>
|
||||
<Tab value="detail=false,stream=false 响应">
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "",
|
||||
"model": "",
|
||||
"usage": {
|
||||
"prompt_tokens": 1,
|
||||
"completion_tokens": 1,
|
||||
"total_tokens": 1
|
||||
},
|
||||
"choices": [
|
||||
{
|
||||
"message": {
|
||||
"role": "assistant",
|
||||
"content": "我是一个人工智能助手,旨在回答问题和提供信息。如果你有任何问题或者需要帮助,随时问我!"
|
||||
},
|
||||
"finish_reason": "stop",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="detail=false,stream=true 响应">
|
||||
|
||||
|
||||
```bash
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":"你好"},"index":0,"finish_reason":null}]}
|
||||
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":"!"},"index":0,"finish_reason":null}]}
|
||||
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":"今天"},"index":0,"finish_reason":null}]}
|
||||
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":"过得怎么样?"},"index":0,"finish_reason":null}]}
|
||||
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":null},"index":0,"finish_reason":"stop"}]}
|
||||
|
||||
data: [DONE]
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="detail=true,stream=false 响应">
|
||||
|
||||
```json
|
||||
{
|
||||
"responseData": [
|
||||
{
|
||||
"id": "iSol79OFrBH1I9kC",
|
||||
"nodeId": "448745",
|
||||
"moduleName": "common:core.module.template.work_start",
|
||||
"moduleType": "workflowStart",
|
||||
"runningTime": 0
|
||||
},
|
||||
{
|
||||
"id": "t1T94WCy6Su3BK4V",
|
||||
"nodeId": "fjLpE3XPegmoGtbU",
|
||||
"moduleName": "AI 对话",
|
||||
"moduleType": "chatNode",
|
||||
"runningTime": 1.46,
|
||||
"totalPoints": 0,
|
||||
"model": "GPT-4o-mini",
|
||||
"tokens": 64,
|
||||
"inputTokens": 10,
|
||||
"outputTokens": 54,
|
||||
"query": "你是谁",
|
||||
"reasoningText": "",
|
||||
"historyPreview": [
|
||||
{
|
||||
"obj": "Human",
|
||||
"value": "你是谁"
|
||||
},
|
||||
{
|
||||
"obj": "AI",
|
||||
"value": "我是一个人工智能助手,旨在帮助回答问题和提供信息。如果你有任何问题或需要帮助,请告诉我!"
|
||||
}
|
||||
],
|
||||
"contextTotalLen": 2
|
||||
}
|
||||
],
|
||||
"newVariables": {
|
||||
|
||||
},
|
||||
"id": "",
|
||||
"model": "",
|
||||
"usage": {
|
||||
"prompt_tokens": 1,
|
||||
"completion_tokens": 1,
|
||||
"total_tokens": 1
|
||||
},
|
||||
"choices": [
|
||||
{
|
||||
"message": {
|
||||
"role": "assistant",
|
||||
"content": "我是一个人工智能助手,旨在帮助回答问题和提供信息。如果你有任何问题或需要帮助,请告诉我!"
|
||||
},
|
||||
"finish_reason": "stop",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="detail=true,stream=true 响应">
|
||||
|
||||
|
||||
```bash
|
||||
event: flowNodeResponse
|
||||
data: {"id":"iYv2uA9rCWAtulWo","nodeId":"workflowStartNodeId","moduleName":"流程开始","moduleType":"workflowStart","runningTime":0}
|
||||
|
||||
event: flowNodeStatus
|
||||
data: {"status":"running","name":"AI 对话"}
|
||||
|
||||
event: answer
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":"你好"},"index":0,"finish_reason":null}]}
|
||||
|
||||
event: answer
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":"!"},"index":0,"finish_reason":null}]}
|
||||
|
||||
event: answer
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":"今天"},"index":0,"finish_reason":null}]}
|
||||
|
||||
event: answer
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":"过得怎么样?"},"index":0,"finish_reason":null}]}
|
||||
|
||||
event: flowNodeResponse
|
||||
data: {"id":"pVzLBF7M3Ol4n7s6","nodeId":"ixe20AHN3jy74pKf","moduleName":"AI 对话","moduleType":"chatNode","runningTime":1.48,"totalPoints":0.0042,"model":"Qwen-plus","tokens":28,"inputTokens":8,"outputTokens":20,"query":"你好","reasoningText":"","historyPreview":[{"obj":"Human","value":"你好"},{"obj":"AI","value":"你好!今天过得怎么样?"}],"contextTotalLen":2}
|
||||
|
||||
event: answer
|
||||
data: {"id":"","object":"","created":0,"model":"","choices":[{"delta":{"role":"assistant","content":null},"index":0,"finish_reason":"stop"}]}
|
||||
|
||||
event: answer
|
||||
data: [DONE]
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab valye="event值">
|
||||
|
||||
event取值:
|
||||
|
||||
- answer: 返回给客户端的文本(最终会算作回答)
|
||||
- fastAnswer: 指定回复返回给客户端的文本(最终会算作回答)
|
||||
- toolCall: 执行工具
|
||||
- toolParams: 工具参数
|
||||
- toolResponse: 工具返回
|
||||
- flowNodeStatus: 运行到的节点状态
|
||||
- flowNodeResponse: 单个节点详细响应
|
||||
- updateVariables: 更新变量
|
||||
- error: 报错
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
#### v1 */}
|
||||
|
||||
<Tabs items={['detail=false,stream=false 响应','detail=false,stream=true 响应','detail=true,stream=false 响应','detail=true,stream=true 响应','event值']}>
|
||||
<Tab value="detail=false,stream=false 响应">
|
||||
|
||||
@@ -395,7 +138,6 @@ event取值:
|
||||
</Tab>
|
||||
<Tab value="detail=false,stream=true 响应">
|
||||
|
||||
|
||||
```bash
|
||||
data: {"id":"","object":"","created":0,"choices":[{"delta":{"content":""},"index":0,"finish_reason":null}]}
|
||||
|
||||
@@ -405,12 +147,14 @@ data: {"id":"","object":"","created":0,"choices":[{"delta":{"content":"影"},"in
|
||||
|
||||
data: {"id":"","object":"","created":0,"choices":[{"delta":{"content":"《"},"index":0,"finish_reason":null}]}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="detail=true,stream=false 响应">
|
||||
|
||||
```json
|
||||
{
|
||||
"responseData": [ // 不同模块的响应值, 不同版本具体值可能有差异,可先 log 自行查看最新值。
|
||||
"responseData": [
|
||||
// 不同模块的响应值, 不同版本具体值可能有差异,可先 log 自行查看最新值。
|
||||
{
|
||||
"moduleName": "Dataset Search",
|
||||
"price": 1.2000000000000002,
|
||||
@@ -547,7 +291,6 @@ event取值:
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### 交互节点响应
|
||||
|
||||
如果工作流中包含交互节点,依然是调用该 API 接口,需要设置`detail=true`,并可以从`event=interactive`的数据中获取交互节点的配置信息。如果是`stream=false`,则可以从 choice 中获取`type=interactive`的元素,获取交互节点的选择信息。
|
||||
@@ -577,6 +320,7 @@ event取值:
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="表单输入">
|
||||
|
||||
@@ -679,17 +423,15 @@ curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions'
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
|
||||
## 请求插件
|
||||
|
||||
插件的接口与对话接口一致,仅请求参数略有区别,有以下规定:
|
||||
|
||||
* 调用插件类型的应用时,接口默认为`detail`模式。
|
||||
* 无需传入 `chatId`,因为插件只能运行一轮。
|
||||
* 无需传入`messages`。
|
||||
* 通过传递`variables`来代表插件的输入。
|
||||
* 通过获取`pluginData`来获取插件输出。
|
||||
- 调用插件类型的应用时,接口默认为`detail`模式。
|
||||
- 无需传入 `chatId`,因为插件只能运行一轮。
|
||||
- 无需传入`messages`。
|
||||
- 通过传递`variables`来代表插件的输入。
|
||||
- 通过获取`pluginData`来获取插件输出。
|
||||
|
||||
### 请求示例
|
||||
|
||||
@@ -711,8 +453,8 @@ curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
|
||||
<Tabs items={['detail=true,stream=false 响应','detail=true,stream=true 响应','输出获取']}>
|
||||
<Tab value="detail=true,stream=false 响应">
|
||||
|
||||
* 插件的输出可以通过查找`responseData`中, `moduleType=pluginOutput`的元素,其`pluginOutput`是插件的输出。
|
||||
* 流输出,仍可以通过`choices`进行获取。
|
||||
- 插件的输出可以通过查找`responseData`中, `moduleType=pluginOutput`的元素,其`pluginOutput`是插件的输出。
|
||||
- 流输出,仍可以通过`choices`进行获取。
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -776,8 +518,8 @@ curl --location --request POST 'http://localhost:3000/api/v1/chat/completions' \
|
||||
</Tab>
|
||||
<Tab value="detail=true,stream=true 响应">
|
||||
|
||||
* 插件的输出可以通过获取`event=flowResponses`中的字符串,并将其反序列化后得到一个数组。同样的,查找 `moduleType=pluginOutput`的元素,其`pluginOutput`是插件的输出。
|
||||
* 流输出,仍和对话接口一样获取。
|
||||
- 插件的输出可以通过获取`event=flowResponses`中的字符串,并将其反序列化后得到一个数组。同样的,查找 `moduleType=pluginOutput`的元素,其`pluginOutput`是插件的输出。
|
||||
- 流输出,仍和对话接口一样获取。
|
||||
|
||||
```bash
|
||||
event: flowNodeStatus
|
||||
@@ -858,15 +600,13 @@ event取值:
|
||||
|
||||
# 对话 CRUD
|
||||
|
||||
<Alert icon="🤖" context="success">
|
||||
* 以下接口可使用任意`API Key`调用。
|
||||
* 4.8.12 以上版本才能使用
|
||||
</Alert>
|
||||
|
||||
**重要字段**
|
||||
|
||||
* chatId - 指一个应用下,某一个对话窗口的 ID
|
||||
* dataId - 指一个对话窗口下,某一个对话记录的 ID
|
||||
- chatId - 指一个应用下,某一个对话窗口的 ID
|
||||
- dataId - 指一个对话窗口下,某一个对话记录的 ID
|
||||
|
||||
## 历史记录
|
||||
|
||||
@@ -890,18 +630,17 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/getHistories
|
||||
</Tab>
|
||||
<Tab value="参数说明">
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- offset - 偏移量,即从第几条数据开始取
|
||||
- pageSize - 记录数量
|
||||
- source - 对话源。source=api,表示获取通过 API 创建的对话(不会获取到页面上的对话记录)
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -939,7 +678,6 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/getHistories
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/chat/updateHistory' \
|
||||
--header 'Authorization: Bearer [apikey]' \
|
||||
@@ -955,18 +693,16 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/updateHistor
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- chatId - 历史记录 Id
|
||||
- customTitle - 自定义对话名
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -980,10 +716,10 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/updateHistor
|
||||
</Tabs>
|
||||
|
||||
### 置顶 / 取消置顶
|
||||
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/chat/updateHistory' \
|
||||
--header 'Authorization: Bearer [apikey]' \
|
||||
@@ -999,18 +735,16 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/updateHistor
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用Id
|
||||
- chatId - 历史记录 Id
|
||||
- top - 是否置顶,ture 置顶,false 取消置顶
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1028,7 +762,6 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/updateHistor
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request DELETE 'http://localhost:3000/api/core/chat/delHistory?chatId=[chatId]&appId=[appId]' \
|
||||
--header 'Authorization: Bearer [apikey]'
|
||||
@@ -1038,17 +771,15 @@ curl --location --request DELETE 'http://localhost:3000/api/core/chat/delHistory
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- chatId - 历史记录 Id
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1068,7 +799,6 @@ curl --location --request DELETE 'http://localhost:3000/api/core/chat/delHistory
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request DELETE 'http://localhost:3000/api/core/chat/clearHistories?appId=[appId]' \
|
||||
--header 'Authorization: Bearer [apikey]'
|
||||
@@ -1078,16 +808,14 @@ curl --location --request DELETE 'http://localhost:3000/api/core/chat/clearHisto
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1109,35 +837,33 @@ curl --location --request DELETE 'http://localhost:3000/api/core/chat/clearHisto
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request GET 'http://localhost:3000/api/core/chat/init?appId=[appId]&chatId=[chatId]' \
|
||||
--header 'Authorization: Bearer [apikey]'
|
||||
``` </Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
- appId - 应用 Id
|
||||
- chatId - 历史记录 Id
|
||||
</Alert>
|
||||
```bash
|
||||
curl --location --request GET 'http://localhost:3000/api/core/chat/init?appId=[appId]&chatId=[chatId]' \
|
||||
--header 'Authorization: Bearer [apikey]'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
<Tab value="参数说明" >
|
||||
|
||||
```json
|
||||
{
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- chatId - 历史记录 Id
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例">
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"statusText": "",
|
||||
"message": "",
|
||||
"data": {
|
||||
"chatId": "sPVOuEohjo3w",
|
||||
"appId": "66e29b870b24ce35330c0f08",
|
||||
"variables": {
|
||||
|
||||
},
|
||||
"variables": {},
|
||||
"app": {
|
||||
"chatConfig": {
|
||||
"questionGuide": true,
|
||||
@@ -1151,15 +877,11 @@ curl --location --request GET 'http://localhost:3000/api/core/chat/init?appId=[a
|
||||
},
|
||||
"chatInputGuide": {
|
||||
"open": false,
|
||||
"textList": [
|
||||
|
||||
],
|
||||
"textList": [],
|
||||
"customUrl": ""
|
||||
},
|
||||
"instruction": "",
|
||||
"variables": [
|
||||
|
||||
],
|
||||
"variables": [],
|
||||
"fileSelectConfig": {
|
||||
"canSelectFile": true,
|
||||
"canSelectImg": true,
|
||||
@@ -1168,20 +890,16 @@ curl --location --request GET 'http://localhost:3000/api/core/chat/init?appId=[a
|
||||
"_id": "66f1139aaab9ddaf1b5c596d",
|
||||
"welcomeText": ""
|
||||
},
|
||||
"chatModels": [
|
||||
"GPT-4o-mini"
|
||||
],
|
||||
"chatModels": ["GPT-4o-mini"],
|
||||
"name": "测试",
|
||||
"avatar": "/imgs/app/avatar/workflow.svg",
|
||||
"intro": "",
|
||||
"type": "advanced",
|
||||
"pluginInputs": [
|
||||
|
||||
]
|
||||
"pluginInputs": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
@@ -1191,7 +909,6 @@ curl --location --request GET 'http://localhost:3000/api/core/chat/init?appId=[a
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/chat/getPaginationRecords' \
|
||||
--header 'Authorization: Bearer [apikey]' \
|
||||
@@ -1209,20 +926,18 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/getPaginatio
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- chatId - 历史记录 Id
|
||||
- offset - 偏移量
|
||||
- pageSize - 记录数量
|
||||
- loadCustomFeedbacks - 是否读取自定义反馈(可选)
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1242,9 +957,7 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/getPaginatio
|
||||
}
|
||||
}
|
||||
],
|
||||
"customFeedbacks": [
|
||||
|
||||
]
|
||||
"customFeedbacks": []
|
||||
},
|
||||
{
|
||||
"_id": "670b84e6796057dda04b0fd3",
|
||||
@@ -1258,13 +971,9 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/getPaginatio
|
||||
}
|
||||
}
|
||||
],
|
||||
"customFeedbacks": [
|
||||
|
||||
],
|
||||
"customFeedbacks": [],
|
||||
"llmModuleAccount": 1,
|
||||
"totalQuoteList": [
|
||||
|
||||
],
|
||||
"totalQuoteList": [],
|
||||
"totalRunningTime": 2.42,
|
||||
"historyPreviewLength": 2
|
||||
}
|
||||
@@ -1282,7 +991,6 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/getPaginatio
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request GET 'http://localhost:3000/api/core/chat/getResData?appId=[appId]&chatId=[chatId]&dataId=[dataId]' \
|
||||
--header 'Authorization: Bearer [apikey]'
|
||||
@@ -1292,18 +1000,16 @@ curl --location --request GET 'http://localhost:3000/api/core/chat/getResData?ap
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- chatId - 对话 Id
|
||||
- dataId - 对话记录 Id
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1355,13 +1061,11 @@ curl --location --request GET 'http://localhost:3000/api/core/chat/getResData?ap
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### 删除对话记录
|
||||
|
||||
<Tabs>
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request DELETE 'http://localhost:3000/api/core/chat/item/delete?contentId=[contentId]&chatId=[chatId]&appId=[appId]' \
|
||||
--header 'Authorization: Bearer [apikey]'
|
||||
@@ -1371,18 +1075,16 @@ curl --location --request DELETE 'http://localhost:3000/api/core/chat/item/delet
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- chatId - 历史记录 Id
|
||||
- contentId - 对话记录 Id
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1400,7 +1102,6 @@ curl --location --request DELETE 'http://localhost:3000/api/core/chat/item/delet
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/updateUserFeedback' \
|
||||
--header 'Authorization: Bearer [apikey]' \
|
||||
@@ -1417,19 +1118,17 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/upd
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- chatId - 历史记录 Id
|
||||
- dataId - 对话记录 Id
|
||||
- userGoodFeedback - 用户点赞时的信息(可选),取消点赞时不填此参数即可
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1447,7 +1146,6 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/upd
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/updateUserFeedback' \
|
||||
--header 'Authorization: Bearer [apikey]' \
|
||||
@@ -1464,13 +1162,12 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/upd
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- appId - 应用 Id
|
||||
- chatId - 历史记录 Id
|
||||
- dataId - 对话记录 Id
|
||||
- userBadFeedback - 用户点踩时的信息(可选),取消点踩时不填此参数即可
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
@@ -1484,6 +1181,7 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/upd
|
||||
"data": null
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -1496,7 +1194,6 @@ curl --location --request POST 'http://localhost:3000/api/core/chat/feedback/upd
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/ai/agent/v2/createQuestionGuide' \
|
||||
--header 'Authorization: Bearer [apikey]' \
|
||||
@@ -1516,11 +1213,8 @@ curl --location --request POST 'http://localhost:3000/api/core/ai/agent/v2/creat
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
|
||||
| 参数名 | 类型 | 必填 | 说明 |
|
||||
| --- | --- | --- | --- |
|
||||
| ------------- | ------ | ---- | ---------------------------------------------------------- |
|
||||
| appId | string | ✅ | 应用 Id |
|
||||
| chatId | string | ✅ | 对话 Id |
|
||||
| questionGuide | object | | 自定义配置,不传的话,则会根据 appId,取最新发布版本的配置 |
|
||||
@@ -1537,85 +1231,18 @@ type CreateQuestionGuideParams = OutLinkChatAuthProps & {
|
||||
};
|
||||
```
|
||||
|
||||
</Alert>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"statusText": "",
|
||||
"message": "",
|
||||
"data": [
|
||||
"你对AI有什么看法?",
|
||||
"想了解AI的应用吗?",
|
||||
"你希望AI能做什么?"
|
||||
]
|
||||
"data": ["你对AI有什么看法?", "想了解AI的应用吗?", "你希望AI能做什么?"]
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
**4.8.16 前旧版接口:**
|
||||
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例">
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/ai/agent/createQuestionGuide' \
|
||||
--header 'Authorization: Bearer [apikey]' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"messages":[
|
||||
{
|
||||
"role": "user",
|
||||
"content": "你好"
|
||||
},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "你好!有什么我可以帮助你的吗?"
|
||||
}
|
||||
]
|
||||
}'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
- messages - 对话消息,提供给 AI 的消息记录
|
||||
</Alert>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"statusText": "",
|
||||
"message": "",
|
||||
"data": [
|
||||
"你对AI有什么看法?",
|
||||
"想了解AI的应用吗?",
|
||||
"你希望AI能做什么?"
|
||||
]
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -3,10 +3,8 @@ title: 知识库接口
|
||||
description: FastGPT OpenAPI 知识库接口
|
||||
---
|
||||
|
||||
import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
| 如何获取知识库ID(datasetId) | 如何获取文件集合ID(collection_id) |
|
||||
| --------------------- | --------------------- |
|
||||
| ----------------------------- | ----------------------------------- |
|
||||
|  |  |
|
||||
|
||||
## 创建训练订单
|
||||
@@ -14,7 +12,6 @@ import { Alert } from '@/components/docs/Alert';
|
||||
<Tabs items={['请求示例','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
**新例子**
|
||||
|
||||
```bash
|
||||
@@ -27,11 +24,9 @@ curl --location --request POST 'http://localhost:3000/api/support/wallet/usage/c
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
data 为 billId,可用于添加知识库数据时进行账单聚合。
|
||||
|
||||
```json
|
||||
@@ -43,7 +38,6 @@ data 为 billId,可用于添加知识库数据时进行账单聚合。
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -54,7 +48,6 @@ data 为 billId,可用于添加知识库数据时进行账单聚合。
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/create' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
@@ -71,12 +64,11 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/create' \
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
<div>
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
- parentId - 父级ID,用于构建目录结构。通常可以为 null 或者直接不传。
|
||||
- type - `dataset`或者`folder`,代表普通知识库和文件夹。不传则代表创建普通知识库。
|
||||
- name - 知识库名(必填)
|
||||
@@ -85,12 +77,12 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/create' \
|
||||
- vectorModel - 向量模型(建议传空,用系统默认的)
|
||||
- agentModel - 文本处理模型(建议传空,用系统默认的)
|
||||
- vlmModel - 图片理解模型(建议传空,用系统默认的)
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
<Tab value="响应示例" >
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -101,7 +93,6 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/create' \
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -110,7 +101,6 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/create' \
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/list?parentId=' \
|
||||
--header 'Authorization: Bearer xxxx' \
|
||||
@@ -120,21 +110,17 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/list?pare
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
<Tab value="参数说明">
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- parentId - 父级ID,传空字符串或者null,代表获取根目录下的知识库
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -164,7 +150,6 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/list?pare
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -173,27 +158,22 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/list?pare
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request GET 'http://localhost:3000/api/core/dataset/detail?id=6593e137231a2be9c5603ba7' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- id: 知识库的ID
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -232,7 +212,6 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/detail?id=
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -241,27 +220,22 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/detail?id=
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request DELETE 'http://localhost:3000/api/core/dataset/delete?id=65abc8729d1448617cba5df6' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- id: 知识库的ID
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -271,11 +245,9 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/delete?
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
## 集合
|
||||
|
||||
### 通用创建参数说明(必看)
|
||||
@@ -283,7 +255,7 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/delete?
|
||||
**入参**
|
||||
|
||||
| 参数 | 说明 | 必填 |
|
||||
| --- | --- | --- |
|
||||
| ---------------- | ----------------------------------------------------------------------------------------------------------- | ---- |
|
||||
| datasetId | 知识库ID | ✅ |
|
||||
| parentId: | 父级ID,不填则默认为根目录 | |
|
||||
| trainingType | 数据处理方式。chunk: 按文本长度进行分割;qa: 问答对提取 | ✅ |
|
||||
@@ -309,7 +281,6 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/delete?
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/create' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
@@ -325,12 +296,10 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- datasetId: 知识库的ID(必填)
|
||||
- parentId: 父级ID,不填则默认为根目录
|
||||
- name: 集合名称(必填)
|
||||
@@ -338,12 +307,11 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
- folder:文件夹
|
||||
- virtual:虚拟集合(手动集合)
|
||||
- metadata: 元数据(暂时没啥用)
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
<Tab value="响应示例" >
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
data 为集合的 ID。
|
||||
|
||||
@@ -356,11 +324,9 @@ data 为集合的 ID。
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### 创建一个纯文本集合
|
||||
|
||||
传入一段文字,创建一个集合,会根据传入的文字进行分割。
|
||||
@@ -368,7 +334,6 @@ data 为集合的 ID。
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/create/text' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
@@ -387,23 +352,20 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- text: 原文本
|
||||
- datasetId: 知识库的ID(必填)
|
||||
- parentId: 父级ID,不填则默认为根目录
|
||||
- name: 集合名称(必填)
|
||||
- metadata: 元数据(暂时没啥用)
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
<Tab value="响应示例" >
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
data 为集合的 ID。
|
||||
|
||||
@@ -424,7 +386,6 @@ data 为集合的 ID。
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -435,13 +396,12 @@ data 为集合的 ID。
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/create/link' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"link":"https://doc.tryfastgpt.ai/docs/course/quick-start/",
|
||||
"link":"https://doc.fastgpt.io/docs/course/quick-start/",
|
||||
"datasetId":"6593e137231a2be9c5603ba7",
|
||||
"parentId": null,
|
||||
|
||||
@@ -455,22 +415,19 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- link: 网络链接
|
||||
- datasetId: 知识库的ID(必填)
|
||||
- parentId: 父级ID,不填则默认为根目录
|
||||
- metadata.webPageSelector: 网页选择器,用于指定网页中的哪个元素作为文本(可选)
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
<Tab value="响应示例" >
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
data 为集合的 ID。
|
||||
|
||||
@@ -491,7 +448,6 @@ data 为集合的 ID。
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -502,7 +458,6 @@ data 为集合的 ID。
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
使用代码上传时,请注意中文 filename 需要进行 encode 处理,否则容易乱码。
|
||||
|
||||
```bash
|
||||
@@ -512,22 +467,19 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
--form 'data="{\"datasetId\":\"6593e137231a2be9c5603ba7\",\"parentId\":null,\"trainingType\":\"chunk\",\"chunkSize\":512,\"chunkSplitter\":\"\",\"qaPrompt\":\"\",\"metadata\":{}}"'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<div>
|
||||
需要使用 POST form-data 的格式上传。包含 file 和 data 两个字段。
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
- file: 文件
|
||||
- data: 知识库相关信息(json序列化后传入),参数说明见上方“通用创建参数说明”
|
||||
</Alert>
|
||||
|
||||
- data: 知识库相关信息(json序列化后传入),参数说明见上方"通用创建参数说明"
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
<Tab value="响应示例" >
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
data 为集合的 ID。
|
||||
|
||||
@@ -548,7 +500,6 @@ data 为集合的 ID。
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -557,8 +508,7 @@ data 为集合的 ID。
|
||||
传入一个文件的 id,创建一个集合,会读取文件内容进行分割。目前支持:pdf, docx, md, txt, html, csv。
|
||||
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
<Tab value="请求示例" >
|
||||
|
||||
使用代码上传时,请注意中文 filename 需要进行 encode 处理,否则容易乱码。
|
||||
|
||||
@@ -580,14 +530,12 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
}'
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
</Tab>
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<div>
|
||||
需要使用 POST form-data 的格式上传。包含 file 和 data 两个字段。
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
- name: 集合名,建议就用文件名,必填。
|
||||
- apiFileId: 文件的ID,必填。
|
||||
- datasetId: 知识库的ID(必填)
|
||||
@@ -596,13 +544,11 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
- chunkSize: 每个 chunk 的长度(可选). chunk模式:100~3000; qa模式: 4000~模型最大token(16k模型通常建议不超过10000)
|
||||
- chunkSplitter: 自定义最高优先分割符号(可选)
|
||||
- qaPrompt: qa拆分自定义提示词(可选)
|
||||
</Alert>
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
data 为集合的 ID。
|
||||
|
||||
@@ -623,8 +569,7 @@ data 为集合的 ID。
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### 创建一个外部文件库集合(商业版)
|
||||
@@ -632,7 +577,6 @@ data 为集合的 ID。
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/proApi/core/dataset/collection/create/externalFileUrl' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
@@ -654,26 +598,21 @@ curl --location --request POST 'http://localhost:3000/api/proApi/core/dataset/co
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
| 参数 | 说明 | 必填 |
|
||||
| --- | --- | --- |
|
||||
| --------------- | ------------------------------------ | ---- |
|
||||
| externalFileUrl | 文件访问链接(可以是临时链接) | ✅ |
|
||||
| externalFileId | 外部文件ID | |
|
||||
| filename | 自定义文件名,需要带后缀 | |
|
||||
| createTime | 文件创建时间(Date ISO 字符串都 ok) | |
|
||||
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
data 为集合的 ID。
|
||||
|
||||
```json
|
||||
@@ -693,7 +632,6 @@ data 为集合的 ID。
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -702,8 +640,6 @@ data 为集合的 ID。
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
**4.8.19+**
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/listV2' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
@@ -717,41 +653,22 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
}'
|
||||
```
|
||||
|
||||
**4.8.19-(不再维护)**
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/collection/list' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"pageNum":1,
|
||||
"pageSize": 10,
|
||||
"datasetId":"6593e137231a2be9c5603ba7",
|
||||
"parentId": null,
|
||||
"searchText":""
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- offset: 偏移量
|
||||
- pageSize: 每页数量,最大30(选填)
|
||||
- datasetId: 知识库的ID(必填)
|
||||
- parentId: 父级Id(选填)
|
||||
- searchText: 模糊搜索文本(选填)
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -769,10 +686,7 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
"dataAmount": 3,
|
||||
"trainingAmount": 0,
|
||||
"externalFileId": "1111",
|
||||
"tags": [
|
||||
"11",
|
||||
"测试的"
|
||||
],
|
||||
"tags": ["11", "测试的"],
|
||||
"forbid": false,
|
||||
"trainingType": "chunk",
|
||||
"permission": {
|
||||
@@ -782,7 +696,6 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
"hasWritePer": true,
|
||||
"hasReadPer": true
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"_id": "65abd0ad9d1448617cba6031",
|
||||
@@ -790,14 +703,12 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
"tmbId": "65422be6aa44b7da77729ec9",
|
||||
"type": "link",
|
||||
"name": "快速上手 | FastGPT",
|
||||
"rawLink": "https://doc.tryfastgpt.ai/docs/course/quick-start/",
|
||||
"rawLink": "https://doc.fastgpt.io/docs/course/quick-start/",
|
||||
"updateTime": "2024-01-20T13:54:53.031Z",
|
||||
"dataAmount": 3,
|
||||
"trainingAmount": 0,
|
||||
"externalFileId": "222",
|
||||
"tags": [
|
||||
"测试的"
|
||||
],
|
||||
"tags": ["测试的"],
|
||||
"forbid": false,
|
||||
"trainingType": "chunk",
|
||||
"permission": {
|
||||
@@ -814,7 +725,6 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -823,29 +733,23 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/collectio
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request GET 'http://localhost:3000/api/core/dataset/collection/detail?id=65abcfab9d1448617cba5f0d' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- id: 集合的ID
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -887,7 +791,6 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/collection
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -896,7 +799,6 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/collection
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
**通过集合 ID 修改集合信息**
|
||||
|
||||
```bash
|
||||
@@ -930,28 +832,23 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/collection
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- id: 集合的ID
|
||||
- parentId: 修改父级ID(可选)
|
||||
- name: 修改集合名称(可选)
|
||||
- tags: 修改集合标签(可选)
|
||||
- forbid: 修改集合禁用状态(可选)
|
||||
- createTime: 修改集合创建时间(可选)
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -961,7 +858,6 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/collection
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -970,29 +866,23 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/collection
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request DELETE 'http://localhost:3000/api/core/dataset/collection/delete?id=65aa2a64e6cb9b8ccdc00de8' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- id: 集合的ID
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1002,7 +892,6 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/collect
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -1013,7 +902,7 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/collect
|
||||
**Data结构**
|
||||
|
||||
| 字段 | 类型 | 说明 | 必填 |
|
||||
| --- | --- | --- | --- |
|
||||
| ------------- | ------- | -------- | ---- |
|
||||
| teamId | String | 团队ID | ✅ |
|
||||
| tmbId | String | 成员ID | ✅ |
|
||||
| datasetId | String | 知识库ID | ✅ |
|
||||
@@ -1030,7 +919,7 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/collect
|
||||
每组数据的自定义索引最多5个
|
||||
|
||||
| 字段 | 类型 | 说明 | 必填 |
|
||||
| --- | --- | --- | --- |
|
||||
| ------ | ------ | ------------------------------------------------------------------------------------------------------ | ---- |
|
||||
| type | String | 可选索引类型:default-默认索引; custom-自定义索引; summary-总结索引; question-问题索引; image-图片索引 | |
|
||||
| dataId | String | 关联的向量ID,变更数据时候传入该 ID,会进行差量更新,而不是全量更新 | |
|
||||
| text | String | 文本内容 | ✅ |
|
||||
@@ -1044,7 +933,6 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/collect
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/data/pushData' \
|
||||
--header 'Authorization: Bearer apikey' \
|
||||
@@ -1075,28 +963,25 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/data/pus
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- collectionId: 集合ID(必填)
|
||||
- trainingType:训练模式(必填)
|
||||
- prompt: 自定义 QA 拆分提示词,需严格按照模板,建议不要传入。(选填)
|
||||
- data:(具体数据)
|
||||
|
||||
- q: 主要数据(必填)
|
||||
- a: 辅助数据(选填)
|
||||
- indexes: 自定义索引(选填)。可以不传或者传空数组,默认都会使用q和a组成一个索引。
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应例子" >
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1110,12 +995,10 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/data/pus
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="QA Prompt 模板" >
|
||||
|
||||
|
||||
[theme] 里的内容可以换成数据的主题。默认为:它们可能包含多个主题内容
|
||||
|
||||
```
|
||||
@@ -1134,20 +1017,15 @@ A2:
|
||||
我的文本:"""{{text}}"""
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
### 获取集合的数据列表
|
||||
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
**4.8.11+**
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/data/v2/list' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
@@ -1160,42 +1038,21 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/data/v2/l
|
||||
}'
|
||||
```
|
||||
|
||||
**4.6.7-(即将弃用)**
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'http://localhost:3000/api/core/dataset/data/list' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"pageNum":1,
|
||||
"pageSize": 10,
|
||||
"collectionId":"65abd4ac9d1448617cba6171",
|
||||
"searchText":""
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
|
||||
<div>
|
||||
- offset: 偏移量(选填)
|
||||
- pageSize: 每页数量,最大30(选填)
|
||||
- collectionId: 集合的ID(必填)
|
||||
- searchText: 模糊搜索词(选填)
|
||||
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1233,29 +1090,23 @@ curl --location --request POST 'http://localhost:3000/api/core/dataset/data/list
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request GET 'http://localhost:3000/api/core/dataset/data/detail?id=65abd4b29d1448617cba61db' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- id: 数据的id
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1284,7 +1135,6 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/data/detai
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -1293,7 +1143,6 @@ curl --location --request GET 'http://localhost:3000/api/core/dataset/data/detai
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request PUT 'http://localhost:3000/api/core/dataset/data/update' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
@@ -1321,26 +1170,21 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/data/updat
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- dataId: 数据的id
|
||||
- q: 主要数据(选填)
|
||||
- a: 辅助数据(选填)
|
||||
- indexes: 自定义索引(选填),类型参考`为集合批量添加添加数据`。如果创建时候有自定义索引,
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1350,7 +1194,6 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/data/updat
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -1359,29 +1202,23 @@ curl --location --request PUT 'http://localhost:3000/api/core/dataset/data/updat
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request DELETE 'http://localhost:3000/api/core/dataset/data/delete?id=65abd4b39d1448617cba624d' \
|
||||
--header 'Authorization: Bearer {{authorization}}' \
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- id: 数据的id
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
@@ -1391,7 +1228,6 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/data/de
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -1400,7 +1236,6 @@ curl --location --request DELETE 'http://localhost:3000/api/core/dataset/data/de
|
||||
<Tabs items={['请求示例','参数说明','响应示例']}>
|
||||
<Tab value="请求示例" >
|
||||
|
||||
|
||||
```bash
|
||||
curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/searchTest' \
|
||||
--header 'Authorization: Bearer fastgpt-xxxxx' \
|
||||
@@ -1419,13 +1254,11 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/searchTe
|
||||
}'
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="参数说明" >
|
||||
|
||||
|
||||
<Alert icon=" " context="success">
|
||||
<div>
|
||||
- datasetId - 知识库ID
|
||||
- text - 需要测试的文本
|
||||
- limit - 最大 tokens 数量
|
||||
@@ -1435,14 +1268,12 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/searchTe
|
||||
- datasetSearchUsingExtensionQuery - 使用问题优化
|
||||
- datasetSearchExtensionModel - 问题优化模型
|
||||
- datasetSearchExtensionBg - 问题优化背景描述
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab value="响应示例" >
|
||||
|
||||
|
||||
返回 top k 结果, limit 为最大 Tokens 数量,最多 20000 tokens。
|
||||
|
||||
```json
|
||||
@@ -1465,7 +1296,5 @@ curl --location --request POST 'https://api.fastgpt.in/api/core/dataset/searchTe
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
@@ -3,8 +3,6 @@ title: 分享链接身份鉴权
|
||||
description: FastGPT 分享链接身份鉴权
|
||||
---
|
||||
|
||||
import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
## 介绍
|
||||
|
||||
在 FastGPT V4.6.4 中,我们修改了分享链接的数据读取方式,为每个用户生成一个 localId,用于标识用户,从云端拉取对话记录。但是这种方式仅能保障用户在同一设备同一浏览器中使用,如果切换设备或者清空浏览器缓存则会丢失这些记录。这种方式存在一定的风险,因此我们仅允许用户拉取近`30天`的`20条`记录。
|
||||
@@ -44,15 +42,15 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
配置校验地址后,在每次分享链接使用时,都会向对应的地址发起校验和上报请求。
|
||||
|
||||
<Alert icon="🤖">这里仅需配置根地址,无需具体到完整请求路径。</Alert>
|
||||
这里仅需配置根地址,无需具体到完整请求路径。
|
||||
|
||||
### 2. 分享链接中增加额外 query
|
||||
|
||||
在分享链接的地址中,增加一个额外的参数: authToken。例如:
|
||||
|
||||
原始的链接:`https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192`
|
||||
原始的链接:`https://share.fastgpt.io/chat/share?shareId=648aaf5ae121349a16d62192`
|
||||
|
||||
完整链接: `https://share.tryfastgpt.ai/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`
|
||||
完整链接: `https://share.fastgpt.io/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`
|
||||
|
||||
这个`authToken`通常是你系统生成的用户唯一凭证(Token之类的)。FastGPT 会在鉴权接口的`body`中携带 token=[authToken] 的参数。
|
||||
|
||||
@@ -358,9 +356,9 @@ export default async function (ctx: FunctionContext) {
|
||||
|
||||
### 3. 修改分享链接参数
|
||||
|
||||
源分享链接:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c`
|
||||
源分享链接:`https://share.fastgpt.io/chat/share?shareId=64be36376a438af0311e599c`
|
||||
|
||||
修改后:`https://share.tryfastgpt.ai/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`
|
||||
修改后:`https://share.fastgpt.io/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`
|
||||
|
||||
### 4. 测试效果
|
||||
|
||||
|
@@ -13,7 +13,7 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、Azure 、国内主流模型和本地模型等。
|
||||
|
||||
可参考:[Sealos 快速部署 OneAPI](/docs/development/modelconfig/one-api)
|
||||
可参考:[Sealos 快速部署 OneAPI](/docs/introduction/development/modelconfig/one-api)
|
||||
|
||||
## 一键部署
|
||||
|
||||
@@ -79,7 +79,7 @@ FastGPT 使用了 one-api 项目来管理模型池,其可以兼容 OpenAI 、A
|
||||
|
||||
务必先配置至少一组模型,否则系统无法正常使用。
|
||||
|
||||
[点击查看模型配置教程](/docs/development/modelConfig/intro/)
|
||||
[点击查看模型配置教程](/docs/introduction/development/modelConfig/intro/)
|
||||
|
||||
## 收费
|
||||
|
||||
@@ -110,13 +110,13 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据
|
||||
|
||||
### 如何更新/升级 FastGPT
|
||||
|
||||
[升级脚本文档](https://doc.tryfastgpt.ai/docs/development/upgrading/)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!!
|
||||
[升级脚本文档](https://doc.fastgpt.io/docs/introduction/development/upgrading/)先看下文档,看下需要升级哪个版本。注意,不要跨版本升级!!!!!
|
||||
|
||||
例如,目前是4.5 版本,要升级到4.5.1,就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。
|
||||
|
||||
升级步骤:
|
||||
|
||||
1. 查看[更新文档](/docs/development/upgrading/index/),确认要升级的版本,避免跨版本升级。
|
||||
1. 查看[更新文档](/docs/introduction/development/upgrading/index/),确认要升级的版本,避免跨版本升级。
|
||||
2. 打开 sealos 的应用管理
|
||||
3. 有2个应用 fastgpt , fastgpt-pro
|
||||
4. 点击对应应用右边3个点,变更。或者点详情后右上角的变更。
|
||||
@@ -145,7 +145,7 @@ FastGPT 商业版共包含了2个应用(fastgpt, fastgpt-plus)和2个数据
|
||||
|
||||

|
||||
|
||||
[配置文件参考](https://doc.tryfastgpt.ai/docs/development/configuration/)
|
||||
[配置文件参考](https://doc.fastgpt.io/docs/introduction/development/configuration/)
|
||||
|
||||
### 修改站点名称以及 favicon
|
||||
|
||||
@@ -184,4 +184,4 @@ SYSTEM_FAVICON 可以是一个网络地址
|
||||
|
||||
### One API 使用
|
||||
|
||||
[参考 OneAPI 使用步骤](/docs/development/modelconfig/one-api/)
|
||||
[参考 OneAPI 使用步骤](/docs/introduction/development/modelconfig/one-api/)
|
||||
|
@@ -17,7 +17,7 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||
## AI模型
|
||||
|
||||
可以通过 [config.json](/docs/development/configuration/) 配置可选的对话模型,通过 [one-api](/docs/development/modelconfig/one-api/) 来实现多模型接入。
|
||||
可以通过 [config.json](/docs/introduction/development/configuration/) 配置可选的对话模型,通过 [one-api](/docs/introduction/development/modelConfig/one-api) 来实现多模型接入。
|
||||
|
||||
点击AI模型后,可以配置模型的相关参数。
|
||||
|
||||
@@ -25,8 +25,6 @@ import { Alert } from '@/components/docs/Alert';
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
<Alert icon="🍅" context="success">
|
||||
具体配置参数介绍可以参考: [AI参数配置说明](/docs/introduction/guide/course/ai_settings/)
|
||||
具体配置参数介绍可以参考: [AI参数配置说明](/docs/introduction/guide/course/ai_settings/)
|
||||
</Alert>
|
||||
|
@@ -14,7 +14,7 @@ Web 站点同步利用爬虫的技术,可以通过一个入口网站,自动
|
||||
Tips: 国内的媒体站点基本不可用,公众号、csdn、知乎等。可以通过终端发送`curl`请求检测是否为静态站点,例如:
|
||||
|
||||
```bash
|
||||
curl https://doc.tryfastgpt.ai/docs/intro/
|
||||
curl https://doc.fastgpt.io/docs/intro/
|
||||
```
|
||||
|
||||
## 如何使用
|
||||
@@ -37,7 +37,6 @@ curl https://doc.tryfastgpt.ai/docs/intro/
|
||||
|
||||
好了, 现在点击开始同步,静等系统自动抓取网站信息即可。
|
||||
|
||||
|
||||
## 创建应用,绑定知识库
|
||||
|
||||

|
||||
|
@@ -7,7 +7,7 @@ The FastGPT project is open-sourced under the Apache License 2.0, but includes t
|
||||
|
||||
- FastGPT may be used for commercial purposes, such as operating it as "backend-as-a-service" for other applications or providing it as an enterprise development platform. However, you must contact us to obtain a commercial license under the following circumstances:
|
||||
|
||||
- Multi-tenant SaaS Service: Unless explicit written authorization from FastGPT is obtained, you may not use the source code of tryfastgpt.ai to operate a multi-tenant SaaS service similar to tryfastgpt.ai.
|
||||
- Multi-tenant SaaS Service: Unless explicit written authorization from FastGPT is obtained, you may not use the source code of fastgpt.io to operate a multi-tenant SaaS service similar to fastgpt.io.
|
||||
- Logo and Copyright Information: You may not remove or modify the FastGPT logo or copyright information within the FastGPT console.
|
||||
|
||||
For commercial licensing inquiries, please contact us via email at dennis@sealos.io.
|
||||
|
@@ -7,7 +7,7 @@ FastGPT 项目在 Apache License 2.0 许可下开源,但包含以下附加条
|
||||
|
||||
- FastGPT 允许被用于商业化,例如作为其他应用的“后端即服务”使用,或者作为应用开发平台提供给企业。然而,当满足以下条件时,必须联系作者获得商业许可:
|
||||
|
||||
- 多租户 SaaS 服务:除非获得 FastGPT 的明确书面授权,否则不得使用 tryfastgpt.ai 的源码来运营与 tryfastgpt.ai 服务类似的多租户 SaaS 服务。
|
||||
- 多租户 SaaS 服务:除非获得 FastGPT 的明确书面授权,否则不得使用 fastgpt.io 的源码来运营与 fastgpt.io 服务类似的多租户 SaaS 服务。
|
||||
- LOGO 及版权信息:在使用 FastGPT 的过程中,不得移除或修改 FastGPT 控制台内的 LOGO 或版权信息。
|
||||
|
||||
请通过电子邮件 dennis@sealos.io 联系我们咨询许可事宜。
|
||||
|
@@ -27,7 +27,7 @@ EVAL_LINE_LIMIT=1000 # 评估文件最大行数
|
||||
|
||||
1. 移除所有**开源功能**的限制,包括:应用数量和知识库数量上限。
|
||||
2. 调整 RoadMap,增加`上下文管理`,`AI 生成工作流`,`高级编排 DeBug 调试模式`等计划。
|
||||
3. 海外版域名将`tryfastgpt.ai`调整成`fastgpt.io`。
|
||||
3. 海外版域名将`fastgpt.io`调整成`fastgpt.io`。
|
||||
|
||||
## 🚀 新增内容
|
||||
|
||||
|
@@ -35,12 +35,10 @@ CREATE INDEX CONCURRENTLY vector_index ON modeldata USING hnsw (vector vector_ip
|
||||
```
|
||||
|
||||
| | |
|
||||
| --------------------- | --------------------- |
|
||||
| -------------------- | -------------------- |
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
|
||||
|
||||
## PgVector升级:Docker-compose.yml 部署方案
|
||||
|
||||
下面的命令是基于给的 docker-compose 模板,如果数据库账号密码更换了,请自行调整。
|
||||
@@ -86,4 +84,4 @@ CREATE INDEX CONCURRENTLY vector_index ON modeldata USING hnsw (vector vector_ip
|
||||
|
||||
## 该版本需要修改 `config.json` 文件
|
||||
|
||||
最新配置可参考: [V45版本最新 config.json](/docs/development/configuration)
|
||||
最新配置可参考: [V45版本最新 config.json](/docs/introduction/development/configuration)
|
||||
|
@@ -9,8 +9,7 @@ description: FastGPT V4.6 更新
|
||||
|
||||
更新镜像至 latest 或者 v4.6 版本。商业版镜像更新至 V0.2.1
|
||||
|
||||
最新配置可参考:[V46 版本最新 config.json](/docs/development/configuration),商业镜像配置文件也更新,参考最新的飞书文档。
|
||||
|
||||
最新配置可参考:[V46 版本最新 config.json](/docs/introduction/development/configuration),商业镜像配置文件也更新,参考最新的飞书文档。
|
||||
|
||||
## 2。执行初始化 API
|
||||
|
||||
@@ -40,7 +39,6 @@ curl --location --request POST 'https://{{host}}/api/admin/initv46-2' \
|
||||
3。初始化 Pg 的字段
|
||||
4。初始化 Mongo Data
|
||||
|
||||
|
||||
## V4.6 功能介绍
|
||||
|
||||
1. 新增 - 团队空间
|
||||
|
@@ -7,7 +7,7 @@ description: FastGPT V4.6.5
|
||||
|
||||
由于 openai 已开始弃用 function call,改为 toolChoice。FastGPT 同步的修改了对于的配置和调用方式,需要对配置文件做一些修改:
|
||||
|
||||
[点击查看最新的配置文件](/docs/development/configuration/)
|
||||
[点击查看最新的配置文件](/docs/introduction/development/configuration/)
|
||||
|
||||
1. 主要是修改模型的`functionCall`字段,改成`toolChoice`即可。设置为`true`的模型,会默认走 openai 的 tools 模式;未设置或设置为`false`的,会走提示词生成模式。
|
||||
|
||||
@@ -26,4 +26,3 @@ description: FastGPT V4.6.5
|
||||
7. 优化 - 高级编排连接线交互
|
||||
8. 优化 - 由于 html2md 导致的 cpu密集计算,阻断线程问题
|
||||
9. 修复 - 高级编排提示词提取描述
|
||||
|
||||
|
@@ -5,7 +5,7 @@ description: FastGPT V4.6.6
|
||||
|
||||
## 配置文件变更
|
||||
|
||||
为了减少代码重复度,我们对配置文件做了一些修改:[点击查看最新的配置文件](/docs/development/configuration/)
|
||||
为了减少代码重复度,我们对配置文件做了一些修改:[点击查看最新的配置文件](/docs/introduction/development/configuration/)
|
||||
|
||||
## 商业版变更
|
||||
|
||||
@@ -21,7 +21,7 @@ description: FastGPT V4.6.6
|
||||
|
||||
1. 查看 [FastGPT 2024 RoadMap](https://github.com/labring/FastGPT?tab=readme-ov-file#-%E5%9C%A8%E7%BA%BF%E4%BD%BF%E7%94%A8)
|
||||
2. 新增 - Http 模块请求头支持 Json 编辑器。
|
||||
3. 新增 - [ReRank模型部署](/docs/development/custom-models/bge-rerank/)
|
||||
3. 新增 - [ReRank模型部署](/docs/introduction/development/custom-models/bge-rerank/)
|
||||
4. 新增 - 搜索方式:分离向量语义检索,全文检索和重排,通过 RRF 进行排序合并。
|
||||
5. 优化 - 问题分类提示词,id引导。测试国产商用 api 模型(百度阿里智谱讯飞)使用 Prompt 模式均可分类。
|
||||
6. UI 优化,未来将逐步替换新的UI设计。
|
||||
|
@@ -67,7 +67,7 @@ docker-compose up -d
|
||||
|
||||
## 修改配置文件
|
||||
|
||||
去除了重复的模型配置,LLM模型都合并到一个属性中:[点击查看最新的配置文件](/docs/development/configuration/)
|
||||
去除了重复的模型配置,LLM模型都合并到一个属性中:[点击查看最新的配置文件](/docs/introduction/development/configuration/)
|
||||
|
||||
## 商业版初始化
|
||||
|
||||
|
@@ -5,7 +5,7 @@ description: FastGPT V4.7更新说明
|
||||
|
||||
## 1. 修改配置文件
|
||||
|
||||
增加一些 Boolean 值,用于决定不同功能块可以使用哪些模型,同时增加了模型的 logo:[点击查看最新的配置文件](/docs/development/configuration/)
|
||||
增加一些 Boolean 值,用于决定不同功能块可以使用哪些模型,同时增加了模型的 logo:[点击查看最新的配置文件](/docs/introduction/development/configuration/)
|
||||
|
||||
## 2. 初始化脚本
|
||||
|
||||
|
@@ -15,11 +15,9 @@ curl --location --request POST 'https://{{host}}/api/admin/clearInvalidData' \
|
||||
|
||||
该请求会执行脏数据清理(清理无效的文件、清理无效的图片、清理无效的知识库集合、清理无效的向量)
|
||||
|
||||
|
||||
## 修改配置文件
|
||||
|
||||
增加了Laf环境配置:[点击查看最新的配置文件](/docs/development/configuration/)
|
||||
|
||||
增加了Laf环境配置:[点击查看最新的配置文件](/docs/introduction/development/configuration/)
|
||||
|
||||
## V4.7.1 更新说明
|
||||
|
||||
|
@@ -8,13 +8,13 @@ description: FastGPT V4.8.15 更新说明
|
||||
### API 知识库
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| ------------------------------- | ------------------------------- |
|
||||
|  |  |
|
||||
|
||||
### HTML 渲染
|
||||
|
||||
| 源码模式 | 预览模式 | 全屏模式 |
|
||||
| --- | --- | --- |
|
||||
| ------------------------------- | ------------------------------- | ------------------------------- |
|
||||
|  |  |  |
|
||||
|
||||
## 升级指南
|
||||
@@ -23,7 +23,6 @@ description: FastGPT V4.8.15 更新说明
|
||||
- 更新 fastgpt-pro 商业版镜像 tag: v4.8.15
|
||||
- Sandbox 镜像,可以不更新
|
||||
|
||||
|
||||
## 运行升级脚本
|
||||
|
||||
从任意终端,发起 1 个 HTTP 请求。其中 `{{rootkey}}` 替换成环境变量里的 `rootkey`;`{{host}}` 替换成**FastGPT 域名**:
|
||||
@@ -36,7 +35,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4815' \
|
||||
|
||||
会重置应用定时执行的字段,把 null 去掉,减少索引大小。
|
||||
|
||||
----
|
||||
---
|
||||
|
||||
从任意终端,发起 1 个 HTTP 请求。其中 `{{rootkey}}` 替换成环境变量里的 `rootkey`;`{{host}}` 替换成**FastGPT 域名**:
|
||||
|
||||
@@ -48,13 +47,12 @@ curl --location --request POST 'https://{{host}}/api/admin/init/refreshFreeUser'
|
||||
|
||||
重新计算一次免费版用户的时长,之前有版本升级时没有重新计算时间,导致会误发通知。
|
||||
|
||||
|
||||
## 完整更新内容
|
||||
|
||||
1. 新增 - API 知识库, 见 [API 知识库介绍](/docs/introduction/guide/knowledge_base/api_dataset/),外部文件库会被弃用。
|
||||
2. 新增 - 工具箱页面,展示所有可用的系统资源。商业版后台可更便捷的配置系统插件和自定义分类。
|
||||
3. 新增 - Markdown 中,HTML代码会被额外渲染,可以选择预览模式,会限制所有 script 脚本,仅做展示。
|
||||
4. 新增 - 自定义系统级文件解析服务, 见 [接入 Marker PDF 文档解析](/docs/development/custom-models/marker/)
|
||||
4. 新增 - 自定义系统级文件解析服务, 见 [接入 Marker PDF 文档解析](/docs/introduction/development/custom-models/marker/)
|
||||
5. 新增 - 集合直接重新调整参数,无需删除再导入。
|
||||
6. 新增 - 商业版后台支持配置侧边栏跳转链接。
|
||||
7. 优化 - base64 图片截取判断。
|
||||
|
@@ -13,7 +13,7 @@ description: FastGPT V4.8.16 更新说明
|
||||
|
||||
### 2. 更新配置文件
|
||||
|
||||
参考最新的[配置文件](/docs/development/configuration/),更新 `config.json` 或 admin 中模型文件配置。给 LLMModel 和 VectorModel 增加 `provider` 字段,以便进行模型分类。例如:
|
||||
参考最新的[配置文件](/docs/introduction/development/configuration/),更新 `config.json` 或 admin 中模型文件配置。给 LLMModel 和 VectorModel 增加 `provider` 字段,以便进行模型分类。例如:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -42,8 +42,6 @@ description: FastGPT V4.8.16 更新说明
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 完整更新内容
|
||||
|
||||
1. 新增 - SearXNG 搜索插件[点击查看教程](/docs/introduction/guide/plugins/searxng_plugin_guide/)
|
||||
|
@@ -31,7 +31,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4820' \
|
||||
|
||||
## 完整更新内容
|
||||
|
||||
1. 新增 - 可视化模型参数配置,取代原配置文件配置模型。预设超过 100 个模型配置。同时支持所有类型模型的一键测试。(预计下个版本会完全支持在页面上配置渠道)。[点击查看模型配置方案](/docs/development/modelconfig/intro/)
|
||||
1. 新增 - 可视化模型参数配置,取代原配置文件配置模型。预设超过 100 个模型配置。同时支持所有类型模型的一键测试。(预计下个版本会完全支持在页面上配置渠道)。[点击查看模型配置方案](/docs/introduction/development/modelconfig/intro/)
|
||||
2. 新增 - DeepSeek resoner 模型支持输出思考过程。
|
||||
3. 新增 - 使用记录导出和仪表盘。
|
||||
4. 新增 - markdown 语法扩展,支持音视频(代码块 audio 和 video)。
|
||||
|
@@ -160,7 +160,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv490' \
|
||||
|
||||
## 兼容 & 弃用
|
||||
|
||||
1. 弃用 - 之前私有化部署的自定义文件解析方案,请同步更新到最新的配置方案。[点击查看 PDF 增强解析配置](/docs/development/configuration/#使用-doc2x-解析-pdf-文件)
|
||||
1. 弃用 - 之前私有化部署的自定义文件解析方案,请同步更新到最新的配置方案。[点击查看 PDF 增强解析配置](/docs/introduction/development/configuration/#使用-doc2x-解析-pdf-文件)
|
||||
2. 弃用 - 弃用旧版本地文件上传 API:/api/core/dataset/collection/create/file(以前仅商业版可用的 API,该接口已放切换成:/api/core/dataset/collection/create/localFile)
|
||||
3. 停止维护,即将弃用 - 外部文件库相关 API,可通过 API 文件库替代。
|
||||
4. API更新 - 上传文件至知识库、创建连接集合、API 文件库、推送分块数据等带有 `trainingType` 字段的接口,`trainingType`字段未来仅支持`chunk`和`QA`两种模式。增强索引模式将设置单独字段:`autoIndexes`,目前仍有适配旧版`trainingType=auto`代码,但请尽快变更成新接口类型。具体可见:[知识库 OpenAPI 文档](/docs/introduction/development/openapi/dataset.md)
|
||||
|
@@ -3,7 +3,6 @@ title: 如何提交应用模板
|
||||
description: 指南:如何向 FastGPT 提交应用模板
|
||||
---
|
||||
|
||||
|
||||
## 什么模板可以合并
|
||||
|
||||
目前合并进仓库的应用模板,会在「模板市场」中全部展示给用户。
|
||||
@@ -18,7 +17,7 @@ description: 指南:如何向 FastGPT 提交应用模板
|
||||
|
||||
需要在 dev 环境下执行下面的操作。
|
||||
|
||||
> 可参照 [FastGPT|快速开始本地开发](https://doc.fastgpt.in/docs/development/intro/)
|
||||
> 可参照 [FastGPT|快速开始本地开发](/docs/introduction/development/intro/)
|
||||
|
||||
1. ### 在 FastGPT 工作台中,创建一个应用
|
||||
|
||||
@@ -47,7 +46,8 @@ description: 指南:如何向 FastGPT 提交应用模板
|
||||
|
||||
"type": "模板类别", // simple(简易应用), advanced(工作流), plugin(插件)
|
||||
|
||||
"workflow": { // 这个对象先不管,待会直接粘贴导出的工作流即可
|
||||
"workflow": {
|
||||
// 这个对象先不管,待会直接粘贴导出的工作流即可
|
||||
"nodes": [],
|
||||
"edges": [],
|
||||
"chatConfig": {}
|
||||
|
@@ -9,7 +9,7 @@ description: FastGPT 接入微信公众号教程
|
||||
|
||||
## 1. 在 FastGPT 新建发布渠道
|
||||
|
||||
在 FastGPT 中选择想要接入的应用,在 *发布渠道* 页面,新建一个接入微信公众号的发布渠道,填写好基础信息。
|
||||
在 FastGPT 中选择想要接入的应用,在 _发布渠道_ 页面,新建一个接入微信公众号的发布渠道,填写好基础信息。
|
||||
|
||||

|
||||
|
||||
@@ -35,7 +35,7 @@ description: FastGPT 接入微信公众号教程
|
||||
|
||||
私有部署的用户可自行查阅自己的 IP 地址。
|
||||
|
||||
海外版用户(cloud.tryfastgpt.ai)可以填写下面的 IP 白名单:
|
||||
海外版用户(cloud.fastgpt.io)可以填写下面的 IP 白名单:
|
||||
|
||||
```
|
||||
35.240.227.100
|
||||
@@ -110,9 +110,11 @@ description: FastGPT 接入微信公众号教程
|
||||

|
||||
|
||||
2. 填入微信公众平台的 URL 处,然后提交保存
|
||||
|
||||

|
||||
|
||||
## 6. 启用服务器配置(如已自动启用,请忽略)
|
||||
|
||||

|
||||
|
||||
## 7. 开始使用
|
||||
|
@@ -111,4 +111,4 @@ services:
|
||||
|
||||
## 接入 FastGPT
|
||||
|
||||
参考 [ReRank模型接入](https://doc.fastgpt.io/docs/development/configuration/#rerank-接入)
|
||||
参考 [ReRank模型接入](https://doc.fastgpt.io/docs/introduction/development/configuration/#rerank-接入)
|
||||
|
@@ -106,7 +106,7 @@ const defaultFeConfigs: FastGPTFeConfigsType = {
|
||||
show_emptyChat: true,
|
||||
show_git: true,
|
||||
docUrl: 'https://doc.fastgpt.io',
|
||||
openAPIDocUrl: 'https://doc.fastgpt.io/docs/development/openapi',
|
||||
openAPIDocUrl: 'https://doc.fastgpt.io/docs/introduction/development/openapi',
|
||||
systemPluginCourseUrl: 'https://fael3z0zfze.feishu.cn/wiki/ERZnw9R26iRRG0kXZRec6WL9nwh',
|
||||
appTemplateCourse:
|
||||
'https://fael3z0zfze.feishu.cn/wiki/CX9wwMGyEi5TL6koiLYcg7U0nWb?fromScene=spaceOverview',
|
||||
|
Reference in New Issue
Block a user