Skip to content

Commit

Permalink
4.7-alpha2 (#1027)
Browse files Browse the repository at this point in the history
* feat: stop toolCall and rename some field. (#46)

* perf: node delete tip;pay tip

* fix: toolCall cannot save child answer

* feat: stop tool

* fix: team modal

* fix feckbackMoal  auth bug (#47)

* 简单的支持提示词运行tool。优化workflow模板 (#49)

* remove templates

* fix: request body undefined

* feat: prompt tool run

* feat: workflow tamplates modal

* perf: plugin start

* 4.7 (#50)

* fix docker-compose download url (#994)

original code is a bad url with '404 NOT FOUND' return.
fix docker-compose download url, add 'v' before docker-compose version

* Update ai_settings.md (#1000)

* Update configuration.md

* Update configuration.md

* Fix history in classifyQuestion and extract modules (#1012)

* Fix history in classifyQuestion and extract modules

* Add chatValue2RuntimePrompt import and update text formatting

* flow controller to packages

* fix: rerank select

* modal ui

* perf: modal code path

* point not sufficient

* feat: http url support variable

* fix http key

* perf: prompt

* perf: ai setting modal

* simple edit ui

---------

Co-authored-by: entorick <[email protected]>
Co-authored-by: liujianglc <[email protected]>
Co-authored-by: Fengrui Liu <[email protected]>

* fix team share redirect to login (#51)

* feat: support openapi import plugins (#48)

* feat: support openapi import plugins

* feat: import from url

* fix: add body params parse

* fix build

* fix

* fix

* fix

* tool box ui (#52)

* fix: training queue

* feat: simple edit tool select

* perf: simple edit dataset prompt

* fix: chatbox tool ux

* feat: quote prompt module

* perf: plugin tools sign

* perf: model avatar

* tool selector ui

* feat: max histories

* perf: http plugin import (#53)

* perf: plugin http import

* chatBox ui

* perf: name

* fix: Node template card (#54)

* fix: ts

* setting modal

* package

* package

* feat: add plugins search (#57)

* feat: add plugins search

* perf: change http plugin header input

* Yjl (#56)

* perf: prompt tool call

* perf: chat box ux

* doc

* doc

* price tip

* perf: tool selector

* ui'

* fix: vector queue

* fix: empty tool and empty response

* fix: empty msg

* perf: pg index

* perf: ui tip

* doc

* tool tip

---------

Co-authored-by: yst <[email protected]>
Co-authored-by: entorick <[email protected]>
Co-authored-by: liujianglc <[email protected]>
Co-authored-by: Fengrui Liu <[email protected]>
Co-authored-by: heheer <[email protected]>
  • Loading branch information
6 people authored Mar 21, 2024
1 parent 6d4b331 commit 9d27de1
Show file tree
Hide file tree
Showing 322 changed files with 9,173 additions and 6,389 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fastgpt.run 域名会弃用。
- [x] 源文件引用追踪
- [x] 模块封装,实现多级复用
- [x] 混合检索 & 重排
- [ ] Tool 模块
- [x] Tool 模块
- [ ] 嵌入 [Laf](https://github.com/labring/laf),实现在线编写 HTTP 模块
- [ ] 插件封装功能

Expand Down Expand Up @@ -114,17 +114,17 @@ fastgpt.run 域名会弃用。
* [多模型配置](https://doc.fastgpt.in/docs/development/one-api/)
* [版本更新/升级介绍](https://doc.fastgpt.in/docs/development/upgrading)
* [OpenAPI API 文档](https://doc.fastgpt.in/docs/development/openapi/)
* [知识库结构详解](https://doc.fastgpt.in/docs/use-cases/datasetengine/)
* [知识库结构详解](https://doc.fastgpt.in/docs/course/datasetengine/)

<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
</a>

## 🏘️ 社区交流群

添加 wx 小助手加入
wx 扫一下加入

![](https://otnvvf-imgs.oss.laf.run/wx300.jpg)
![](https://oss.laf.run/htr4n1-images/fastgpt-qr-code.jpg)

<a href="#readme">
<img src="https://img.shields.io/badge/-返回顶部-7d09f1.svg" alt="#" align="right">
Expand Down
10 changes: 4 additions & 6 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,12 @@ Project tech stack: NextJs + TS + ChakraUI + Mongo + Postgres (Vector plugin)
- [Configuring Multiple Models](https://doc.fastgpt.in/docs/installation/reference/models)
- [Version Updates & Upgrades](https://doc.fastgpt.in/docs/installation/upgrading)

<!-- ## :point_right: RoadMap
- [FastGPT RoadMap](https://kjqvjse66l.feishu.cn/docx/RVUxdqE2WolDYyxEKATcM0XXnte) -->

<!-- ## 🏘️ Community
## 🏘️ Community

| Community Group | Assistant |
| ------------------------------------------------- | ---------------------------------------------- |
| ![](https://otnvvf-imgs.oss.laf.run/wxqun300.jpg) | ![](https://otnvvf-imgs.oss.laf.run/wx300.jpg) | -->
| Community Group |
| ------------------------------------------------- |
| ![](https://oss.laf.run/htr4n1-images/fastgpt-qr-code.jpg) |

<a href="#readme">
<img src="https://img.shields.io/badge/-Back_to_Top-7d09f1.svg" alt="#" align="right">
Expand Down
Binary file added docSite/assets/imgs/gapierTool1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierTool9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docSite/assets/imgs/gapierToolResult1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions docSite/content/docs/commercial/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ FastGPT 商业版是基于 FastGPT 开源版的增强版本,增加了一些独
| 应用管理与高级编排 ||||
| 文档知识库 ||||
| 外部使用 ||||
| 自定义版权信息 ||| |
| 自定义版权信息 ||| 设计中 |
| 多租户与支付 ||||
| 团队空间 ||||
| 外部使用限制 ||||
| 应用发布安全配置 ||||
| 内容审核 ||||
| web站点同步 ||||
| 管理后台 ||||
| Saas服务商业授权 ||||
| 完整商业授权 ||||
| 图片知识库 || 设计中 | 设计中 |
| 自动规划召回 || 设计中 | 设计中 |
| 对话日志运营分析 || 设计中 | 设计中 |
{{< /table >}}

## 商业版软件价格
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "FastGPT AI 高级配置说明"
icon: "sign_language"
draft: false
toc: true
weight: 501
weight: 102
---

在 FastGPT 的 AI 对话模块中,有一个 AI 高级配置,里面包含了 AI 模型的参数配置,本文详细介绍这些配置的含义。
Expand Down Expand Up @@ -48,7 +48,7 @@ Tips: 可以通过点击上下文按键查看完整的上下文组成,便于

FastGPT 知识库采用 QA 对(不一定都是问答格式,仅代表两个变量)的格式存储,在转义成字符串时候会根据**引用模板**来进行格式化。知识库包含多个可用变量: q, a, sourceId(数据的ID), index(第n个数据), source(数据的集合名、文件名),score(距离得分,0-1) 可以通过 {{q}} {{a}} {{sourceId}} {{index}} {{source}} {{score}} 按需引入。下面一个模板例子:

可以通过 [知识库结构讲解](/docs/use-cases/datasetEngine/) 了解详细的知识库的结构。
可以通过 [知识库结构讲解](/docs/course/datasetEngine/) 了解详细的知识库的结构。

#### 引用模板

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "本节会详细介绍 FastGPT 知识库结构设计,理解其 QA
icon: "dataset"
draft: false
toc: true
weight: 502
weight: 102
---

## 理解向量
Expand Down Expand Up @@ -90,4 +90,4 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器,

## QA的组合与引用提示词构建

参考[引用模板与引用提示词示例](/docs/use-cases/ai_settings/#示例)
参考[引用模板与引用提示词示例](/docs/course/ai_settings/#示例)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: " 利用 FastGPT 打造高质量 AI 知识库"
icon: "school"
draft: false
toc: true
weight: 699
weight: 106
---

## 前言
Expand Down
44 changes: 20 additions & 24 deletions docSite/content/docs/development/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ weight: 708

**开发环境下**,你需要将示例配置文件 `config.json` 复制成 `config.local.json` 文件才会生效。

这个配置文件中包含了系统参数和各个模型配置,使用时务必去掉注释
这个配置文件中包含了系统参数和各个模型配置,`使用时务必去掉注释!!!!!!!!!!!!!!`

## 4.6.8+ 版本新配置文件

Expand All @@ -28,14 +28,15 @@ llm模型全部合并
{
"model": "gpt-3.5-turbo", // 模型名
"name": "gpt-3.5-turbo", // 别名
"avatar": "/imgs/model/openai.svg", // 模型的logo
"maxContext": 16000, // 最大上下文
"maxResponse": 4000, // 最大回复
"quoteMaxToken": 13000, // 最大引用内容
"maxTemperature": 1.2, // 最大温度
"charsPointsPrice": 0,
"censor": false,
"vision": false, // 是否支持图片输入
"datasetProcess": false, // 是否设置为知识库处理模型(QA),务必保证至少有一个为true,否则知识库会报错
"datasetProcess": true, // 是否设置为知识库处理模型(QA),务必保证至少有一个为true,否则知识库会报错
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true)
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true)
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true)
Expand All @@ -47,31 +48,10 @@ llm模型全部合并
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
"defaultConfig":{} // LLM默认配置,可以针对不同模型设置特殊值(比如 GLM4 的 top_p
},
{
"model": "gpt-3.5-turbo-16k",
"name": "gpt-3.5-turbo-16k",
"maxContext": 16000,
"maxResponse": 16000,
"quoteMaxToken": 13000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"usedInQueryExtension": true,
"toolChoice": true,
"functionCall": false,
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"defaultConfig":{}
},
{
"model": "gpt-4-0125-preview",
"name": "gpt-4-turbo",
"avatar": "/imgs/model/openai.svg",
"maxContext": 125000,
"maxResponse": 4000,
"quoteMaxToken": 100000,
Expand All @@ -94,6 +74,7 @@ llm模型全部合并
{
"model": "gpt-4-vision-preview",
"name": "gpt-4-vision",
"avatar": "/imgs/model/openai.svg",
"maxContext": 128000,
"maxResponse": 4000,
"quoteMaxToken": 100000,
Expand All @@ -118,6 +99,7 @@ llm模型全部合并
{
"model": "text-embedding-ada-002",
"name": "Embedding-2",
"avatar": "/imgs/model/openai.svg",
"charsPointsPrice": 0,
"defaultToken": 700,
"maxToken": 3000,
Expand Down Expand Up @@ -149,6 +131,20 @@ llm模型全部合并
}
```

## 关于模型 logo

统一放置在项目的`public/imgs/model/xxx`目录中,目前内置了以下几种,如果有需要,可以PR增加。

- /imgs/model/baichuan.svg - 百川
- /imgs/model/chatglm.svg - 智谱
- /imgs/model/calude.svg - calude
- /imgs/model/ernie.svg - 文心一言
- /imgs/model/moonshot.svg - 月之暗面
- /imgs/model/openai.svg - OpenAI GPT
- /imgs/model/qwen.svg - 通义千问
- /imgs/model/yi.svg - 零一万物
-

## 特殊模型

### ReRank 接入
Expand Down
34 changes: 13 additions & 21 deletions docSite/content/docs/development/faq.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
weight: 749
title: "常见开发 & 部署问题"
description: "FastGPT 常见开发 & 部署问题"
title: "私有部署常见问题"
description: "FastGPT 私有部署常见问题"
icon: upgrade
draft: false
images: []
---

## 错误排查方式
## 一、错误排查方式

遇到问题先按下面方式排查。

Expand All @@ -17,7 +17,7 @@ images: []
4. 无法解决时,可以找找[Issue](https://github.com/labring/FastGPT/issues),或新提 Issue,私有部署错误,务必提供详细的日志,否则很难排查。


## 通用问题
## 二、通用问题

### 能否纯本地运行

Expand Down Expand Up @@ -46,15 +46,19 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
### 页面崩溃

1. 关闭翻译
2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。(95%情况,可以F12打开控制台,看具体的空指针情况)
2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。(95%情况是配置文件不对,可以F12打开控制台,看具体的空指针情况)
3. 某些api不兼容问题(较少)

### 开启内容补全后,响应速度变慢

1. 问题补全需要经过一轮AI生成。
2. 会进行3~5轮的查询,如果数据库性能不足,会有明显影响。

## 私有部署问题
### 模型响应为空

1. 检查 key 问题。
2. 如果是国内模型,可能是命中风控了。
3. 查看模型请求日志,检查出入参数是否异常。

### 知识库索引没有进度

Expand All @@ -64,11 +68,7 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并
2. 不能对话,也不能索引:API调用失败。可能是没连上OneAPI或OpenAI
3. 有进度,但是非常慢:api key不行,OpenAI的免费号,一分钟只有3次还是60次。一天上限200次。

## Docker 部署常见问题

### 首次部署,root用户提示未注册

没有启动 Mongo 副本集模式。
## 三、Docker 部署常见问题

### 如何更新?

Expand Down Expand Up @@ -133,14 +133,6 @@ mongo连接失败,检查
2. 环境变量(账号密码,注意host和port)
3. 副本集启动失败,一直在重启:没挂载mongo key;key没有权限;

## 本地开发问题

### TypeError: Cannot read properties of null (reading 'useMemo' )

删除所有的`node_modules`,用 Node18 重新 install 试试,可能最新的 Node 有问题。 本地开发流程:
### 首次部署,root用户提示未注册

1. 根目录: `pnpm i`
2. 复制 `config.json` -> `config.local.json`
3. 复制 `.env.template` -> `.env.local`
4. `cd projects/app`
5. `pnpm dev`
没有启动 Mongo 副本集模式。
19 changes: 17 additions & 2 deletions docSite/content/docs/development/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ git clone [email protected]:<github_username>/FastGPT.git

第一次开发,需要先部署数据库,建议本地开发可以随便找一台 2C2G 的轻量小数据库实践。数据库部署教程:[Docker 快速部署](/docs/development/docker/)。部署完了,可以本地访问其数据库。

Mongo 数据库需要修改副本集的`host`,从原来的`mongo:27017`修改为`ip:27017`
Mongo 数据库需要修改副本集的`host`,从原来的`mongo:27017`修改为`ip:27017`(ip为对应的公网IP)

### 4. 初始配置

Expand Down Expand Up @@ -113,7 +113,22 @@ docker build -t dockername/fastgpt:tag --build-arg name=app --build-arg proxy=ta

FastGPT 在`pnpm i`后会执行`postinstall`脚本,用于自动生成`ChakraUI``Type`。如果没有权限,可以先执行`chmod -R +x ./scripts/`,再执行`pnpm i`

### 加入社区
### 长时间运行后崩溃

似乎是由于 tiktoken 库的开发环境问题,生产环境中未遇到,暂时可忽略。

### TypeError: Cannot read properties of null (reading 'useMemo' )

删除所有的`node_modules`,用 Node18 重新 install 试试,可能最新的 Node 有问题。 本地开发流程:

1. 根目录: `pnpm i`
2. 复制 `config.json` -> `config.local.json`
3. 复制 `.env.template` -> `.env.local`
4. `cd projects/app`
5. `pnpm dev`


## 加入社区

遇到困难了吗?有任何问题吗? 加入微信群与开发者和用户保持沟通。

Expand Down
10 changes: 9 additions & 1 deletion docSite/content/docs/development/one-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ CHAT_API_KEY=sk-xxxxxx
{
"model": "ERNIE-Bot", // 这里的模型需要对应 One API 的模型
"name": "文心一言", // 对外展示的名称
"avatar": "/imgs/model/openai.svg", // 模型的logo
"maxContext": 16000, // 最大上下文
"maxResponse": 4000, // 最大回复
"quoteMaxToken": 13000, // 最大引用内容
Expand All @@ -135,4 +136,11 @@ CHAT_API_KEY=sk-xxxxxx
],
```

添加完后,重启 FastGPT 即可在选择文心一言模型进行对话。**添加向量模型也是类似操作,增加到 `vectorModels`里。**
### 3. 重启 FastGPT

```bash
docker-compose down
docker-compose up -d
```

重启 FastGPT 即可在选择文心一言模型进行对话。**添加向量模型也是类似操作,增加到 `vectorModels`里。**
24 changes: 22 additions & 2 deletions docSite/content/docs/development/upgrading/47.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,31 @@ weight: 826

## 修改配置文件

增加一些 Boolean 值,用于决定不同功能块可以使用哪些模型:[点击查看最新的配置文件](/docs/development/configuration/)
增加一些 Boolean 值,用于决定不同功能块可以使用哪些模型,同时增加了模型的 logo[点击查看最新的配置文件](/docs/development/configuration/)

## 初始化脚本

从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成自己域名

```bash
curl --location --request POST 'https://{{host}}/api/admin/initv47' \
--header 'rootkey: {{rootkey}}' \
--header 'Content-Type: application/json'
```

脚本功能:
1. 初始化插件的 parentId

## V4.7 更新说明

1. 新增 - 工具调用模块,可以让LLM模型根据用户意图,动态的选择其他模型或插件执行。
2. 新增 - 分类和内容提取支持 functionCall 模式。部分模型支持 functionCall 不支持 ToolCall,也可以使用了。需要把 LLM 模型配置文件里的 `functionCall` 设置为 `true``toolChoice`设置为 `false`。如果 `toolChoice` 为 true,会走 tool 模式。
3. 优化 - 高级编排性能
3. 新增 - HTTP插件,可实现OpenAPI快速生成插件。
4. 优化 - 高级编排性能。
5. 优化 - 抽离 Flow controller 到 packages。
6. 优化 - AI模型选择。
7. 修复 - 开源版重排选不上。
8. 修复 - http 请求 body,不使用时,传入undefined。(会造成部分GET请求失败)
9. 新增 - 支持 http url 使用变量。
10. 修复 - 469 的提取的提示词容易造成幻觉。
11. 修复 - PG HNSW索引未实际生效问题,本次更新后,搜索速度大幅度提升(但是可能会出现精度损失,如果出现精度损失需要参考PgVector文档,对索引进行调整)。详细见:https://github.com/pgvector/pgvector?tab=readme-ov-file#troubleshooting
4 changes: 2 additions & 2 deletions docSite/content/docs/use-cases/feishu.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: " 接入飞书 "
description: "FastGPT 接入飞书机器人 "
title: " 接入飞书(社区文章)"
description: "FastGPT 接入飞书机器人"
icon: "chat"
draft: false
toc: true
Expand Down
Loading

0 comments on commit 9d27de1

Please sign in to comment.