mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 01:40:51 +00:00
4.7-production (#1053)
* 4.7-alpha3 (#62) * doc * Optimize possible null Pointers and parts of Ux * fix: mulity index training error * feat: doc and rename question guide * fix ios speech input (#59) * fix: prompt editor variables nowrap (#61) * change openapi import in http module with curl import (#60) * chore(ui): dataset import modal ui (#58) * chore(ui): dataset import modal ui * use component * fix height * 4.7 (#63) * fix: claude3 image type verification failed (#1038) (#1040) * perf: curl import modal * doc img * perf: adapt cohere rerank * perf: code * perf: input style * doc --------- Co-authored-by: xiaotian <dimsky@163.com> * fix: ts * docker deploy * perf: prompt call * doc * ts * finish ui * perf: outlink detail ux * perf: user schema * fix: plugin update * feat: get current time plugin * fix: ts * perf: fetch anamation * perf: mark ux * doc * perf: select app ux * fix: split text custom string conflict * peref: inform readed * doc * memo flow component * perf: version * faq * feat: flow max runtimes * feat: similarity tip * feat: auto detect file encoding * Supports asymmetric vector model * fix: ts * perf: max w * move code * perf: hide whisper * fix: ts * feat: system msg modal * perf: catch error * perf: inform tip * fix: inform --------- Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com> Co-authored-by: xiaotian <dimsky@163.com>
This commit is contained in:
@@ -13,6 +13,59 @@ weight: 353
|
||||
- 无外部输入
|
||||
- 不参与实际调度
|
||||
|
||||
如图,可以在用户提问前给予一定引导。并可以设置引导问题。
|
||||
## 作用
|
||||
|
||||
可以配置欢迎语、全局变量、语言播报等,类似于系统设置,不参与工作流的运行。
|
||||
|
||||

|
||||
|
||||
### 欢迎语
|
||||
|
||||
会在对话开始前发送一个欢迎语。该功能只在网页生效,API是无效的,并且该欢迎语不会被加入 AI 的对话记录中。
|
||||
|
||||
可以通过特殊的 Markdown 语法,来实现快速提问。 如图中的:
|
||||
|
||||
```
|
||||
[剧情介绍]
|
||||
[导演是谁]
|
||||
```
|
||||
|
||||
### 全局变量
|
||||
|
||||
| | |
|
||||
| ----- | ----- |
|
||||
|  |  |
|
||||
|
||||
如上图中,我们配置了一个名为`测试`, key为`test`的变量,类型为`文本`的全局变量。并在对话中,通过`{{test}}`来引用该变量。
|
||||
|
||||
|
||||
| | |
|
||||
| ----- | ----- |
|
||||
|  |  |
|
||||
|
||||
从上图中,可以看出,实际的提示词从:`这是一个变量测试: {{test}}` 变成了: `这是一个变量测试: 变量测试`,因为`{{test}}` 被变量替换了。
|
||||
|
||||
变量在工作流中大部分的`文本输入框`都生效,例如:HTTP模块的URL和参数、各种功能块的提示词。
|
||||
|
||||
有一个特殊类型的变量,交`外部传入`。这种变量不需要用户填写,而是直接在调用时实时传入。目前支持从分享链接的Query和API调用的`variables`对象中获取。
|
||||
|
||||

|
||||
|
||||
|
||||
------
|
||||
|
||||
除了自定义的全局变量外,还有一些系统参数可以选择:
|
||||
|
||||
+ **cTime**: 当前时间,字符串格式,例如:2023/3/3 20:22
|
||||
|
||||
### 语音播报
|
||||
|
||||
| | |
|
||||
| ----- | ----- |
|
||||
|  |  |
|
||||
|
||||
### 猜你想问
|
||||
|
||||
开启后,每次对话结束,会发送最近的6条对话记录给AI,AI会根据这些对话记录,给出 3 个可能的问题。
|
||||
|
||||

|
||||
|
@@ -21,7 +21,40 @@ weight: 362
|
||||
|
||||
也可以增加自定义规则来补充输出 false 的内容,每行代表一个匹配规则,支持正则表达式。
|
||||
|
||||
根据上方示例图的匹配规则,当我们输入`123` `hi` `你好` 和任意手机号码时(正则匹配)同样也会输出 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 规则(正则匹配通过) |
|
||||
|
||||
## 作用
|
||||
|
||||
|
@@ -1,35 +0,0 @@
|
||||
---
|
||||
title: "全局变量"
|
||||
description: "FastGPT 全局变量模块介绍"
|
||||
icon: "variables"
|
||||
draft: false
|
||||
toc: true
|
||||
weight: 361
|
||||
---
|
||||
|
||||
## 特点
|
||||
|
||||
- 仅可添加 1 个
|
||||
- 需要手动配置
|
||||
- 对其他模块有影响
|
||||
- 可作为用户引导
|
||||
|
||||
## 说明
|
||||
|
||||
可以在对话前设置一些问题,让用户输入或选择,并将用户输入/选择的结果注入到其他模块中。目前仅会注入到 string 类型的数据里(对应蓝色圆圈的输入)。
|
||||
|
||||
如下图,定义了两个变量:目标语言和下拉框测试(忽略)
|
||||
|
||||
用户在对话前会被要求先填写目标语言,配合用户引导,我们就构建了一个简单的翻译机器人。**目标语言**的 `key:language` 被写入到【AI 对话】模块的限定词里。
|
||||
|
||||

|
||||
|
||||
通过完整对话记录我们可以看到,实际的限定词从:“将我的问题直接翻译成{{language}}” 变成了 “将我的问题直接翻译成英语”,因为 {{language}} 被变量替换了。
|
||||
|
||||

|
||||
|
||||
## 系统级变量
|
||||
|
||||
除了用户自定义设置的变量外,还会有一些系统变量:
|
||||
|
||||
+ **cTime**: 当前时间。例如:2023/3/3 20:22
|
Reference in New Issue
Block a user