mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
Global variables support external variable; Extract module support default value (#921)
This commit is contained in:
@@ -116,17 +116,29 @@ export enum ModuleOutputKeyEnum {
|
||||
export enum VariableInputEnum {
|
||||
input = 'input',
|
||||
textarea = 'textarea',
|
||||
select = 'select'
|
||||
select = 'select',
|
||||
external = 'external'
|
||||
}
|
||||
export const variableMap = {
|
||||
[VariableInputEnum.input]: {
|
||||
icon: 'core/app/variable/input'
|
||||
icon: 'core/app/variable/input',
|
||||
title: 'core.module.variable.input type',
|
||||
desc: ''
|
||||
},
|
||||
[VariableInputEnum.textarea]: {
|
||||
icon: 'core/app/variable/textarea'
|
||||
icon: 'core/app/variable/textarea',
|
||||
title: 'core.module.variable.textarea type',
|
||||
desc: '允许用户最多输入4000字的对话框。'
|
||||
},
|
||||
[VariableInputEnum.select]: {
|
||||
icon: 'core/app/variable/select'
|
||||
icon: 'core/app/variable/select',
|
||||
title: 'core.module.variable.select type',
|
||||
desc: ''
|
||||
},
|
||||
[VariableInputEnum.external]: {
|
||||
icon: 'core/app/variable/external',
|
||||
title: 'core.module.variable.External type',
|
||||
desc: '可以通过API接口或分享链接的Query传递变量。增加该类型变量的主要目的是用于变量提示。使用例子: 你可以通过分享链接Query中拼接Token,来实现内部系统身份鉴权。'
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -57,7 +57,7 @@ export const ContextExtractModule: FlowModuleTemplateType = {
|
||||
{
|
||||
key: ModuleInputKeyEnum.extractKeys,
|
||||
type: FlowNodeInputTypeEnum.custom,
|
||||
label: '目标字段',
|
||||
label: '',
|
||||
valueType: ModuleIOValueTypeEnum.any,
|
||||
description: "由 '描述' 和 'key' 组成一个目标字段,可提取多个目标字段",
|
||||
value: [], // {desc: string; key: string; required: boolean; enum: string[]}[]
|
||||
@@ -76,6 +76,7 @@ export const ContextExtractModule: FlowModuleTemplateType = {
|
||||
{
|
||||
key: ModuleOutputKeyEnum.failed,
|
||||
label: '提取字段缺失',
|
||||
description: '存在一个或多个字段未提取成功。尽管使用了默认值也算缺失。',
|
||||
valueType: ModuleIOValueTypeEnum.boolean,
|
||||
type: FlowNodeOutputTypeEnum.source,
|
||||
targets: []
|
||||
|
1
packages/global/core/module/type.d.ts
vendored
1
packages/global/core/module/type.d.ts
vendored
@@ -80,6 +80,7 @@ export type ContextExtractAgentItemType = {
|
||||
desc: string;
|
||||
key: string;
|
||||
required: boolean;
|
||||
defaultValue?: string;
|
||||
enum?: string;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user