diff --git a/docSite/assets/imgs/aichat.png b/docSite/assets/imgs/aichat.png index 8681697181..74f205fdd0 100644 Binary files a/docSite/assets/imgs/aichat.png and b/docSite/assets/imgs/aichat.png differ diff --git a/docSite/assets/imgs/aichat02.png b/docSite/assets/imgs/aichat02.png index 59debfea80..cac07de2c3 100644 Binary files a/docSite/assets/imgs/aichat02.png and b/docSite/assets/imgs/aichat02.png differ diff --git a/docSite/assets/imgs/aichat2.png b/docSite/assets/imgs/aichat2.png index 0eab07caa7..206a893a34 100644 Binary files a/docSite/assets/imgs/aichat2.png and b/docSite/assets/imgs/aichat2.png differ diff --git a/docSite/assets/imgs/chatinput.png b/docSite/assets/imgs/chatinput.png index 74d5d48e16..06d488a53f 100644 Binary files a/docSite/assets/imgs/chatinput.png and b/docSite/assets/imgs/chatinput.png differ diff --git a/docSite/assets/imgs/coreferenceResolution1.jpg b/docSite/assets/imgs/coreferenceResolution1.jpg index ff6f2fcb2e..00be0a6036 100644 Binary files a/docSite/assets/imgs/coreferenceResolution1.jpg and b/docSite/assets/imgs/coreferenceResolution1.jpg differ diff --git a/docSite/assets/imgs/cq1.png b/docSite/assets/imgs/cq1.png index 4a1c259d66..3a50396b11 100644 Binary files a/docSite/assets/imgs/cq1.png and b/docSite/assets/imgs/cq1.png differ diff --git a/docSite/assets/imgs/customfeedback1.jpg b/docSite/assets/imgs/customfeedback1.jpg index a1295436b8..cad8acfbe3 100644 Binary files a/docSite/assets/imgs/customfeedback1.jpg and b/docSite/assets/imgs/customfeedback1.jpg differ diff --git a/docSite/assets/imgs/customfeedback2.jpg b/docSite/assets/imgs/customfeedback2.jpg index 7ea6abe3a9..f6fd93469d 100644 Binary files a/docSite/assets/imgs/customfeedback2.jpg and b/docSite/assets/imgs/customfeedback2.jpg differ diff --git a/docSite/assets/imgs/customfeedback3.jpg b/docSite/assets/imgs/customfeedback3.jpg index 7c55955d56..3460dff88d 100644 Binary files a/docSite/assets/imgs/customfeedback3.jpg and b/docSite/assets/imgs/customfeedback3.jpg differ diff --git a/docSite/assets/imgs/customfeedback4.jpg b/docSite/assets/imgs/customfeedback4.jpg index 6797cd51c9..108443bbe1 100644 Binary files a/docSite/assets/imgs/customfeedback4.jpg and b/docSite/assets/imgs/customfeedback4.jpg differ diff --git a/docSite/assets/imgs/demo-appointment1.webp b/docSite/assets/imgs/demo-appointment1.webp index 334c528483..7ce35fd70f 100644 Binary files a/docSite/assets/imgs/demo-appointment1.webp and b/docSite/assets/imgs/demo-appointment1.webp differ diff --git a/docSite/assets/imgs/demo-appointment2.webp b/docSite/assets/imgs/demo-appointment2.webp index 7427201558..0cb4ace8b3 100644 Binary files a/docSite/assets/imgs/demo-appointment2.webp and b/docSite/assets/imgs/demo-appointment2.webp differ diff --git a/docSite/assets/imgs/demo-appointment3.webp b/docSite/assets/imgs/demo-appointment3.webp index bd0e10609f..ffde03de4e 100644 Binary files a/docSite/assets/imgs/demo-appointment3.webp and b/docSite/assets/imgs/demo-appointment3.webp differ diff --git a/docSite/assets/imgs/demo-appointment4.webp b/docSite/assets/imgs/demo-appointment4.webp index 3ad33a75e4..472958d3fe 100644 Binary files a/docSite/assets/imgs/demo-appointment4.webp and b/docSite/assets/imgs/demo-appointment4.webp differ diff --git a/docSite/assets/imgs/demo-appointment5.png b/docSite/assets/imgs/demo-appointment5.png index f70df4df50..d343a9eae5 100644 Binary files a/docSite/assets/imgs/demo-appointment5.png and b/docSite/assets/imgs/demo-appointment5.png differ diff --git a/docSite/assets/imgs/demo-appointment6.jpg b/docSite/assets/imgs/demo-appointment6.jpg index e74393cd01..cdbebef395 100644 Binary files a/docSite/assets/imgs/demo-appointment6.jpg and b/docSite/assets/imgs/demo-appointment6.jpg differ diff --git a/docSite/assets/imgs/extract1.png b/docSite/assets/imgs/extract1.png index acb83570f2..5b4d386653 100644 Binary files a/docSite/assets/imgs/extract1.png and b/docSite/assets/imgs/extract1.png differ diff --git a/docSite/assets/imgs/flow-dataset1.png b/docSite/assets/imgs/flow-dataset1.png index 949adc5453..0b12b8d164 100644 Binary files a/docSite/assets/imgs/flow-dataset1.png and b/docSite/assets/imgs/flow-dataset1.png differ diff --git a/docSite/assets/imgs/flow-intro1.png b/docSite/assets/imgs/flow-intro1.png index a39beb5441..161585f284 100644 Binary files a/docSite/assets/imgs/flow-intro1.png and b/docSite/assets/imgs/flow-intro1.png differ diff --git a/docSite/assets/imgs/flow-intro2.png b/docSite/assets/imgs/flow-intro2.png index a4071ac4ed..827fb8cebd 100644 Binary files a/docSite/assets/imgs/flow-intro2.png and b/docSite/assets/imgs/flow-intro2.png differ diff --git a/docSite/assets/imgs/flow-intro3.png b/docSite/assets/imgs/flow-intro3.png index 469c1c432c..65d54426e4 100644 Binary files a/docSite/assets/imgs/flow-intro3.png and b/docSite/assets/imgs/flow-intro3.png differ diff --git a/docSite/assets/imgs/flow-tool1.png b/docSite/assets/imgs/flow-tool1.png index fec4d43282..73685bbab9 100644 Binary files a/docSite/assets/imgs/flow-tool1.png and b/docSite/assets/imgs/flow-tool1.png differ diff --git a/docSite/assets/imgs/flow-tool3.png b/docSite/assets/imgs/flow-tool3.png index 17c410a7b2..dbf8d4bb19 100644 Binary files a/docSite/assets/imgs/flow-tool3.png and b/docSite/assets/imgs/flow-tool3.png differ diff --git a/docSite/assets/imgs/flow-tool4.png b/docSite/assets/imgs/flow-tool4.png index ed52da7dd2..97af3310f5 100644 Binary files a/docSite/assets/imgs/flow-tool4.png and b/docSite/assets/imgs/flow-tool4.png differ diff --git a/docSite/assets/imgs/http1.jpg b/docSite/assets/imgs/http1.jpg index 2832a7299e..4b896a11e5 100644 Binary files a/docSite/assets/imgs/http1.jpg and b/docSite/assets/imgs/http1.jpg differ diff --git a/docSite/assets/imgs/judgement1.png b/docSite/assets/imgs/judgement1.png index cff1d1f381..013940cdbf 100644 Binary files a/docSite/assets/imgs/judgement1.png and b/docSite/assets/imgs/judgement1.png differ diff --git a/docSite/assets/imgs/specialreply.png b/docSite/assets/imgs/specialreply.png index a18443f355..5b7c4a4b30 100644 Binary files a/docSite/assets/imgs/specialreply.png and b/docSite/assets/imgs/specialreply.png differ diff --git a/docSite/assets/imgs/string.png b/docSite/assets/imgs/string.png index f1922a277b..98c1bdc3eb 100644 Binary files a/docSite/assets/imgs/string.png and b/docSite/assets/imgs/string.png differ diff --git a/docSite/content/docs/course/quick-start.md b/docSite/content/docs/course/quick-start.md index 183a17c54c..6f6397b335 100644 --- a/docSite/content/docs/course/quick-start.md +++ b/docSite/content/docs/course/quick-start.md @@ -7,7 +7,7 @@ toc: true weight: 101 --- -更多使用技巧,[查看视屏教程](https://www.bilibili.com/video/BV1n34y1A7Bo/?spm_id_from=333.337.search-card.all.click&vd_source=903c2b09b7412037c2eddc6a8fb9828b) +更多使用技巧,[查看视屏教程](https://www.bilibili.com/video/BV1sH4y1T7s9) ## 知识库 diff --git a/docSite/content/docs/workflow/intro.md b/docSite/content/docs/workflow/intro.md index 349a8bb033..805bda1e89 100644 --- a/docSite/content/docs/workflow/intro.md +++ b/docSite/content/docs/workflow/intro.md @@ -17,16 +17,14 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用 在程序中,节点可以理解为一个个 Function 或者接口。可以理解为它就是一个**步骤**。将多个节点一个个拼接起来,即可一步步的去实现最终的 AI 输出。 -如下图,这是一个最简单的 AI 对话。它由用户输入的问题、聊天记录以及 AI 对话节点组成。 +如下图,这是一个最简单的 AI 对话。它由用流程开始和 AI 对话节点组成。 ![](/imgs/flow-intro2.png) 执行流程如下: - -1. 用户输入问题后,会向服务器发送一个请求,并携带问题。从而得到【用户问题】节点的输出。 -2. 根据设置的【最长记录数】来获取数据库中的记录数,从而得到【聊天记录】节点的输出。 - 经过上面两个流程,就得到了左侧两个蓝色点的结果。结果会被注入到右侧的【AI】对话节点。 -3. 【AI 对话】节点根据传入的聊天记录和用户问题,调用对话接口,从而实现回答。(这里的对话结果输出隐藏了起来,默认只要触发了对话节点,就会往客户端输出内容) +1. 用户输入问题后,【流程开始】节点执行,用户问题被保存。 +2. 【AI 对话】节点执行,此节点有两个必填参数“聊天记录” “用户问题”,聊天记录的值是默认输入的6条,表示此模块上下文长度。用户问题选择的是【流程开始】模块中保存的用户问题。 +3. 【AI 对话】节点根据传入的聊天记录和用户问题,调用对话接口,从而实现回答。 ### 节点分类 @@ -37,52 +35,46 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用 ### 节点的组成 -每个节点会包含 3 个核心部分:固定参数、外部输入(左边有个圆圈)和输出(右边有个圆圈)。 +每个节点会包含 3 个核心部分:输入、输出和触发器。 ![](/imgs/flow-intro3.png) - - 对话模型、温度、回复上限、系统提示词和限定词为固定参数,同时系统提示词和限定词也可以作为外部输入,意味着如果你有输入流向了系统提示词,那么原本填写的内容就会被**覆盖**。 - - 触发器、引用内容、聊天记录和用户问题则为外部输入,需要从其他节点的输出流入。 - - 回复结束则为该节点的输出。 + - AI模型、提示词、聊天记录、用户问题,知识库引用为输入,节点的输入可以是手动输入也可以是变量引用,变量引用的范围包括“全局变量”和之前任意一个节点的输出。 + - 新的上下文和AI回复内容为输出,输出可以被之后任意节点变量引用。 + - 节点的上下左右有四个“触发器”可以被用来连接,被连接的节点按顺序决定是否执行。 ## 重点 - 工作流是如何运行的 -与单出入口的工作流不同,FastGPT的工作流可以指定**不同的入口**,并且没有**固定的出口**,而是以节点运行结束作为出口,如果在一个轮调用中,所有节点都不再允许,则工作流结束。 - -不过为了方便阅读,大部分时候,我们仍是设置一个模块作为入口,在工作流中,它被叫做`对话入口`。下面我们来看下,工作流是如何运行的,以及每个节点何时被触发执行。 +FastGPT的工作流从【流程开始】节点开始执行,可以理解为从用户输入问题开始,没有**固定的出口**,是以节点运行结束作为出口,如果在一个轮调用中,所有节点都不再允许,则工作流结束。 -记住3个**节点可执行**的原则: +下面我们来看下,工作流是如何运行的,以及每个节点何时被触发执行。 -1. 仅关心**已连接的**外部输入,即左边的圆圈被连接了参数。 -2. 当**已连接的**内容都被赋值的时候触发。(这个地方经常会遇到,连接了很多根输入线,但是只要有一个输入没有值,这个节点也不会执行) -3. 可以多个输出连接到一个输入,后续的值会覆盖前面的值。 + ![](/imgs/flow-intro1.png) -![](/imgs/workflow_process.png) +如上图所示节点会“被连接”也会“连接其他节点”,我们称“被连接”的那根线为前置线,“连接其他节点的线”为后置线。上图例子中【知识库搜索】模块左侧有一根前置线,右侧有一根后置线。而【AI对话】节点只有左侧一根前置线。 -### 示例 1: +FastGPT工作流中的线有以下几种状态: +- `waiting`:被连接的节点等待执行。 +- `active`:被连接的节点可以执行。 +- `skip`:被连接的节点不需要执行跳过。 -聊天记录节点会自动执行,因此聊天记录输入会自动赋值。当用户发送问题时,【用户问题】节点会输出值,此时【AI 对话】节点的用户问题输入也会被赋值。两个连接的输入都被赋值后,会执行 【AI 对话】节点。 - -![](/imgs/flow-intro1.png) +节点执行的原则: -### 例子 2: +1. 判断前置线中有没有状态为 `waiting` 的,如果有则等待。 +2. 判断前置线中状态有没有状态为 `active` 如果有则执行。 +3. 如果前置线中状态即没有 `waiting` 也没有 `active` 则认为此节点需要跳过。 +4. 节点执行完毕后,需要根据实际情况更改后置线的状态为`active`或`skip`并且更改前置线状态为`waiting`等待下一轮执行。 -下图是一个知识库搜索例子。 - -1. 历史记录会流入【AI 对话】节点。 -2. 用户的问题会流入【知识库搜索】和【AI 对话】节点,由于【AI 对话】节点的触发器和引用内容还是空,此时不会执行。 -3. 【知识库搜索】节点仅一个外部输入,并且被赋值,开始执行。 -4. 【知识库搜索】结果为空时,“搜索结果不为空”的值为空,不会输出,因此【AI 对话】节点会因为触发器没有赋值而无法执行。而“搜索结果为空”会有输出,流向指定回复的触发器,因此【指定回复】节点进行输出。 -5. 【知识库搜索】结果不为空时,“搜索结果不为空”和“引用内容”都有输出,会流向【AI 对话】,此时【AI 对话】的 4 个外部输入都被赋值,开始执行。 - -![](/imgs/flow-intro4.png) +让我们看一下上面例子的执行过程: +1. 【流程开始】节点执行完毕,更改后置线为`active`。 +2. 【知识库搜索】节点判断前置线状态为`active`开始执行,执行完毕后更改后置线状态为`active` 前置线状态为`waiting`。 +3. 【AI对话】节点判断前置线状态为`active`开始执行,流程执行结束。 ## 如何连接节点 -1. 为了方便识别不同输入输出的类型,FastGPT 给每个节点的输入输出连接点赋予不同的颜色,你可以把相同颜色的连接点连接起来。其中,灰色代表任意类型,可以随意连接。 -2. 位于左侧的连接点为输入,右侧的为输出,连接只能将一个输入和输出连接起来,不能连接“输入和输入”或者“输出和输出”。 -3. 可以点击连接线中间的 x 来删除连接线。 -4. 可以左键点击选中连接线 +1. 为了方便连接,FastGPT 每个节点的上下左右都有连接点,左和上是前置线连接点,右和下是后置线连接点。 +2. 可以点击连接线中间的 x 来删除连接线。 +3. 可以左键点击选中连接线 ## 如何阅读? @@ -98,7 +90,4 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用 2. 知识库搜索合并,可以合并多个知识库搜索结果 3. 其他结果,无法直接合并,可以考虑传入到`HTTP`节点中进行合并,使用`[Laf](https://laf.run/)`可以快速实现一个无服务器HTTP接口。 -### 节点为什么有2个用户问题 - -左侧的`用户问题`是指该节点所需的输入。右侧的`用户问题`是为了方便后续的连线,输出的值和传入的用户问题一样。 diff --git a/docSite/content/docs/workflow/modules/ai_chat.md b/docSite/content/docs/workflow/modules/ai_chat.md index 260c03476f..7f982998f7 100644 --- a/docSite/content/docs/workflow/modules/ai_chat.md +++ b/docSite/content/docs/workflow/modules/ai_chat.md @@ -10,8 +10,6 @@ weight: 351 ## 特点 - 可重复添加 -- 有外部输入 -- 有静态配置 - 触发执行 - 核心模块 diff --git a/docSite/content/docs/workflow/modules/content_extract.md b/docSite/content/docs/workflow/modules/content_extract.md index a95eb504a8..78677a1ded 100644 --- a/docSite/content/docs/workflow/modules/content_extract.md +++ b/docSite/content/docs/workflow/modules/content_extract.md @@ -10,7 +10,6 @@ weight: 352 ## 特点 - 可重复添加 -- 有外部输入 - 需要手动配置 - 触发执行 - function_call 模块 @@ -54,7 +53,5 @@ weight: 352 ## 输出介绍 -- **字段完全提取**:说明用户的问题中包含需要提取的所有内容。 -- **提取字段缺失**:与 “字段完全提取” 对立,有缺失提取的字段时触发。 - **完整提取结果**: 一个 JSON 字符串,包含所有字段的提取结果。 - **目标字段提取结果**:类型均为字符串。 \ No newline at end of file diff --git a/docSite/content/docs/workflow/modules/dataset_search.md b/docSite/content/docs/workflow/modules/dataset_search.md index 2418fb4730..ecdb882001 100644 --- a/docSite/content/docs/workflow/modules/dataset_search.md +++ b/docSite/content/docs/workflow/modules/dataset_search.md @@ -29,16 +29,6 @@ weight: 357 [点击查看参数介绍](/docs/course/data_search/#搜索参数) -### 输出 - 搜索结果 - -输出部分给了两个 boolean 类型的搜索结果,以便根据搜索结果进行不同的处理,通常会有下方两个处理方式: - -| 直接回复特定内容 | 对接普通的 gpt | -| ----------------------------- | ----------------------------- | -| ![](/imgs/flow-kbsearch2.png) | ![](/imgs/flow-kbsearch3.png) | - -当然,你也可以连接到 HTTP 模块,从而实现无法从知识搜索到内容时,去进行联网搜索或者维基百科搜索。 - ### 输出 - 引用内容 以数组格式输出引用,长度可以为 0。意味着,即使没有搜索到内容,这个输出链路也会走通。 diff --git a/docSite/content/docs/workflow/modules/http.md b/docSite/content/docs/workflow/modules/http.md index ec6f30a77d..19a26e52f0 100644 --- a/docSite/content/docs/workflow/modules/http.md +++ b/docSite/content/docs/workflow/modules/http.md @@ -10,7 +10,6 @@ weight: 355 ## 特点 - 可重复添加 -- 有外部输入 - 手动配置 - 触发执行 - 核中核模块 @@ -23,10 +22,11 @@ HTTP 模块会向对应的地址发送一个 `HTTP` 请求,实际操作与 Pos - Params 为路径请求参数,GET请求中用的居多。 - Body 为请求体,POST/PUT请求中用的居多。 -- Headers 为请求头,用于传递一些特殊的信息。 +- Headers 为请求头,用于传递一些特殊的信息。 +- 自定义变量中可以接收前方节点的输出作为变量 - 3 种数据中均可以通过 `{{}}` 来引用变量。 - url 也可以通过 `{{}}` 来引用变量。 -- 变量来自于`全局变量`、`系统变量`、`局部传入` +- 变量来自于`全局变量`、`系统变量`、`前方节点输出` ## 参数结构 diff --git a/docSite/content/docs/workflow/modules/input.md b/docSite/content/docs/workflow/modules/input.md index 1898e21c57..4a439838cb 100644 --- a/docSite/content/docs/workflow/modules/input.md +++ b/docSite/content/docs/workflow/modules/input.md @@ -9,9 +9,8 @@ weight: 356 ## 特点 -- 可重复添加(防止复杂编排时线太乱,重复添加可以更美观) -- 无外部输入 - 流程入口 +- 无输入 - 自动执行 ![](/imgs/chatinput.png) \ No newline at end of file diff --git a/docSite/content/docs/workflow/modules/reply.md b/docSite/content/docs/workflow/modules/reply.md index 378121ebf0..b6d4b70719 100644 --- a/docSite/content/docs/workflow/modules/reply.md +++ b/docSite/content/docs/workflow/modules/reply.md @@ -14,19 +14,13 @@ weight: 359 - 可外部输入 - 会输出结果给客户端 -制定回复模块通常用户特殊状态回复,当然你也可以像图 2 一样,实现一些比较骚的操作~ 触发逻辑非常简单: +指定回复模块通常用户特殊状态回复,回复内容有两种: -1. 一种是写好回复内容,通过触发器触发。 -2. 一种是不写回复内容,直接由外部输入触发,并回复输入的内容。 +1. 一种是手动输入固定内容。 +2. 一种是通过变量引用。 {{< figure src="/imgs/specialreply.png" alt="" caption="图 1" >}} - -{{< figure - src="/imgs/specialreply2.png" - alt="" - caption="图 2" - >}} \ No newline at end of file diff --git a/docSite/content/docs/workflow/modules/text_editor.md b/docSite/content/docs/workflow/modules/text_editor.md index 4a851245b0..c1ca7b7611 100644 --- a/docSite/content/docs/workflow/modules/text_editor.md +++ b/docSite/content/docs/workflow/modules/text_editor.md @@ -20,7 +20,7 @@ weight: 363 ## 功能 对输入文本进行固定加工处理,入参仅支持字符串和数字格式,入参以变量形式使用在文本编辑区域。 -根据上方示例图的处理方式,对任何输入都会在前面拼接“我的问题是:”。 +根据上方示例图的处理方式,对任何输入都会在前面拼接“用户的问题是:”。 ## 作用 diff --git a/docSite/content/docs/workflow/modules/tfswitch.md b/docSite/content/docs/workflow/modules/tfswitch.md index 4b7998eb37..9cb7a39830 100644 --- a/docSite/content/docs/workflow/modules/tfswitch.md +++ b/docSite/content/docs/workflow/modules/tfswitch.md @@ -17,44 +17,13 @@ weight: 362 ## 功能 -对任意输入内容进行 True False 输出,默认情况下,当传入的内容为 false, undefined, null,0,none 时,会输出 false。 - -也可以增加自定义规则来补充输出 false 的内容,每行代表一个匹配规则,支持正则表达式。 - -**例子1** - -不填写任何自定义 False 规则。 - -| 输入 | 输出 | -| --- | --- | -| 123 | true | -| 这是一段文本 | true | -| false | false | -| 0 | false | -| null | false | - -**例子2** - -自定义 False 规则: - -``` -123 -你好 -aa -/dd/ -``` - -| 输入 | 输出 | 说明 | -| --- | --- | --- | -| 123 | false | 命中自定义 false 规则 | -| 这是一段文本 | true | 未命中 | -| false | false | 命中自定义 内置 规则 | -| 0 | false | 命中自定义 内置 规则 | -| null | false | 命中自定义 内置 规则 | -| aa | false | 命中自定义 false 规则 | -| aaa | true | 未命中 | -| bb | false | 命中自定义 false 规则 | -| bbb | false | 命中自定义 false 规则(正则匹配通过) | +对任意变量进行`IF`判断,若满足条件则执行`IF`分支,不满足条件执行`ELSE`分支。 + + +上述例子中若「知识库引用」变量的长度等于0则执行`IF`分支,否则执行`ELSE`分支。 + + +支持增加更多的判断条件和分支,同编程语言中的`IF`语句逻辑相同。 ## 作用 diff --git a/docSite/content/docs/workflow/modules/tool.md b/docSite/content/docs/workflow/modules/tool.md index fb0a771816..715182657b 100644 --- a/docSite/content/docs/workflow/modules/tool.md +++ b/docSite/content/docs/workflow/modules/tool.md @@ -47,7 +47,7 @@ weight: 356 | --- | --- | | ![](/imgs/flow-tool3.png) | ![](/imgs/flow-tool4.png) | -高级编排中,一旦有了工具调用模块,可用的工具头部会出现一个菱形,可以将它与工具调用模块底部的菱形相连接。 +高级编排中,托动工具调用的连接点,可用的工具头部会出现一个菱形,可以将它与工具调用模块底部的菱形相连接。 被连接的工具,会自动分离工具输入与普通的输入,并且可以编辑`介绍`,可以通过调整介绍,使得该工具调用时机更加精确。