Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
bebbba39
authored
Aug 16, 2024
by
heheer
Committed by
GitHub
Aug 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: change value desc position & fix templates (#2413)
parent
14e22687
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
94 additions
and
82 deletions
+94
-82
packages/global/core/workflow/node/constant.ts
+28
-41
packages/global/core/workflow/template/system/aiChat.ts
+2
-0
packages/global/core/workflow/template/system/datasetConcat.ts
+3
-3
packages/global/core/workflow/template/system/datasetSearch.ts
+3
-1
packages/global/core/workflow/template/system/runApp/index.ts
+2
-0
packages/global/core/workflow/type/io.d.ts
+2
-0
projects/app/public/appMarketTemplates/CQ/template.json
+6
-6
projects/app/public/appMarketTemplates/simpleDatasetChat/template.json
+4
-4
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/NodeDatasetConcat.tsx
+2
-6
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/NodePluginIO/PluginOutput.tsx
+1
-1
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/NodeWorkflowStart.tsx
+19
-3
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/FieldEditModal.tsx
+0
-2
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/Label.tsx
+6
-6
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/DynamicInputs/index.tsx
+1
-1
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/SettingQuotePrompt.tsx
+5
-1
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderOutput/FieldEditModal.tsx
+0
-2
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderOutput/Label.tsx
+2
-2
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/ValueTypeLabel.tsx
+8
-3
No files found.
packages/global/core/workflow/node/constant.ts
View file @
bebbba39
...
@@ -126,88 +126,75 @@ export enum FlowNodeTypeEnum {
...
@@ -126,88 +126,75 @@ export enum FlowNodeTypeEnum {
export
const
FlowValueTypeMap
=
{
export
const
FlowValueTypeMap
=
{
[
WorkflowIOValueTypeEnum
.
string
]:
{
[
WorkflowIOValueTypeEnum
.
string
]:
{
label
:
'string'
,
label
:
'string'
,
value
:
WorkflowIOValueTypeEnum
.
string
,
value
:
WorkflowIOValueTypeEnum
.
string
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
number
]:
{
[
WorkflowIOValueTypeEnum
.
number
]:
{
label
:
'number'
,
label
:
'number'
,
value
:
WorkflowIOValueTypeEnum
.
number
,
value
:
WorkflowIOValueTypeEnum
.
number
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
boolean
]:
{
[
WorkflowIOValueTypeEnum
.
boolean
]:
{
label
:
'boolean'
,
label
:
'boolean'
,
value
:
WorkflowIOValueTypeEnum
.
boolean
,
value
:
WorkflowIOValueTypeEnum
.
boolean
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
object
]:
{
[
WorkflowIOValueTypeEnum
.
object
]:
{
label
:
'object'
,
label
:
'object'
,
value
:
WorkflowIOValueTypeEnum
.
object
,
value
:
WorkflowIOValueTypeEnum
.
object
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
arrayString
]:
{
[
WorkflowIOValueTypeEnum
.
arrayString
]:
{
label
:
'array<string>'
,
label
:
'array<string>'
,
value
:
WorkflowIOValueTypeEnum
.
arrayString
,
value
:
WorkflowIOValueTypeEnum
.
arrayString
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
arrayNumber
]:
{
[
WorkflowIOValueTypeEnum
.
arrayNumber
]:
{
label
:
'array<number>'
,
label
:
'array<number>'
,
value
:
WorkflowIOValueTypeEnum
.
arrayNumber
,
value
:
WorkflowIOValueTypeEnum
.
arrayNumber
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
arrayBoolean
]:
{
[
WorkflowIOValueTypeEnum
.
arrayBoolean
]:
{
label
:
'array<boolean>'
,
label
:
'array<boolean>'
,
value
:
WorkflowIOValueTypeEnum
.
arrayBoolean
,
value
:
WorkflowIOValueTypeEnum
.
arrayBoolean
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
arrayObject
]:
{
[
WorkflowIOValueTypeEnum
.
arrayObject
]:
{
label
:
'array<object>'
,
label
:
'array<object>'
,
value
:
WorkflowIOValueTypeEnum
.
arrayObject
,
value
:
WorkflowIOValueTypeEnum
.
arrayObject
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
any
]:
{
[
WorkflowIOValueTypeEnum
.
any
]:
{
label
:
'any'
,
label
:
'any'
,
value
:
WorkflowIOValueTypeEnum
.
any
,
value
:
WorkflowIOValueTypeEnum
.
any
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
chatHistory
]:
{
[
WorkflowIOValueTypeEnum
.
chatHistory
]:
{
label
:
'历史记录'
,
label
:
'历史记录'
,
value
:
WorkflowIOValueTypeEnum
.
chatHistory
,
value
:
WorkflowIOValueTypeEnum
.
chatHistory
description
:
`{
obj: System | Human | AI;
value: string;
}[]`
},
},
[
WorkflowIOValueTypeEnum
.
datasetQuote
]:
{
[
WorkflowIOValueTypeEnum
.
datasetQuote
]:
{
label
:
'知识库引用'
,
label
:
'知识库引用'
,
value
:
WorkflowIOValueTypeEnum
.
datasetQuote
,
value
:
WorkflowIOValueTypeEnum
.
datasetQuote
description
:
`{
id: string;
datasetId: string;
collectionId: string;
sourceName: string;
sourceId?: string;
q: string;
a: string
}[]`
},
},
[
WorkflowIOValueTypeEnum
.
selectApp
]:
{
[
WorkflowIOValueTypeEnum
.
selectApp
]:
{
label
:
'选择应用'
,
label
:
'选择应用'
,
value
:
WorkflowIOValueTypeEnum
.
selectApp
,
value
:
WorkflowIOValueTypeEnum
.
selectApp
description
:
''
},
},
[
WorkflowIOValueTypeEnum
.
selectDataset
]:
{
[
WorkflowIOValueTypeEnum
.
selectDataset
]:
{
label
:
'选择知识库'
,
label
:
'选择知识库'
,
value
:
WorkflowIOValueTypeEnum
.
selectDataset
,
value
:
WorkflowIOValueTypeEnum
.
selectDataset
description
:
`{
datasetId: string;
}`
},
},
[
WorkflowIOValueTypeEnum
.
dynamic
]:
{
[
WorkflowIOValueTypeEnum
.
dynamic
]:
{
label
:
'动态输入'
,
label
:
'动态输入'
,
value
:
WorkflowIOValueTypeEnum
.
dynamic
,
value
:
WorkflowIOValueTypeEnum
.
dynamic
description
:
''
}
}
};
};
export
const
EDGE_TYPE
=
'default'
;
export
const
EDGE_TYPE
=
'default'
;
export
const
defaultNodeVersion
=
'481'
;
export
const
defaultNodeVersion
=
'481'
;
export
const
chatHistoryValueDesc
=
`{
obj: System | Human | AI;
value: string;
}[]`
;
export
const
datasetQuoteValueDesc
=
`{
id: string;
datasetId: string;
collectionId: string;
sourceName: string;
sourceId?: string;
q: string;
a: string
}[]`
;
packages/global/core/workflow/template/system/aiChat.ts
View file @
bebbba39
import
{
import
{
chatHistoryValueDesc
,
FlowNodeInputTypeEnum
,
FlowNodeInputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeTypeEnum
FlowNodeTypeEnum
...
@@ -97,6 +98,7 @@ export const AiChatModule: FlowNodeTemplateType = {
...
@@ -97,6 +98,7 @@ export const AiChatModule: FlowNodeTemplateType = {
label
:
'core.module.output.label.New context'
,
label
:
'core.module.output.label.New context'
,
description
:
'core.module.output.description.New context'
,
description
:
'core.module.output.description.New context'
,
valueType
:
WorkflowIOValueTypeEnum
.
chatHistory
,
valueType
:
WorkflowIOValueTypeEnum
.
chatHistory
,
valueDesc
:
chatHistoryValueDesc
,
type
:
FlowNodeOutputTypeEnum
.
static
type
:
FlowNodeOutputTypeEnum
.
static
},
},
{
{
...
...
packages/global/core/workflow/template/system/datasetConcat.ts
View file @
bebbba39
import
{
import
{
datasetQuoteValueDesc
,
FlowNodeInputTypeEnum
,
FlowNodeInputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeTypeEnum
FlowNodeTypeEnum
...
@@ -14,8 +15,6 @@ import { getNanoid } from '../../../../common/string/tools';
...
@@ -14,8 +15,6 @@ import { getNanoid } from '../../../../common/string/tools';
import
{
getHandleConfig
}
from
'../utils'
;
import
{
getHandleConfig
}
from
'../utils'
;
import
{
FlowNodeInputItemType
}
from
'../../type/io.d'
;
import
{
FlowNodeInputItemType
}
from
'../../type/io.d'
;
const
defaultQuoteKey
=
'defaultQuoteKey'
;
export
const
getOneQuoteInputTemplate
=
({
export
const
getOneQuoteInputTemplate
=
({
key
=
getNanoid
(),
key
=
getNanoid
(),
index
index
...
@@ -63,7 +62,8 @@ export const DatasetConcatModule: FlowNodeTemplateType = {
...
@@ -63,7 +62,8 @@ export const DatasetConcatModule: FlowNodeTemplateType = {
key
:
NodeOutputKeyEnum
.
datasetQuoteQA
,
key
:
NodeOutputKeyEnum
.
datasetQuoteQA
,
label
:
'core.module.Dataset quote.label'
,
label
:
'core.module.Dataset quote.label'
,
type
:
FlowNodeOutputTypeEnum
.
static
,
type
:
FlowNodeOutputTypeEnum
.
static
,
valueType
:
WorkflowIOValueTypeEnum
.
datasetQuote
valueType
:
WorkflowIOValueTypeEnum
.
datasetQuote
,
valueDesc
:
datasetQuoteValueDesc
}
}
]
]
};
};
packages/global/core/workflow/template/system/datasetSearch.ts
View file @
bebbba39
import
{
import
{
datasetQuoteValueDesc
,
FlowNodeInputTypeEnum
,
FlowNodeInputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeTypeEnum
FlowNodeTypeEnum
...
@@ -118,7 +119,8 @@ export const DatasetSearchModule: FlowNodeTemplateType = {
...
@@ -118,7 +119,8 @@ export const DatasetSearchModule: FlowNodeTemplateType = {
label
:
'core.module.Dataset quote.label'
,
label
:
'core.module.Dataset quote.label'
,
description
:
'特殊数组格式,搜索结果为空时,返回空数组。'
,
description
:
'特殊数组格式,搜索结果为空时,返回空数组。'
,
type
:
FlowNodeOutputTypeEnum
.
static
,
type
:
FlowNodeOutputTypeEnum
.
static
,
valueType
:
WorkflowIOValueTypeEnum
.
datasetQuote
valueType
:
WorkflowIOValueTypeEnum
.
datasetQuote
,
valueDesc
:
datasetQuoteValueDesc
}
}
]
]
};
};
packages/global/core/workflow/template/system/runApp/index.ts
View file @
bebbba39
import
{
import
{
chatHistoryValueDesc
,
FlowNodeInputTypeEnum
,
FlowNodeInputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeTypeEnum
FlowNodeTypeEnum
...
@@ -47,6 +48,7 @@ export const RunAppModule: FlowNodeTemplateType = {
...
@@ -47,6 +48,7 @@ export const RunAppModule: FlowNodeTemplateType = {
label
:
'新的上下文'
,
label
:
'新的上下文'
,
description
:
'将该应用回复内容拼接到历史记录中,作为新的上下文返回'
,
description
:
'将该应用回复内容拼接到历史记录中,作为新的上下文返回'
,
valueType
:
WorkflowIOValueTypeEnum
.
chatHistory
,
valueType
:
WorkflowIOValueTypeEnum
.
chatHistory
,
valueDesc
:
chatHistoryValueDesc
,
required
:
true
,
required
:
true
,
type
:
FlowNodeOutputTypeEnum
.
static
type
:
FlowNodeOutputTypeEnum
.
static
},
},
...
...
packages/global/core/workflow/type/io.d.ts
View file @
bebbba39
...
@@ -43,6 +43,7 @@ export type FlowNodeInputItemType = InputComponentPropsType & {
...
@@ -43,6 +43,7 @@ export type FlowNodeInputItemType = InputComponentPropsType & {
key
:
`
${
NodeInputKeyEnum
}
`
|
string
;
key
:
`
${
NodeInputKeyEnum
}
`
|
string
;
valueType
?:
WorkflowIOValueTypeEnum
;
// data type
valueType
?:
WorkflowIOValueTypeEnum
;
// data type
valueDesc
?:
string
;
// data desc
value
?:
any
;
value
?:
any
;
label
:
string
;
label
:
string
;
debugLabel
?:
string
;
debugLabel
?:
string
;
...
@@ -60,6 +61,7 @@ export type FlowNodeOutputItemType = {
...
@@ -60,6 +61,7 @@ export type FlowNodeOutputItemType = {
type
:
FlowNodeOutputTypeEnum
;
type
:
FlowNodeOutputTypeEnum
;
key
:
`
${
NodeOutputKeyEnum
}
`
|
string
;
key
:
`
${
NodeOutputKeyEnum
}
`
|
string
;
valueType
?:
WorkflowIOValueTypeEnum
;
valueType
?:
WorkflowIOValueTypeEnum
;
valueDesc
?:
string
;
value
?:
any
;
value
?:
any
;
label
?:
string
;
label
?:
string
;
...
...
projects/app/public/appMarketTemplates/CQ/template.json
View file @
bebbba39
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
"name"
:
"系统配置"
,
"name"
:
"系统配置"
,
"intro"
:
"可以配置应用的系统参数"
,
"intro"
:
"可以配置应用的系统参数"
,
"avatar"
:
"core/workflow/template/systemConfig"
,
"avatar"
:
"core/workflow/template/systemConfig"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.systemConfig
"
,
"flowNodeType"
:
"
userGuide
"
,
"position"
:
{
"position"
:
{
"x"
:
531.2422736065552
,
"x"
:
531.2422736065552
,
"y"
:
-486.7611729549753
"y"
:
-486.7611729549753
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
"name"
:
"流程开始"
,
"name"
:
"流程开始"
,
"intro"
:
""
,
"intro"
:
""
,
"avatar"
:
"core/workflow/template/workflowStart"
,
"avatar"
:
"core/workflow/template/workflowStart"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.
workflowStart"
,
"flowNodeType"
:
"workflowStart"
,
"position"
:
{
"position"
:
{
"x"
:
558.4082376415505
,
"x"
:
558.4082376415505
,
"y"
:
123.72387429194112
"y"
:
123.72387429194112
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
"name"
:
"AI 对话"
,
"name"
:
"AI 对话"
,
"intro"
:
"AI 大模型对话"
,
"intro"
:
"AI 大模型对话"
,
"avatar"
:
"core/workflow/template/aiChat"
,
"avatar"
:
"core/workflow/template/aiChat"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.
chatNode"
,
"flowNodeType"
:
"chatNode"
,
"showStatus"
:
true
,
"showStatus"
:
true
,
"position"
:
{
"position"
:
{
"x"
:
2701.1267277679685
,
"x"
:
2701.1267277679685
,
...
@@ -229,7 +229,7 @@
...
@@ -229,7 +229,7 @@
"name"
:
"问题分类"
,
"name"
:
"问题分类"
,
"intro"
:
"根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:
\n
类型1: 打招呼
\n
类型2: 关于商品
\"
使用
\"
问题
\n
类型3: 关于商品
\"
购买
\"
问题
\n
类型4: 其他问题"
,
"intro"
:
"根据用户的历史记录和当前问题判断该次提问的类型。可以添加多组问题类型,下面是一个模板例子:
\n
类型1: 打招呼
\n
类型2: 关于商品
\"
使用
\"
问题
\n
类型3: 关于商品
\"
购买
\"
问题
\n
类型4: 其他问题"
,
"avatar"
:
"core/workflow/template/questionClassify"
,
"avatar"
:
"core/workflow/template/questionClassify"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.
classifyQuestion"
,
"flowNodeType"
:
"classifyQuestion"
,
"showStatus"
:
true
,
"showStatus"
:
true
,
"position"
:
{
"position"
:
{
"x"
:
1020.9667229609946
,
"x"
:
1020.9667229609946
,
...
@@ -316,7 +316,7 @@
...
@@ -316,7 +316,7 @@
"name"
:
"指定回复"
,
"name"
:
"指定回复"
,
"intro"
:
"该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。"
,
"intro"
:
"该模块可以直接回复一段指定的内容。常用于引导、提示。非字符串内容传入时,会转成字符串进行输出。"
,
"avatar"
:
"core/workflow/template/reply"
,
"avatar"
:
"core/workflow/template/reply"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.
answerNode"
,
"flowNodeType"
:
"answerNode"
,
"position"
:
{
"position"
:
{
"x"
:
1874.9167551056487
,
"x"
:
1874.9167551056487
,
"y"
:
434.98431875888207
"y"
:
434.98431875888207
...
@@ -341,7 +341,7 @@
...
@@ -341,7 +341,7 @@
"name"
:
"知识库搜索"
,
"name"
:
"知识库搜索"
,
"intro"
:
"调用
\"
语义检索
\"
和
\"
全文检索
\"
能力,从
\"
知识库
\"
中查找可能与问题相关的参考内容"
,
"intro"
:
"调用
\"
语义检索
\"
和
\"
全文检索
\"
能力,从
\"
知识库
\"
中查找可能与问题相关的参考内容"
,
"avatar"
:
"core/workflow/template/datasetSearch"
,
"avatar"
:
"core/workflow/template/datasetSearch"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.
datasetSearchNode"
,
"flowNodeType"
:
"datasetSearchNode"
,
"showStatus"
:
true
,
"showStatus"
:
true
,
"position"
:
{
"position"
:
{
"x"
:
1851.010152279949
,
"x"
:
1851.010152279949
,
...
...
projects/app/public/appMarketTemplates/simpleDatasetChat/template.json
View file @
bebbba39
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
"name"
:
"系统配置"
,
"name"
:
"系统配置"
,
"intro"
:
"可以配置应用的系统参数"
,
"intro"
:
"可以配置应用的系统参数"
,
"avatar"
:
"core/workflow/template/systemConfig"
,
"avatar"
:
"core/workflow/template/systemConfig"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.systemConfig
"
,
"flowNodeType"
:
"
userGuide
"
,
"position"
:
{
"position"
:
{
"x"
:
531.2422736065552
,
"x"
:
531.2422736065552
,
"y"
:
-486.7611729549753
"y"
:
-486.7611729549753
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
"name"
:
"流程开始"
,
"name"
:
"流程开始"
,
"intro"
:
""
,
"intro"
:
""
,
"avatar"
:
"core/workflow/template/workflowStart"
,
"avatar"
:
"core/workflow/template/workflowStart"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.
workflowStart"
,
"flowNodeType"
:
"workflowStart"
,
"position"
:
{
"position"
:
{
"x"
:
558.4082376415505
,
"x"
:
558.4082376415505
,
"y"
:
123.72387429194112
"y"
:
123.72387429194112
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
"name"
:
"AI 对话"
,
"name"
:
"AI 对话"
,
"intro"
:
"AI 大模型对话"
,
"intro"
:
"AI 大模型对话"
,
"avatar"
:
"core/workflow/template/aiChat"
,
"avatar"
:
"core/workflow/template/aiChat"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.
chatNode"
,
"flowNodeType"
:
"chatNode"
,
"showStatus"
:
true
,
"showStatus"
:
true
,
"position"
:
{
"position"
:
{
"x"
:
1638.509551404687
,
"x"
:
1638.509551404687
,
...
@@ -229,7 +229,7 @@
...
@@ -229,7 +229,7 @@
"name"
:
"知识库搜索"
,
"name"
:
"知识库搜索"
,
"intro"
:
"调用
\"
语义检索
\"
和
\"
全文检索
\"
能力,从
\"
知识库
\"
中查找可能与问题相关的参考内容"
,
"intro"
:
"调用
\"
语义检索
\"
和
\"
全文检索
\"
能力,从
\"
知识库
\"
中查找可能与问题相关的参考内容"
,
"avatar"
:
"core/workflow/template/datasetSearch"
,
"avatar"
:
"core/workflow/template/datasetSearch"
,
"flowNodeType"
:
"
FlowNodeTypeEnum.
datasetSearchNode"
,
"flowNodeType"
:
"datasetSearchNode"
,
"showStatus"
:
true
,
"showStatus"
:
true
,
"position"
:
{
"position"
:
{
"x"
:
918.5901682164496
,
"x"
:
918.5901682164496
,
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/NodeDatasetConcat.tsx
View file @
bebbba39
...
@@ -7,11 +7,7 @@ import RenderInput from './render/RenderInput';
...
@@ -7,11 +7,7 @@ import RenderInput from './render/RenderInput';
import
{
Box
,
Button
,
Flex
,
HStack
}
from
'@chakra-ui/react'
;
import
{
Box
,
Button
,
Flex
,
HStack
}
from
'@chakra-ui/react'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
SmallAddIcon
}
from
'@chakra-ui/icons'
;
import
{
SmallAddIcon
}
from
'@chakra-ui/icons'
;
import
{
import
{
NodeInputKeyEnum
,
VARIABLE_NODE_ID
}
from
'@fastgpt/global/core/workflow/constants'
;
WorkflowIOValueTypeEnum
,
NodeInputKeyEnum
,
VARIABLE_NODE_ID
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
getOneQuoteInputTemplate
}
from
'@fastgpt/global/core/workflow/template/system/datasetConcat'
;
import
{
getOneQuoteInputTemplate
}
from
'@fastgpt/global/core/workflow/template/system/datasetConcat'
;
import
{
FlowNodeTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
FlowNodeTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
useSystemStore
}
from
'@/web/common/system/useSystemStore'
;
import
{
useSystemStore
}
from
'@/web/common/system/useSystemStore'
;
...
@@ -189,7 +185,7 @@ function Reference({
...
@@ -189,7 +185,7 @@ function Reference({
<
Flex
alignItems=
{
'center'
}
mb=
{
1
}
>
<
Flex
alignItems=
{
'center'
}
mb=
{
1
}
>
<
FormLabel
required=
{
inputChildren
.
required
}
>
{
inputChildren
.
label
}
</
FormLabel
>
<
FormLabel
required=
{
inputChildren
.
required
}
>
{
inputChildren
.
label
}
</
FormLabel
>
{
/* value */
}
{
/* value */
}
<
ValueTypeLabel
valueType=
{
inputChildren
.
valueType
}
/>
<
ValueTypeLabel
valueType=
{
inputChildren
.
valueType
}
valueDesc=
{
inputChildren
.
valueDesc
}
/>
<
MyIcon
<
MyIcon
className=
"delete"
className=
"delete"
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/NodePluginIO/PluginOutput.tsx
View file @
bebbba39
...
@@ -176,7 +176,7 @@ function Reference({
...
@@ -176,7 +176,7 @@ function Reference({
<
FormLabel
required=
{
input
.
required
}
>
{
input
.
label
}
</
FormLabel
>
<
FormLabel
required=
{
input
.
required
}
>
{
input
.
label
}
</
FormLabel
>
{
input
.
description
&&
<
QuestionTip
ml=
{
0.5
}
label=
{
input
.
description
}
></
QuestionTip
>
}
{
input
.
description
&&
<
QuestionTip
ml=
{
0.5
}
label=
{
input
.
description
}
></
QuestionTip
>
}
{
/* value */
}
{
/* value */
}
<
ValueTypeLabel
valueType=
{
input
.
valueType
}
/>
<
ValueTypeLabel
valueType=
{
input
.
valueType
}
valueDesc=
{
input
.
valueDesc
}
/>
<
MyIcon
<
MyIcon
name=
{
'common/settingLight'
}
name=
{
'common/settingLight'
}
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/NodeWorkflowStart.tsx
View file @
bebbba39
...
@@ -11,7 +11,10 @@ import { WorkflowContext } from '../../context';
...
@@ -11,7 +11,10 @@ import { WorkflowContext } from '../../context';
import
{
useCreation
}
from
'ahooks'
;
import
{
useCreation
}
from
'ahooks'
;
import
{
getWorkflowGlobalVariables
}
from
'@/web/core/workflow/utils'
;
import
{
getWorkflowGlobalVariables
}
from
'@/web/core/workflow/utils'
;
import
{
FlowNodeOutputItemType
}
from
'@fastgpt/global/core/workflow/type/io'
;
import
{
FlowNodeOutputItemType
}
from
'@fastgpt/global/core/workflow/type/io'
;
import
{
FlowNodeOutputTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
chatHistoryValueDesc
,
FlowNodeOutputTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
AppContext
}
from
'@/pages/app/detail/components/context'
;
import
{
AppContext
}
from
'@/pages/app/detail/components/context'
;
import
{
userFilesInput
}
from
'@fastgpt/global/core/workflow/template/system/workflowStart'
;
import
{
userFilesInput
}
from
'@fastgpt/global/core/workflow/template/system/workflowStart'
;
...
@@ -30,14 +33,27 @@ const NodeStart = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
...
@@ -30,14 +33,27 @@ const NodeStart = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
t
t
});
});
return
variables
.
map
<
FlowNodeOutputItemType
>
((
item
)
=>
({
return
variables
.
map
<
FlowNodeOutputItemType
>
((
item
)
=>
{
if
(
item
.
valueType
===
WorkflowIOValueTypeEnum
.
chatHistory
)
{
return
{
id
:
item
.
key
,
type
:
FlowNodeOutputTypeEnum
.
static
,
key
:
item
.
key
,
required
:
item
.
required
,
valueType
:
item
.
valueType
,
valueDesc
:
chatHistoryValueDesc
,
label
:
item
.
label
};
}
return
{
id
:
item
.
key
,
id
:
item
.
key
,
type
:
FlowNodeOutputTypeEnum
.
static
,
type
:
FlowNodeOutputTypeEnum
.
static
,
key
:
item
.
key
,
key
:
item
.
key
,
required
:
item
.
required
,
required
:
item
.
required
,
valueType
:
item
.
valueType
||
WorkflowIOValueTypeEnum
.
any
,
valueType
:
item
.
valueType
||
WorkflowIOValueTypeEnum
.
any
,
label
:
item
.
label
label
:
item
.
label
}));
};
});
},
[
nodeList
,
t
]);
},
[
nodeList
,
t
]);
// Dynamic add or delete userFilesInput
// Dynamic add or delete userFilesInput
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/FieldEditModal.tsx
View file @
bebbba39
...
@@ -24,8 +24,6 @@ import { useForm } from 'react-hook-form';
...
@@ -24,8 +24,6 @@ import { useForm } from 'react-hook-form';
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useMount
}
from
'ahooks'
;
import
{
useMount
}
from
'ahooks'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
{
useContextSelector
}
from
'use-context-selector'
;
import
{
WorkflowContext
}
from
'../../../../context'
;
const
FieldModal
=
({
const
FieldModal
=
({
customInputConfig
,
customInputConfig
,
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/Label.tsx
View file @
bebbba39
import
{
FlowNodeInputItemType
}
from
'@fastgpt/global/core/workflow/type/io.d'
;
import
{
FlowNodeInputItemType
}
from
'@fastgpt/global/core/workflow/type/io.d'
;
import
React
,
{
useCallback
,
useMemo
}
from
'react'
;
import
React
,
{
useCallback
,
useMemo
}
from
'react'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
Box
,
Flex
,
HStack
}
from
'@chakra-ui/react'
;
import
{
Box
,
Flex
}
from
'@chakra-ui/react'
;
import
NodeInputSelect
from
'@fastgpt/web/components/core/workflow/NodeInputSelect'
;
import
NodeInputSelect
from
'@fastgpt/web/components/core/workflow/NodeInputSelect'
;
import
{
FlowNodeInputTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
FlowNodeInputTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
...
@@ -10,9 +10,6 @@ import { useContextSelector } from 'use-context-selector';
...
@@ -10,9 +10,6 @@ import { useContextSelector } from 'use-context-selector';
import
{
WorkflowContext
}
from
'@/pages/app/detail/components/WorkflowComponents/context'
;
import
{
WorkflowContext
}
from
'@/pages/app/detail/components/WorkflowComponents/context'
;
import
QuestionTip
from
'@fastgpt/web/components/common/MyTooltip/QuestionTip'
;
import
QuestionTip
from
'@fastgpt/web/components/common/MyTooltip/QuestionTip'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
MyIcon
from
'@fastgpt/web/components/common/Icon'
;
import
MyTag
from
'@fastgpt/web/components/common/Tag/index'
;
import
VariableTip
from
'@/components/common/Textarea/MyTextarea/VariableTip'
;
import
VariableTip
from
'@/components/common/Textarea/MyTextarea/VariableTip'
;
type
Props
=
{
type
Props
=
{
...
@@ -25,7 +22,8 @@ const InputLabel = ({ nodeId, input }: Props) => {
...
@@ -25,7 +22,8 @@ const InputLabel = ({ nodeId, input }: Props) => {
const
onChangeNode
=
useContextSelector
(
WorkflowContext
,
(
v
)
=>
v
.
onChangeNode
);
const
onChangeNode
=
useContextSelector
(
WorkflowContext
,
(
v
)
=>
v
.
onChangeNode
);
const
{
description
,
required
,
label
,
selectedTypeIndex
,
renderTypeList
,
valueType
}
=
input
;
const
{
description
,
required
,
label
,
selectedTypeIndex
,
renderTypeList
,
valueType
,
valueDesc
}
=
input
;
const
onChangeRenderType
=
useCallback
(
const
onChangeRenderType
=
useCallback
(
(
e
:
string
)
=>
{
(
e
:
string
)
=>
{
...
@@ -60,7 +58,9 @@ const InputLabel = ({ nodeId, input }: Props) => {
...
@@ -60,7 +58,9 @@ const InputLabel = ({ nodeId, input }: Props) => {
{
description
&&
<
QuestionTip
ml=
{
1
}
label=
{
t
(
description
as
any
)
}
></
QuestionTip
>
}
{
description
&&
<
QuestionTip
ml=
{
1
}
label=
{
t
(
description
as
any
)
}
></
QuestionTip
>
}
</
Flex
>
</
Flex
>
{
/* value type */
}
{
/* value type */
}
{
renderType
===
FlowNodeInputTypeEnum
.
reference
&&
<
ValueTypeLabel
valueType=
{
valueType
}
/>
}
{
renderType
===
FlowNodeInputTypeEnum
.
reference
&&
(
<
ValueTypeLabel
valueType=
{
valueType
}
valueDesc=
{
valueDesc
}
/>
)
}
{
/* input type select */
}
{
/* input type select */
}
{
renderTypeList
&&
renderTypeList
.
length
>
1
&&
(
{
renderTypeList
&&
renderTypeList
.
length
>
1
&&
(
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/DynamicInputs/index.tsx
View file @
bebbba39
...
@@ -184,7 +184,7 @@ function Reference({
...
@@ -184,7 +184,7 @@ function Reference({
<
QuestionTip
ml=
{
1
}
label=
{
inputChildren
.
description
}
></
QuestionTip
>
<
QuestionTip
ml=
{
1
}
label=
{
inputChildren
.
description
}
></
QuestionTip
>
)
}
)
}
{
/* value */
}
{
/* value */
}
<
ValueTypeLabel
valueType=
{
inputChildren
.
valueType
}
/>
<
ValueTypeLabel
valueType=
{
inputChildren
.
valueType
}
valueDesc=
{
inputChildren
.
valueDesc
}
/>
<
MyIcon
<
MyIcon
name=
{
'common/settingLight'
}
name=
{
'common/settingLight'
}
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderInput/templates/SettingQuotePrompt.tsx
View file @
bebbba39
...
@@ -24,6 +24,7 @@ import { useCreation } from 'ahooks';
...
@@ -24,6 +24,7 @@ import { useCreation } from 'ahooks';
import
{
AppContext
}
from
'@/pages/app/detail/components/context'
;
import
{
AppContext
}
from
'@/pages/app/detail/components/context'
;
import
QuestionTip
from
'@fastgpt/web/components/common/MyTooltip/QuestionTip'
;
import
QuestionTip
from
'@fastgpt/web/components/common/MyTooltip/QuestionTip'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
{
datasetQuoteValueDesc
}
from
'@fastgpt/global/core/workflow/node/constant'
;
const
LabelStyles
:
BoxProps
=
{
const
LabelStyles
:
BoxProps
=
{
fontSize
:
[
'sm'
,
'md'
]
fontSize
:
[
'sm'
,
'md'
]
...
@@ -154,7 +155,10 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
...
@@ -154,7 +155,10 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
<
Box
position=
{
'relative'
}
color=
{
'myGray.600'
}
fontWeight=
{
'medium'
}
>
<
Box
position=
{
'relative'
}
color=
{
'myGray.600'
}
fontWeight=
{
'medium'
}
>
{
t
(
'common:core.module.Dataset quote.label'
)
}
{
t
(
'common:core.module.Dataset quote.label'
)
}
</
Box
>
</
Box
>
<
ValueTypeLabel
valueType=
{
WorkflowIOValueTypeEnum
.
datasetQuote
}
/>
<
ValueTypeLabel
valueType=
{
WorkflowIOValueTypeEnum
.
datasetQuote
}
valueDesc=
{
datasetQuoteValueDesc
}
/>
<
MyTooltip
label=
{
t
(
'common:core.module.Setting quote prompt'
)
}
>
<
MyTooltip
label=
{
t
(
'common:core.module.Setting quote prompt'
)
}
>
<
MyIcon
<
MyIcon
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderOutput/FieldEditModal.tsx
View file @
bebbba39
...
@@ -14,7 +14,6 @@ import {
...
@@ -14,7 +14,6 @@ import {
Textarea
Textarea
}
from
'@chakra-ui/react'
;
}
from
'@chakra-ui/react'
;
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
FlowNodeInputTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
import
{
CustomFieldConfigType
,
CustomFieldConfigType
,
FlowNodeOutputItemType
FlowNodeOutputItemType
...
@@ -25,7 +24,6 @@ import { useToast } from '@fastgpt/web/hooks/useToast';
...
@@ -25,7 +24,6 @@ import { useToast } from '@fastgpt/web/hooks/useToast';
import
React
,
{
useCallback
,
useMemo
}
from
'react'
;
import
React
,
{
useCallback
,
useMemo
}
from
'react'
;
import
{
useForm
}
from
'react-hook-form'
;
import
{
useForm
}
from
'react-hook-form'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useTranslation
}
from
'next-i18next'
;
import
{
useMount
}
from
'ahooks'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
FormLabel
from
'@fastgpt/web/components/common/MyBox/FormLabel'
;
import
{
getNanoid
}
from
'@fastgpt/global/common/string/tools'
;
import
{
getNanoid
}
from
'@fastgpt/global/common/string/tools'
;
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/RenderOutput/Label.tsx
View file @
bebbba39
...
@@ -11,7 +11,7 @@ import ValueTypeLabel from '../ValueTypeLabel';
...
@@ -11,7 +11,7 @@ import ValueTypeLabel from '../ValueTypeLabel';
const
OutputLabel
=
({
nodeId
,
output
}:
{
nodeId
:
string
;
output
:
FlowNodeOutputItemType
})
=>
{
const
OutputLabel
=
({
nodeId
,
output
}:
{
nodeId
:
string
;
output
:
FlowNodeOutputItemType
})
=>
{
const
{
t
}
=
useTranslation
();
const
{
t
}
=
useTranslation
();
const
{
label
=
''
,
description
,
valueType
}
=
output
;
const
{
label
=
''
,
description
,
valueType
,
valueDesc
}
=
output
;
const
Render
=
useMemo
(()
=>
{
const
Render
=
useMemo
(()
=>
{
return
(
return
(
...
@@ -36,7 +36,7 @@ const OutputLabel = ({ nodeId, output }: { nodeId: string; output: FlowNodeOutpu
...
@@ -36,7 +36,7 @@ const OutputLabel = ({ nodeId, output }: { nodeId: string; output: FlowNodeOutpu
{
t
(
label
as
any
)
}
{
t
(
label
as
any
)
}
</
Box
>
</
Box
>
{
description
&&
<
QuestionTip
ml=
{
1
}
label=
{
t
(
description
as
any
)
}
/>
}
{
description
&&
<
QuestionTip
ml=
{
1
}
label=
{
t
(
description
as
any
)
}
/>
}
<
ValueTypeLabel
valueType=
{
valueType
}
/>
<
ValueTypeLabel
valueType=
{
valueType
}
valueDesc=
{
valueDesc
}
/>
</
Flex
>
</
Flex
>
{
output
.
type
===
FlowNodeOutputTypeEnum
.
source
&&
(
{
output
.
type
===
FlowNodeOutputTypeEnum
.
source
&&
(
<
SourceHandle
<
SourceHandle
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/ValueTypeLabel.tsx
View file @
bebbba39
...
@@ -4,14 +4,19 @@ import { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants
...
@@ -4,14 +4,19 @@ import { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
React
from
'react'
;
import
React
from
'react'
;
const
ValueTypeLabel
=
({
valueType
}:
{
valueType
?:
WorkflowIOValueTypeEnum
})
=>
{
const
ValueTypeLabel
=
({
valueType
,
valueDesc
}:
{
valueType
?:
WorkflowIOValueTypeEnum
;
valueDesc
?:
string
;
})
=>
{
const
valueTypeData
=
valueType
?
FlowValueTypeMap
[
valueType
]
:
undefined
;
const
valueTypeData
=
valueType
?
FlowValueTypeMap
[
valueType
]
:
undefined
;
const
label
=
valueTypeData
?.
label
||
''
;
const
label
=
valueTypeData
?.
label
||
''
;
const
description
=
valueTypeData
?.
description
||
''
;
return
!!
label
?
(
return
!!
label
?
(
<
MyTooltip
label=
{
description
}
>
<
MyTooltip
label=
{
valueDesc
}
>
<
Box
<
Box
bg=
{
'myGray.100'
}
bg=
{
'myGray.100'
}
color=
{
'myGray.500'
}
color=
{
'myGray.500'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment