4.6.8-alpha (#804)

* perf: redirect request and err log replace

perf: dataset openapi

feat: session

fix: retry input error

feat: 468 doc

sub page

feat: standard sub

perf: rerank tip

perf: rerank tip

perf: api sdk

perf: openapi

sub plan

perf: sub ui

fix: ts

* perf: init log

* fix: variable select

* sub page

* icon

* perf: llm model config

* perf: menu ux

* perf: system store

* perf: publish app name

* fix: init data

* perf: flow edit ux

* fix: value type format and ux

* fix prompt editor default value (#13)

* fix prompt editor default value

* fix prompt editor update when not focus

* add key with variable

---------

Co-authored-by: Archer <545436317@qq.com>

* fix: value type

* doc

* i18n

* import path

* home page

* perf: mongo session running

* fix: ts

* perf: use toast

* perf: flow edit

* perf: sse response

* slider ui

* fetch error

* fix prompt editor rerender when not focus by key defaultvalue (#14)

* perf: prompt editor

* feat: dataset search concat

* perf: doc

* fix:ts

* perf: doc

* fix json editor onblur value (#15)

* faq

* vector model default config

* ipv6

---------

Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-02-01 21:57:41 +08:00
committed by GitHub
parent fc19c4cf09
commit 34602b25df
285 changed files with 10345 additions and 11223 deletions

View File

@@ -30,20 +30,15 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用
### 模块分类
从功能上,模块可以分为 3 类:
从功能上,模块可以分为 2 类:
1. **只读模块**全局变量、用户引导。
2. **系统模块**聊天记录(无输入,直接从数据库取)、用户问题(流程入口)。
3. **功能模块**知识库搜索、AI 对话等剩余模块。(这些模块都有输入和输出,可以自由组合)。
1. **系统模块**:用户引导(配置一些对话框信息)、用户问题(流程入口)
2. **功能模块**知识库搜索、AI 对话等剩余模块。(这些模块都有输入和输出,可以自由组合)。
### 模块的组成
每个模块会包含 3 个核心部分:固定参数、外部输入(左边有个圆圈)和输出(右边有个圆圈)。
+ 对于只读模块,只需要根据提示填写即可,不参与流程运行。
+ 对于系统模块,通常只有固定参数和输出,主要需要关注输出到哪个位置。
+ 对于功能模块,通常这 3 部分都是重要的,以下图的 AI 对话为例:
![](/imgs/flow-intro3.png)
- 对话模型、温度、回复上限、系统提示词和限定词为固定参数,同时系统提示词和限定词也可以作为外部输入,意味着如果你有输入流向了系统提示词,那么原本填写的内容就会被**覆盖**。
@@ -56,6 +51,7 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用
1. 仅关心**已连接的**外部输入,即左边的圆圈被连接了。
2. 当连接内容都有值时触发。
3. **可以多个输出连接到一个输入,后续的值会覆盖前面的值。**
#### 示例 1
@@ -86,4 +82,17 @@ FastGPT 从 V4 版本开始采用新的交互方式来构建 AI 应用。使用
1. 建议从左往右阅读。
2.**用户问题** 模块开始。用户问题模块,代表的是用户发送了一段文本,触发任务开始。
3. 关注【AI 对话】和【指定回复】模块,这两个模块是输出答案的地方。
3. 关注【AI 对话】和【指定回复】模块,这两个模块是输出答案的地方。
## FAQ
### 想合并多个输出结果怎么实现?
1. 文本加工,可以对字符串进行合并。
2. 知识库搜索合并,可以合并多个知识库搜索结果
3. 其他结果,无法直接合并,可以考虑传入到`HTTP`模块中进行合并,使用`[Laf](https://laf.run/)`可以快速实现一个无服务器HTTP接口。
### 模块为什么有2个用户问题
左侧的`用户问题`是指该模块所需的输入。右侧的`用户问题`是为了方便后续的连线,输出的值和传入的用户问题一样。

View File

@@ -38,7 +38,7 @@ HTTP 模块会向对应的地址发送一个 `POST/GET` 请求,携带部分`
### 嵌套对象使用
**入参**
#### 入参
假设我们设计了`3个`输入。
@@ -58,7 +58,7 @@ HTTP 模块会向对应的地址发送一个 `POST/GET` 请求,携带部分`
}
```
**出参**
#### 出参
假设接口的输出结构为:
@@ -66,18 +66,46 @@ HTTP 模块会向对应的地址发送一个 `POST/GET` 请求,携带部分`
{
"message": "测试",
"data":{
"name": "name",
"age": 10
"user": {
"name": "xxx",
"age": 12
},
"list": [
{
"name": "xxx",
"age": 50
},
[{ "test": 22 }]
],
"psw": "xxx"
}
}
```
那么,自定出参的`key`可以设置为:
最终得到的解析为:
- message (string)
- data.name (string)
- data.age (number)
```json
{
"user": { "name": "xxx", "age": 12 },
"user.name": "xxx",
"user.age": 12,
"list": [ { "name": "xxx", "age": 50 }, [{ "test": 22 }] ],
"list[0]": { "name": "xxx", "age": 50 },
"list[0].name": "xxx",
"list[0].age": 50,
"list[1]": [ { "test": 22 } ],
"list[1][0]": { "test": 22 },
"list[1][0].test": 22,
"psw": "xxx"
}
```
你可以使用`json`里对应的`key`来获取值。
### 格式化输出
FastGPT v4.6.8 后,加入了出参格式化功能,主要以`json`格式化成`字符串`为主。如果你的输出类型选择了`字符串`,则会将`HTTP`对应`key`的值,转成`json`字符串进行输出。因此,未来你可以直接从`HTTP`接口输出内容至`文本加工`中,然后拼接适当的提示词,最终输入给`AI对话`
## POST 示例