Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
7ec29bbe
Commit
7ec29bbe
authored
Mar 05, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: node add default value
parent
f1d44a4c
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
99 additions
and
32 deletions
+99
-32
constants.ts
web/app/components/workflow/constants.ts
+1
-12
default.ts
web/app/components/workflow/nodes/code/default.ts
+7
-2
default.ts
web/app/components/workflow/nodes/end/default.ts
+8
-2
default.ts
web/app/components/workflow/nodes/http/default.ts
+16
-2
types.ts
web/app/components/workflow/nodes/http/types.ts
+1
-1
default.ts
web/app/components/workflow/nodes/if-else/default.ts
+15
-2
default.ts
.../components/workflow/nodes/knowledge-retrieval/default.ts
+6
-1
default.ts
web/app/components/workflow/nodes/llm/default.ts
+17
-1
types.ts
web/app/components/workflow/nodes/llm/types.ts
+1
-1
default.ts
.../components/workflow/nodes/question-classifier/default.ts
+12
-1
mock.ts
...app/components/workflow/nodes/question-classifier/mock.ts
+1
-1
node.tsx
...pp/components/workflow/nodes/question-classifier/node.tsx
+1
-1
panel.tsx
...p/components/workflow/nodes/question-classifier/panel.tsx
+1
-1
types.ts
...pp/components/workflow/nodes/question-classifier/types.ts
+1
-1
default.ts
...p/components/workflow/nodes/template-transform/default.ts
+3
-1
default.ts
web/app/components/workflow/nodes/tool/default.ts
+4
-1
default.ts
...pp/components/workflow/nodes/variable-assigner/default.ts
+4
-1
No files found.
web/app/components/workflow/constants.ts
View file @
7ec29bbe
...
...
@@ -48,21 +48,10 @@ export const NODES_INITIAL_DATA = {
...
KnowledgeRetrievalDefault
.
defaultValue
,
},
[
BlockEnum
.
IfElse
]:
{
_targetBranches
:
[
{
id
:
'if-true'
,
name
:
'IS TRUE'
,
},
{
id
:
'if-false'
,
name
:
'IS FALSE'
,
},
],
type
:
BlockEnum
.
IfElse
,
title
:
''
,
desc
:
''
,
logical_operator
:
'and'
,
conditions
:
[],
...
IfElseDefault
.
defaultValue
,
},
[
BlockEnum
.
Code
]:
{
...
...
web/app/components/workflow/nodes/code/default.ts
View file @
7ec29bbe
import
type
{
NodeDefault
}
from
'../../types'
import
type
{
CodeNodeType
}
from
'./types'
import
{
CodeLanguage
,
type
CodeNodeType
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
CodeNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
code
:
''
,
code_language
:
CodeLanguage
.
python3
,
variables
:
[],
outputs
:
[],
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/end/default.ts
View file @
7ec29bbe
import
type
{
NodeDefault
}
from
'../../types'
import
type
{
EndNode
Type
}
from
'./types'
import
{
type
EndNodeType
,
EndVar
Type
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
EndNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
outputs
:
{
type
:
EndVarType
.
none
,
plain_text_selector
:
[],
structured_variables
:
[],
},
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/http/default.ts
View file @
7ec29bbe
import
type
{
NodeDefault
}
from
'../../types'
import
type
{
HttpNodeType
}
from
'./types'
import
{
AuthorizationType
,
BodyType
,
type
HttpNodeType
,
Method
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
HttpNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
variables
:
[],
method
:
Method
.
get
,
url
:
''
,
authorization
:
{
type
:
AuthorizationType
.
none
,
config
:
null
,
},
headers
:
''
,
params
:
''
,
body
:
{
type
:
BodyType
.
none
,
data
:
''
,
},
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/http/types.ts
View file @
7ec29bbe
...
...
@@ -44,7 +44,7 @@ export type Authorization = {
type
:
APIType
api_key
:
string
header
?:
string
}
}
|
null
}
export
type
HttpNodeType
=
CommonNodeType
&
{
...
...
web/app/components/workflow/nodes/if-else/default.ts
View file @
7ec29bbe
import
type
{
NodeDefault
}
from
'../../types'
import
type
{
IfElseNodeType
}
from
'./types'
import
{
type
IfElseNodeType
,
LogicalOperator
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
IfElseNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
_targetBranches
:
[
{
id
:
'if-true'
,
name
:
'IS TRUE'
,
},
{
id
:
'if-false'
,
name
:
'IS FALSE'
,
},
],
logical_operator
:
LogicalOperator
.
and
,
conditions
:
[],
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/knowledge-retrieval/default.ts
View file @
7ec29bbe
import
type
{
NodeDefault
}
from
'../../types'
import
type
{
KnowledgeRetrievalNodeType
}
from
'./types'
import
{
RETRIEVE_TYPE
}
from
'@/types/app'
const
nodeDefault
:
NodeDefault
<
KnowledgeRetrievalNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
query_variable_selector
:
[],
dataset_ids
:
[],
retrieval_mode
:
RETRIEVE_TYPE
.
oneWay
,
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/llm/default.ts
View file @
7ec29bbe
...
...
@@ -3,7 +3,23 @@ import type { LLMNodeType } from './types'
const
nodeDefault
:
NodeDefault
<
LLMNodeType
>
=
{
defaultValue
:
{
model
:
{
provider
:
''
,
name
:
''
,
mode
:
'chat'
,
completion_params
:
{
temperature
:
0.7
,
},
},
variables
:
[],
prompt
:
[],
context
:
{
enabled
:
false
,
variable_selector
:
[],
},
vision
:
{
enabled
:
false
,
},
},
getAvailablePrevNodes
()
{
return
[]
...
...
web/app/components/workflow/nodes/llm/types.ts
View file @
7ec29bbe
...
...
@@ -12,7 +12,7 @@ export type LLMNodeType = CommonNodeType & {
}
vision
:
{
enabled
:
boolean
configs
:
{
configs
?
:
{
detail
:
Resolution
}
}
...
...
web/app/components/workflow/nodes/question-classifier/default.ts
View file @
7ec29bbe
...
...
@@ -2,7 +2,18 @@ import type { NodeDefault } from '../../types'
import
type
{
QuestionClassifierNodeType
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
QuestionClassifierNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
query_variable_selector
:
[],
model
:
{
provider
:
''
,
name
:
''
,
mode
:
'chat'
,
completion_params
:
{
temperature
:
0.7
,
},
},
classes
:
[],
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/question-classifier/mock.ts
View file @
7ec29bbe
...
...
@@ -14,7 +14,7 @@ export const mockData: QuestionClassifierNodeType = {
temperature
:
0.7
,
},
},
topic
s
:
[
classe
s
:
[
{
id
:
'1'
,
name
:
'topic 1'
,
...
...
web/app/components/workflow/nodes/question-classifier/node.tsx
View file @
7ec29bbe
...
...
@@ -13,7 +13,7 @@ const Node: FC<NodeProps<QuestionClassifierNodeType>> = (props) => {
const
{
data
}
=
props
const
{
provider
,
name
:
modelId
}
=
data
.
model
// const tempTopics = data.topics
const
topics
=
data
.
topic
s
const
topics
=
data
.
classe
s
const
{
textGenerationModelList
,
}
=
useTextGenerationCurrentProviderAndModelAndModelList
()
...
...
web/app/components/workflow/nodes/question-classifier/panel.tsx
View file @
7ec29bbe
...
...
@@ -62,7 +62,7 @@ const Panel: FC<NodeProps<QuestionClassifierNodeType>> = ({
title=
{
t
(
`${i18nPrefix}.class`
)
}
>
<
ClassList
list=
{
inputs
.
topic
s
}
list=
{
inputs
.
classe
s
}
onChange=
{
handleTopicsChange
}
/>
</
Field
>
<
Field
...
...
web/app/components/workflow/nodes/question-classifier/types.ts
View file @
7ec29bbe
...
...
@@ -9,7 +9,7 @@ export type Topic = {
export
type
QuestionClassifierNodeType
=
CommonNodeType
&
{
query_variable_selector
:
ValueSelector
model
:
ModelConfig
topic
s
:
Topic
[]
classe
s
:
Topic
[]
instruction
:
string
memory
:
Memory
}
web/app/components/workflow/nodes/template-transform/default.ts
View file @
7ec29bbe
...
...
@@ -2,7 +2,9 @@ import type { NodeDefault } from '../../types'
import
type
{
TemplateTransformNodeType
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
TemplateTransformNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
variables
:
[],
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/tool/default.ts
View file @
7ec29bbe
...
...
@@ -2,7 +2,10 @@ import type { NodeDefault } from '../../types'
import
type
{
ToolNodeType
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
ToolNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
tool_inputs
:
[],
tool_parameters
:
{},
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/variable-assigner/default.ts
View file @
7ec29bbe
...
...
@@ -2,7 +2,10 @@ import type { NodeDefault } from '../../types'
import
type
{
VariableAssignerNodeType
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
VariableAssignerNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
output_type
:
'string'
,
variables
:
[],
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
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