Files
FastGPT/docSite/content/docs/workflow/modules/variable.md
Archer 62e87551ac New dpcs structure and dataset i18n (#551)
* perf: check balance

* md

* lock way

* i18n

* docs

* doc

* i18n

* update doc

* feat: one link sync

* feat: one link sync

* feat: one link sync

* feat: one link sync

* feat: one link sync

* feat: one link sync

* feat: one link sync
2023-12-04 21:37:07 +08:00

35 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "全局变量"
description: "FastGPT 全局变量模块介绍"
icon: "variables"
draft: false
toc: true
weight: 361
---
## 特点
- 仅可添加 1 个
- 需要手动配置
- 对其他模块有影响
- 可作为用户引导
## 说明
可以在对话前设置一些问题,让用户输入或选择,并将用户输入/选择的结果注入到其他模块中。目前仅会注入到 string 类型的数据里(对应蓝色圆圈的输入)。
如下图,定义了两个变量:目标语言和下拉框测试(忽略)
用户在对话前会被要求先填写目标语言,配合用户引导,我们就构建了一个简单的翻译机器人。**目标语言**的 `keylanguage` 被写入到【AI 对话】模块的限定词里。
![](/imgs/variable.png)
通过完整对话记录我们可以看到,实际的限定词从:“将我的问题直接翻译成{{language}}” 变成了 “将我的问题直接翻译成英语”,因为 {{language}} 被变量替换了。
![](/imgs/variable2.png)
## 系统级变量
除了用户自定义设置的变量外,还会有一些系统变量:
+ **cTime**: 当前时间。例如2023/3/3 20:22