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
80c8897e
authored
Jan 13, 2025
by
Archer
Committed by
GitHub
Jan 13, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: create plugin by curl (#3580)
parent
e933dacb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
178 additions
and
118 deletions
+178
-118
files/docker/docker-compose-milvus.yml
+8
-0
files/docker/docker-compose-pgvector.yml
+8
-0
files/docker/docker-compose-zilliz.yml
+8
-0
packages/global/core/workflow/type/io.d.ts
+2
-1
packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts
+2
-1
projects/app/src/web/core/app/templates.ts
+150
-116
No files found.
files/docker/docker-compose-milvus.yml
View file @
80c8897e
...
@@ -159,6 +159,14 @@ services:
...
@@ -159,6 +159,14 @@ services:
# 日志等级: debug, info, warn, error
# 日志等级: debug, info, warn, error
-
LOG_LEVEL=info
-
LOG_LEVEL=info
-
STORE_LOG_LEVEL=warn
-
STORE_LOG_LEVEL=warn
# 工作流最大运行次数
-
WORKFLOW_MAX_RUN_TIMES=1000
# 批量执行节点,最大输入长度
-
WORKFLOW_MAX_LOOP_TIMES=100
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
-
ALLOWED_ORIGINS=
# 是否开启IP限制,默认不开启
-
USE_IP_LIMIT=false
volumes
:
volumes
:
-
./config.json:/app/data/config.json
-
./config.json:/app/data/config.json
...
...
files/docker/docker-compose-pgvector.yml
View file @
80c8897e
...
@@ -116,6 +116,14 @@ services:
...
@@ -116,6 +116,14 @@ services:
# 日志等级: debug, info, warn, error
# 日志等级: debug, info, warn, error
-
LOG_LEVEL=info
-
LOG_LEVEL=info
-
STORE_LOG_LEVEL=warn
-
STORE_LOG_LEVEL=warn
# 工作流最大运行次数
-
WORKFLOW_MAX_RUN_TIMES=1000
# 批量执行节点,最大输入长度
-
WORKFLOW_MAX_LOOP_TIMES=100
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
-
ALLOWED_ORIGINS=
# 是否开启IP限制,默认不开启
-
USE_IP_LIMIT=false
volumes
:
volumes
:
-
./config.json:/app/data/config.json
-
./config.json:/app/data/config.json
...
...
files/docker/docker-compose-zilliz.yml
View file @
80c8897e
...
@@ -97,6 +97,14 @@ services:
...
@@ -97,6 +97,14 @@ services:
# 日志等级: debug, info, warn, error
# 日志等级: debug, info, warn, error
-
LOG_LEVEL=info
-
LOG_LEVEL=info
-
STORE_LOG_LEVEL=warn
-
STORE_LOG_LEVEL=warn
# 工作流最大运行次数
-
WORKFLOW_MAX_RUN_TIMES=1000
# 批量执行节点,最大输入长度
-
WORKFLOW_MAX_LOOP_TIMES=100
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
-
ALLOWED_ORIGINS=
# 是否开启IP限制,默认不开启
-
USE_IP_LIMIT=false
volumes
:
volumes
:
-
./config.json:/app/data/config.json
-
./config.json:/app/data/config.json
...
...
packages/global/core/workflow/type/io.d.ts
View file @
80c8897e
...
@@ -49,9 +49,10 @@ export type FlowNodeInputItemType = InputComponentPropsType & {
...
@@ -49,9 +49,10 @@ export type FlowNodeInputItemType = InputComponentPropsType & {
debugLabel
?:
string
;
debugLabel
?:
string
;
description
?:
string
;
// field desc
description
?:
string
;
// field desc
required
?:
boolean
;
required
?:
boolean
;
toolDescription
?:
string
;
// If this field is not empty, it is entered as a tool
enum
?:
string
;
enum
?:
string
;
toolDescription
?:
string
;
// If this field is not empty, it is entered as a tool
// render components params
// render components params
canEdit
?:
boolean
;
// dynamic inputs
canEdit
?:
boolean
;
// dynamic inputs
isPro
?:
boolean
;
// Pro version field
isPro
?:
boolean
;
// Pro version field
...
...
packages/service/core/workflow/dispatch/agent/runTool/toolChoice.ts
View file @
80c8897e
...
@@ -210,7 +210,7 @@ export const runToolWithToolChoice = async (
...
@@ -210,7 +210,7 @@ export const runToolWithToolChoice = async (
properties
[
item
.
key
]
=
{
properties
[
item
.
key
]
=
{
...
jsonSchema
,
...
jsonSchema
,
description
:
item
.
toolDescription
||
''
,
description
:
item
.
toolDescription
||
''
,
enum
:
item
.
enum
?.
split
(
'\n'
).
filter
(
Boolean
)
||
[]
enum
:
item
.
enum
?.
split
(
'\n'
).
filter
(
Boolean
)
||
undefined
};
};
});
});
...
@@ -227,6 +227,7 @@ export const runToolWithToolChoice = async (
...
@@ -227,6 +227,7 @@ export const runToolWithToolChoice = async (
}
}
};
};
});
});
// Filter histories by maxToken
// Filter histories by maxToken
const
filterMessages
=
(
const
filterMessages
=
(
await
filterGPTMessageByMaxTokens
({
await
filterGPTMessageByMaxTokens
({
...
...
projects/app/src/web/core/app/templates.ts
View file @
80c8897e
// @ts-nocheck
import
{
AppItemType
}
from
'@/types/app'
;
import
{
parseCurl
}
from
'@fastgpt/global/common/string/http'
;
import
{
parseCurl
}
from
'@fastgpt/global/common/string/http'
;
import
{
AppTypeEnum
}
from
'@fastgpt/global/core/app/constants'
;
import
{
AppTypeEnum
}
from
'@fastgpt/global/core/app/constants'
;
import
{
AppSchema
}
from
'@fastgpt/global/core/app/type'
;
import
{
AppSchema
}
from
'@fastgpt/global/core/app/type'
;
import
{
import
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
NodeOutputKeyEnum
,
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
{
import
{
FlowNodeInputTypeEnum
,
FlowNodeInputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeOutputTypeEnum
,
FlowNodeTypeEnum
FlowNodeTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
StoreEdgeItemType
}
from
'@fastgpt/global/core/workflow/type/edge'
;
import
{
import
{
StoreNodeItemType
}
from
'@fastgpt/global/core/workflow/type/node'
;
FlowNodeInputItemType
,
FlowNodeOutputItemType
}
from
'@fastgpt/global/core/workflow/type/io'
;
import
{
i18nT
}
from
'@fastgpt/web/i18n/utils'
;
import
{
i18nT
}
from
'@fastgpt/web/i18n/utils'
;
export
const
emptyTemplates
:
Record
<
export
const
emptyTemplates
:
Record
<
...
@@ -254,7 +250,8 @@ export const emptyTemplates: Record<
...
@@ -254,7 +250,8 @@ export const emptyTemplates: Record<
sourceHandle
:
'448745-source-right'
,
sourceHandle
:
'448745-source-right'
,
targetHandle
:
'loOvhld2ZTKa-target-left'
targetHandle
:
'loOvhld2ZTKa-target-left'
}
}
]
],
chatConfig
:
{}
},
},
[
AppTypeEnum
.
workflow
]:
{
[
AppTypeEnum
.
workflow
]:
{
avatar
:
'core/app/type/workflowFill'
,
avatar
:
'core/app/type/workflowFill'
,
...
@@ -265,7 +262,7 @@ export const emptyTemplates: Record<
...
@@ -265,7 +262,7 @@ export const emptyTemplates: Record<
name
:
i18nT
(
'common:core.module.template.system_config'
),
name
:
i18nT
(
'common:core.module.template.system_config'
),
intro
:
i18nT
(
'common:core.module.template.system_config_info'
),
intro
:
i18nT
(
'common:core.module.template.system_config_info'
),
avatar
:
'core/workflow/template/systemConfig'
,
avatar
:
'core/workflow/template/systemConfig'
,
flowNodeType
:
'userGuide'
,
flowNodeType
:
FlowNodeTypeEnum
.
systemConfig
,
position
:
{
position
:
{
x
:
262.2732338817093
,
x
:
262.2732338817093
,
y
:
-
476.00241136598146
y
:
-
476.00241136598146
...
@@ -274,22 +271,22 @@ export const emptyTemplates: Record<
...
@@ -274,22 +271,22 @@ export const emptyTemplates: Record<
inputs
:
[
inputs
:
[
{
{
key
:
'welcomeText'
,
key
:
'welcomeText'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'string'
,
valueType
:
WorkflowIOValueTypeEnum
.
string
,
label
:
'core.app.Welcome Text'
,
label
:
'core.app.Welcome Text'
,
value
:
''
value
:
''
},
},
{
{
key
:
'variables'
,
key
:
'variables'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
label
:
'core.app.Chat Variable'
,
label
:
'core.app.Chat Variable'
,
value
:
[]
value
:
[]
},
},
{
{
key
:
'questionGuide'
,
key
:
'questionGuide'
,
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
label
:
'core.app.Question Guide'
,
label
:
'core.app.Question Guide'
,
value
:
{
value
:
{
open
:
false
open
:
false
...
@@ -297,8 +294,8 @@ export const emptyTemplates: Record<
...
@@ -297,8 +294,8 @@ export const emptyTemplates: Record<
},
},
{
{
key
:
'tts'
,
key
:
'tts'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
label
:
''
,
label
:
''
,
value
:
{
value
:
{
type
:
'web'
type
:
'web'
...
@@ -306,8 +303,8 @@ export const emptyTemplates: Record<
...
@@ -306,8 +303,8 @@ export const emptyTemplates: Record<
},
},
{
{
key
:
'whisper'
,
key
:
'whisper'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
label
:
''
,
label
:
''
,
value
:
{
value
:
{
open
:
false
,
open
:
false
,
...
@@ -317,8 +314,8 @@ export const emptyTemplates: Record<
...
@@ -317,8 +314,8 @@ export const emptyTemplates: Record<
},
},
{
{
key
:
'scheduleTrigger'
,
key
:
'scheduleTrigger'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
label
:
''
,
label
:
''
,
value
:
null
value
:
null
}
}
...
@@ -330,7 +327,7 @@ export const emptyTemplates: Record<
...
@@ -330,7 +327,7 @@ export const emptyTemplates: Record<
name
:
i18nT
(
'common:core.module.template.work_start'
),
name
:
i18nT
(
'common:core.module.template.work_start'
),
intro
:
''
,
intro
:
''
,
avatar
:
'core/workflow/template/workflowStart'
,
avatar
:
'core/workflow/template/workflowStart'
,
flowNodeType
:
'workflowStart'
,
flowNodeType
:
FlowNodeTypeEnum
.
workflowStart
,
position
:
{
position
:
{
x
:
632.368838596004
,
x
:
632.368838596004
,
y
:
-
347.7446492944009
y
:
-
347.7446492944009
...
@@ -339,8 +336,8 @@ export const emptyTemplates: Record<
...
@@ -339,8 +336,8 @@ export const emptyTemplates: Record<
inputs
:
[
inputs
:
[
{
{
key
:
'userChatInput'
,
key
:
'userChatInput'
,
renderTypeList
:
[
'reference'
,
'textarea'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
reference
,
FlowNodeInputTypeEnum
.
textarea
],
valueType
:
'string'
,
valueType
:
WorkflowIOValueTypeEnum
.
string
,
label
:
i18nT
(
'common:core.module.input.label.user question'
),
label
:
i18nT
(
'common:core.module.input.label.user question'
),
required
:
true
,
required
:
true
,
toolDescription
:
i18nT
(
'common:core.module.input.label.user question'
)
toolDescription
:
i18nT
(
'common:core.module.input.label.user question'
)
...
@@ -351,13 +348,14 @@ export const emptyTemplates: Record<
...
@@ -351,13 +348,14 @@ export const emptyTemplates: Record<
id
:
'userChatInput'
,
id
:
'userChatInput'
,
key
:
'userChatInput'
,
key
:
'userChatInput'
,
label
:
'common:core.module.input.label.user question'
,
label
:
'common:core.module.input.label.user question'
,
type
:
'static'
,
type
:
FlowNodeOutputTypeEnum
.
static
,
valueType
:
'string'
valueType
:
WorkflowIOValueTypeEnum
.
string
}
}
]
]
}
}
],
],
edges
:
[]
edges
:
[],
chatConfig
:
{}
},
},
[
AppTypeEnum
.
plugin
]:
{
[
AppTypeEnum
.
plugin
]:
{
avatar
:
'core/app/type/pluginFill'
,
avatar
:
'core/app/type/pluginFill'
,
...
@@ -406,7 +404,8 @@ export const emptyTemplates: Record<
...
@@ -406,7 +404,8 @@ export const emptyTemplates: Record<
outputs
:
[]
outputs
:
[]
}
}
],
],
edges
:
[]
edges
:
[],
chatConfig
:
{}
}
}
};
};
...
@@ -420,34 +419,66 @@ export const parsePluginFromCurlString = (
...
@@ -420,34 +419,66 @@ export const parsePluginFromCurlString = (
const
{
url
,
method
,
headers
,
body
,
params
,
bodyArray
}
=
parseCurl
(
curl
);
const
{
url
,
method
,
headers
,
body
,
params
,
bodyArray
}
=
parseCurl
(
curl
);
const
allInputs
=
Array
.
from
(
const
allInputs
=
Array
.
from
(
new
Map
([...
headers
,
...
params
,
...
bodyArray
].
map
((
item
)
=>
[
item
.
key
,
item
])).
values
()
new
Map
([...
params
,
...
bodyArray
].
map
((
item
)
=>
[
item
.
key
,
item
])).
values
()
);
);
const
formatInputs
=
allInputs
.
map
((
item
)
=>
{
const
formatPluginStartInputs
=
allInputs
const
valueType
=
item
.
value
===
null
?
'string'
:
typeof
item
.
value
;
.
map
((
item
)
=>
{
return
{
const
valueType
=
item
.
value
===
null
?
'string'
:
typeof
item
.
value
;
renderTypeList
:
[
'reference'
],
const
valueTypeMap
=
{
selectedTypeIndex
:
0
,
string
:
{
valueType
,
renderTypeList
:
[
FlowNodeInputTypeEnum
.
input
,
FlowNodeInputTypeEnum
.
reference
],
canEdit
:
true
,
valueType
:
WorkflowIOValueTypeEnum
.
string
,
key
:
item
.
key
,
isToolType
:
true
,
label
:
item
.
key
,
defaultValue
:
item
.
value
description
:
item
.
key
,
},
defaultValue
:
''
,
number
:
{
required
:
false
,
renderTypeList
:
[
FlowNodeInputTypeEnum
.
numberInput
,
FlowNodeInputTypeEnum
.
reference
],
toolDescription
:
[
'string'
,
'number'
,
'boolean'
].
includes
(
valueType
)
?
item
.
key
:
''
valueType
:
WorkflowIOValueTypeEnum
.
number
,
};
isToolType
:
true
,
});
defaultValue
:
item
.
value
const
formatOutputs
=
formatInputs
.
map
((
item
)
=>
({
},
boolean
:
{
renderTypeList
:
[
FlowNodeInputTypeEnum
.
switch
,
FlowNodeInputTypeEnum
.
reference
],
valueType
:
WorkflowIOValueTypeEnum
.
boolean
,
isToolType
:
true
,
defaultValue
:
item
.
value
},
object
:
{
renderTypeList
:
[
FlowNodeInputTypeEnum
.
JSONEditor
,
FlowNodeInputTypeEnum
.
reference
],
valueType
:
WorkflowIOValueTypeEnum
.
object
,
isToolType
:
false
,
defaultValue
:
''
}
};
const
valueTypeItem
=
valueTypeMap
[
valueType
as
keyof
typeof
valueTypeMap
];
if
(
!
valueTypeItem
)
return
;
return
{
renderTypeList
:
valueTypeItem
.
renderTypeList
,
selectedTypeIndex
:
0
,
valueType
:
valueTypeItem
.
valueType
,
canEdit
:
true
,
key
:
item
.
key
,
label
:
item
.
key
,
description
:
''
,
defaultValue
:
valueTypeItem
.
defaultValue
,
required
:
false
,
toolDescription
:
valueTypeItem
.
isToolType
?
item
.
key
:
''
};
})
.
filter
(
Boolean
)
as
FlowNodeInputItemType
[];
const
formatPluginStartOutputs
=
formatPluginStartInputs
.
map
<
FlowNodeOutputItemType
>
((
item
)
=>
({
id
:
item
.
key
,
id
:
item
.
key
,
key
:
item
.
key
,
key
:
item
.
key
,
label
:
item
.
key
,
label
:
item
.
key
,
valueType
:
item
.
valueType
,
valueType
:
item
.
valueType
,
type
:
'hidden'
type
:
FlowNodeOutputTypeEnum
.
hidden
}));
}));
const
referenceHeaders
=
headers
.
map
((
item
)
=>
({
const
referenceHeaders
=
headers
.
map
((
item
)
=>
({
key
:
item
.
key
,
key
:
item
.
key
,
value
:
`{{$pluginInput.
${
item
.
key
}
$}}`
,
value
:
item
.
value
,
type
:
item
.
type
type
:
item
.
type
}));
}));
const
referenceParams
=
params
.
map
((
item
)
=>
({
const
referenceParams
=
params
.
map
((
item
)
=>
({
...
@@ -457,14 +488,17 @@ export const parsePluginFromCurlString = (
...
@@ -457,14 +488,17 @@ export const parsePluginFromCurlString = (
}));
}));
const
referenceBody
=
Object
.
entries
(
JSON
.
parse
(
body
)).
reduce
(
const
referenceBody
=
Object
.
entries
(
JSON
.
parse
(
body
)).
reduce
(
(
acc
,
[
key
,
value
])
=>
{
(
acc
,
[
key
,
value
])
=>
{
acc
[
key
]
=
`{{$pluginInput.
${
key
}
$}}`
;
acc
[
key
]
=
typeof
value
===
'string'
?
`###{{$pluginInput.
${
key
}
$}}###`
:
`{{$pluginInput.
${
key
}
$}}`
;
return
acc
;
return
acc
;
},
},
{}
as
Record
<
string
,
any
>
{}
as
Record
<
string
,
any
>
);
);
const
referenceBodyStr
=
JSON
.
stringify
(
referenceBody
,
null
,
2
)
const
referenceBodyStr
=
JSON
.
stringify
(
referenceBody
,
null
,
2
)
.
replace
(
/"{{
\$
/g
,
'{{$'
)
.
replace
(
/"{{
\$
/g
,
'{{$'
)
.
replace
(
/
\$
}}"/g
,
'$}}'
);
.
replace
(
/
\$
}}"/g
,
'$}}'
)
.
replace
(
/###{{
\$
/g
,
'{{$'
)
.
replace
(
/
\$
}}###/g
,
'$}}'
);
return
{
return
{
nodes
:
[
nodes
:
[
...
@@ -473,22 +507,22 @@ export const parsePluginFromCurlString = (
...
@@ -473,22 +507,22 @@ export const parsePluginFromCurlString = (
name
:
i18nT
(
'workflow:template.plugin_start'
),
name
:
i18nT
(
'workflow:template.plugin_start'
),
intro
:
i18nT
(
'workflow:intro_plugin_input'
),
intro
:
i18nT
(
'workflow:intro_plugin_input'
),
avatar
:
'core/workflow/template/workflowStart'
,
avatar
:
'core/workflow/template/workflowStart'
,
flowNodeType
:
'pluginInput'
,
flowNodeType
:
FlowNodeTypeEnum
.
pluginInput
,
showStatus
:
false
,
showStatus
:
false
,
position
:
{
position
:
{
x
:
427.6554681270263
,
x
:
427.6554681270263
,
y
:
-
291.6987155252725
y
:
-
291.6987155252725
},
},
version
:
'481'
,
version
:
'481'
,
inputs
:
formatInputs
,
inputs
:
format
PluginStart
Inputs
,
outputs
:
formatOutputs
outputs
:
format
PluginStart
Outputs
},
},
{
{
nodeId
:
'pluginOutput'
,
nodeId
:
'pluginOutput'
,
name
:
i18nT
(
'common:core.module.template.self_output'
),
name
:
i18nT
(
'common:core.module.template.self_output'
),
intro
:
i18nT
(
'workflow:intro_custom_plugin_output'
),
intro
:
i18nT
(
'workflow:intro_custom_plugin_output'
),
avatar
:
'core/workflow/template/pluginOutput'
,
avatar
:
'core/workflow/template/pluginOutput'
,
flowNodeType
:
'pluginOutput'
,
flowNodeType
:
FlowNodeTypeEnum
.
pluginOutput
,
showStatus
:
false
,
showStatus
:
false
,
position
:
{
position
:
{
x
:
1870.1072210870427
,
x
:
1870.1072210870427
,
...
@@ -497,8 +531,8 @@ export const parsePluginFromCurlString = (
...
@@ -497,8 +531,8 @@ export const parsePluginFromCurlString = (
version
:
'481'
,
version
:
'481'
,
inputs
:
[
inputs
:
[
{
{
renderTypeList
:
[
'reference'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
reference
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
canEdit
:
true
,
canEdit
:
true
,
key
:
'result'
,
key
:
'result'
,
label
:
'result'
,
label
:
'result'
,
...
@@ -508,8 +542,8 @@ export const parsePluginFromCurlString = (
...
@@ -508,8 +542,8 @@ export const parsePluginFromCurlString = (
value
:
[
'vumlECDQTjeC'
,
'httpRawResponse'
]
value
:
[
'vumlECDQTjeC'
,
'httpRawResponse'
]
},
},
{
{
renderTypeList
:
[
'reference'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
reference
],
valueType
:
'object'
,
valueType
:
WorkflowIOValueTypeEnum
.
object
,
canEdit
:
true
,
canEdit
:
true
,
key
:
'error'
,
key
:
'error'
,
label
:
'error'
,
label
:
'error'
,
...
@@ -526,7 +560,7 @@ export const parsePluginFromCurlString = (
...
@@ -526,7 +560,7 @@ export const parsePluginFromCurlString = (
name
:
'HTTP 请求'
,
name
:
'HTTP 请求'
,
intro
:
'可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)'
,
intro
:
'可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)'
,
avatar
:
'core/workflow/template/httpRequest'
,
avatar
:
'core/workflow/template/httpRequest'
,
flowNodeType
:
'httpRequest468'
,
flowNodeType
:
FlowNodeTypeEnum
.
httpRequest468
,
showStatus
:
true
,
showStatus
:
true
,
position
:
{
position
:
{
x
:
1049.4419012643668
,
x
:
1049.4419012643668
,
...
@@ -536,28 +570,28 @@ export const parsePluginFromCurlString = (
...
@@ -536,28 +570,28 @@ export const parsePluginFromCurlString = (
inputs
:
[
inputs
:
[
{
{
key
:
'system_addInputParam'
,
key
:
'system_addInputParam'
,
renderTypeList
:
[
'addInputParam'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
addInputParam
],
valueType
:
'dynamic'
,
valueType
:
WorkflowIOValueTypeEnum
.
dynamic
,
label
:
''
,
label
:
''
,
required
:
false
,
required
:
false
,
description
:
'接收前方节点的输出值作为变量,这些变量可以被 HTTP 请求参数使用。'
,
description
:
'接收前方节点的输出值作为变量,这些变量可以被 HTTP 请求参数使用。'
,
customInputConfig
:
{
customInputConfig
:
{
selectValueTypeList
:
[
selectValueTypeList
:
[
'string'
,
WorkflowIOValueTypeEnum
.
string
,
'number'
,
WorkflowIOValueTypeEnum
.
number
,
'boolean'
,
WorkflowIOValueTypeEnum
.
boolean
,
'object'
,
WorkflowIOValueTypeEnum
.
object
,
'arrayString'
,
WorkflowIOValueTypeEnum
.
arrayString
,
'arrayNumber'
,
WorkflowIOValueTypeEnum
.
arrayNumber
,
'arrayBoolean'
,
WorkflowIOValueTypeEnum
.
arrayBoolean
,
'arrayObject'
,
WorkflowIOValueTypeEnum
.
arrayObject
,
'arrayAny'
,
WorkflowIOValueTypeEnum
.
arrayAny
,
'any'
,
WorkflowIOValueTypeEnum
.
any
,
'chatHistory'
,
WorkflowIOValueTypeEnum
.
chatHistory
,
'datasetQuote'
,
WorkflowIOValueTypeEnum
.
datasetQuote
,
'dynamic'
,
WorkflowIOValueTypeEnum
.
dynamic
,
'selectApp'
,
WorkflowIOValueTypeEnum
.
selectApp
,
'selectDataset'
WorkflowIOValueTypeEnum
.
selectDataset
],
],
showDescription
:
false
,
showDescription
:
false
,
showDefaultValue
:
true
showDefaultValue
:
true
...
@@ -568,8 +602,8 @@ export const parsePluginFromCurlString = (
...
@@ -568,8 +602,8 @@ export const parsePluginFromCurlString = (
},
},
{
{
key
:
'system_httpMethod'
,
key
:
'system_httpMethod'
,
renderTypeList
:
[
'custom'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
custom
],
valueType
:
'string'
,
valueType
:
WorkflowIOValueTypeEnum
.
string
,
label
:
''
,
label
:
''
,
value
:
method
,
value
:
method
,
required
:
true
,
required
:
true
,
...
@@ -580,8 +614,8 @@ export const parsePluginFromCurlString = (
...
@@ -580,8 +614,8 @@ export const parsePluginFromCurlString = (
},
},
{
{
key
:
'system_httpTimeout'
,
key
:
'system_httpTimeout'
,
renderTypeList
:
[
'custom'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
custom
],
valueType
:
'number'
,
valueType
:
WorkflowIOValueTypeEnum
.
number
,
label
:
''
,
label
:
''
,
value
:
30
,
value
:
30
,
min
:
5
,
min
:
5
,
...
@@ -594,8 +628,8 @@ export const parsePluginFromCurlString = (
...
@@ -594,8 +628,8 @@ export const parsePluginFromCurlString = (
},
},
{
{
key
:
'system_httpReqUrl'
,
key
:
'system_httpReqUrl'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'string'
,
valueType
:
WorkflowIOValueTypeEnum
.
string
,
label
:
''
,
label
:
''
,
description
:
description
:
'新的 HTTP 请求地址。如果出现两个"请求地址",可以删除该模块重新加入,会拉取最新的模块配置。'
,
'新的 HTTP 请求地址。如果出现两个"请求地址",可以删除该模块重新加入,会拉取最新的模块配置。'
,
...
@@ -608,8 +642,8 @@ export const parsePluginFromCurlString = (
...
@@ -608,8 +642,8 @@ export const parsePluginFromCurlString = (
},
},
{
{
key
:
'system_httpHeader'
,
key
:
'system_httpHeader'
,
renderTypeList
:
[
'custom'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
custom
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
value
:
referenceHeaders
,
value
:
referenceHeaders
,
label
:
''
,
label
:
''
,
description
:
description
:
...
@@ -622,22 +656,21 @@ export const parsePluginFromCurlString = (
...
@@ -622,22 +656,21 @@ export const parsePluginFromCurlString = (
},
},
{
{
key
:
'system_httpParams'
,
key
:
'system_httpParams'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
value
:
referenceParams
,
value
:
referenceParams
,
description
:
description
:
'新的 HTTP 请求地址。如果出现两个“请求地址”,可以删除该模块重新加入,会拉取最新的模块配置。'
,
'新的 HTTP 请求地址。如果出现两个“请求地址”,可以删除该模块重新加入,会拉取最新的模块配置。'
,
label
:
''
,
label
:
''
,
required
:
false
,
required
:
false
,
valueDesc
:
''
,
valueDesc
:
''
,
description
:
''
,
debugLabel
:
''
,
debugLabel
:
''
,
toolDescription
:
''
toolDescription
:
''
},
},
{
{
key
:
'system_httpJsonBody'
,
key
:
'system_httpJsonBody'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
value
:
referenceBodyStr
,
value
:
referenceBodyStr
,
label
:
''
,
label
:
''
,
required
:
false
,
required
:
false
,
...
@@ -648,8 +681,8 @@ export const parsePluginFromCurlString = (
...
@@ -648,8 +681,8 @@ export const parsePluginFromCurlString = (
},
},
{
{
key
:
'system_httpFormBody'
,
key
:
'system_httpFormBody'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
value
:
[],
value
:
[],
label
:
''
,
label
:
''
,
required
:
false
,
required
:
false
,
...
@@ -660,8 +693,8 @@ export const parsePluginFromCurlString = (
...
@@ -660,8 +693,8 @@ export const parsePluginFromCurlString = (
},
},
{
{
key
:
'system_httpContentType'
,
key
:
'system_httpContentType'
,
renderTypeList
:
[
'hidden'
],
renderTypeList
:
[
FlowNodeInputTypeEnum
.
hidden
],
valueType
:
'string'
,
valueType
:
WorkflowIOValueTypeEnum
.
string
,
value
:
'json'
,
value
:
'json'
,
label
:
''
,
label
:
''
,
required
:
false
,
required
:
false
,
...
@@ -675,26 +708,26 @@ export const parsePluginFromCurlString = (
...
@@ -675,26 +708,26 @@ export const parsePluginFromCurlString = (
{
{
id
:
'system_addOutputParam'
,
id
:
'system_addOutputParam'
,
key
:
'system_addOutputParam'
,
key
:
'system_addOutputParam'
,
type
:
'dynamic'
,
type
:
FlowNodeOutputTypeEnum
.
dynamic
,
valueType
:
'dynamic'
,
valueType
:
WorkflowIOValueTypeEnum
.
dynamic
,
label
:
'输出字段提取'
,
label
:
'输出字段提取'
,
customFieldConfig
:
{
customFieldConfig
:
{
selectValueTypeList
:
[
selectValueTypeList
:
[
'string'
,
WorkflowIOValueTypeEnum
.
string
,
'number'
,
WorkflowIOValueTypeEnum
.
number
,
'boolean'
,
WorkflowIOValueTypeEnum
.
boolean
,
'object'
,
WorkflowIOValueTypeEnum
.
object
,
'arrayString'
,
WorkflowIOValueTypeEnum
.
arrayString
,
'arrayNumber'
,
WorkflowIOValueTypeEnum
.
arrayNumber
,
'arrayBoolean'
,
WorkflowIOValueTypeEnum
.
arrayBoolean
,
'arrayObject'
,
WorkflowIOValueTypeEnum
.
arrayObject
,
'arrayAny'
,
WorkflowIOValueTypeEnum
.
arrayAny
,
'any'
,
WorkflowIOValueTypeEnum
.
any
,
'chatHistory'
,
WorkflowIOValueTypeEnum
.
chatHistory
,
'datasetQuote'
,
WorkflowIOValueTypeEnum
.
datasetQuote
,
'dynamic'
,
WorkflowIOValueTypeEnum
.
dynamic
,
'selectApp'
,
WorkflowIOValueTypeEnum
.
selectApp
,
'selectDataset'
WorkflowIOValueTypeEnum
.
selectDataset
],
],
showDescription
:
false
,
showDescription
:
false
,
showDefaultValue
:
false
showDefaultValue
:
false
...
@@ -707,8 +740,8 @@ export const parsePluginFromCurlString = (
...
@@ -707,8 +740,8 @@ export const parsePluginFromCurlString = (
key
:
'error'
,
key
:
'error'
,
label
:
'请求错误'
,
label
:
'请求错误'
,
description
:
'HTTP请求错误信息,成功时返回空'
,
description
:
'HTTP请求错误信息,成功时返回空'
,
valueType
:
'object'
,
valueType
:
WorkflowIOValueTypeEnum
.
object
,
type
:
'static'
,
type
:
FlowNodeOutputTypeEnum
.
static
,
valueDesc
:
''
valueDesc
:
''
},
},
{
{
...
@@ -717,8 +750,8 @@ export const parsePluginFromCurlString = (
...
@@ -717,8 +750,8 @@ export const parsePluginFromCurlString = (
required
:
true
,
required
:
true
,
label
:
'原始响应'
,
label
:
'原始响应'
,
description
:
'HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。'
,
description
:
'HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。'
,
valueType
:
'any'
,
valueType
:
WorkflowIOValueTypeEnum
.
any
,
type
:
'static'
,
type
:
FlowNodeOutputTypeEnum
.
static
,
valueDesc
:
''
valueDesc
:
''
}
}
]
]
...
@@ -751,6 +784,7 @@ export const parsePluginFromCurlString = (
...
@@ -751,6 +784,7 @@ export const parsePluginFromCurlString = (
sourceHandle
:
'vumlECDQTjeC-source-right'
,
sourceHandle
:
'vumlECDQTjeC-source-right'
,
targetHandle
:
'pluginOutput-target-left'
targetHandle
:
'pluginOutput-target-left'
}
}
]
],
chatConfig
:
{}
};
};
};
};
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