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
57e9e229
Commit
57e9e229
authored
Mar 05, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
90c8d9d2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
13 deletions
+41
-13
page.tsx
web/app/(commonLayout)/workflow/nodes/page.tsx
+1
-1
constants.ts
web/app/components/workflow/constants.ts
+25
-4
default.ts
web/app/components/workflow/nodes/direct-answer/default.ts
+4
-1
default.ts
web/app/components/workflow/nodes/llm/default.ts
+3
-1
node.tsx
web/app/components/workflow/nodes/llm/node.tsx
+1
-1
panel.tsx
web/app/components/workflow/nodes/llm/panel.tsx
+3
-3
default.ts
web/app/components/workflow/nodes/start/default.ts
+3
-1
node.tsx
web/app/components/workflow/nodes/start/node.tsx
+1
-1
No files found.
web/app/(commonLayout)/workflow/nodes/page.tsx
View file @
57e9e229
...
...
@@ -32,7 +32,7 @@ const allMockData = {
[
BlockEnum
.
End
]:
EndNodeMock
,
}
const
nodes
=
[
BlockEnum
.
QuestionClassifier
/* 5 */
,
BlockEnum
.
Start
/* 1
*/
,
BlockEnum
.
DirectAnswer
/* 2 */
,
BlockEnum
.
LLM
/* 3 */
,
BlockEnum
.
KnowledgeRetrieval
/* 4 */
,
BlockEnum
.
Start
/* 1 */
,
BlockEnum
.
QuestionClassifier
/* 5
*/
,
BlockEnum
.
DirectAnswer
/* 2 */
,
BlockEnum
.
LLM
/* 3 */
,
BlockEnum
.
KnowledgeRetrieval
/* 4 */
,
BlockEnum
.
IfElse
/* 6 */
,
BlockEnum
.
Code
/* 7 */
,
BlockEnum
.
TemplateTransform
/* 8 */
,
BlockEnum
.
HttpRequest
/* 9 */
,
BlockEnum
.
Tool
/* 10 */
,
BlockEnum
.
VariableAssigner
/* 11 */
,
BlockEnum
.
End
/* 12 */
,
].
map
((
item
,
i
)
=>
{
...
...
web/app/components/workflow/constants.ts
View file @
57e9e229
import
{
BlockEnum
}
from
'./types'
import
StartNodeDefault
from
'./nodes/start/default'
import
DirectAnswerDefault
from
'./nodes/direct-answer/default'
import
LLMDefault
from
'./nodes/llm/default'
import
KnowledgeRetrievalDefault
from
'./nodes/knowledge-retrieval/default'
import
QuestionClassifierDefault
from
'./nodes/question-classifier/default'
import
IfElseDefault
from
'./nodes/if-else/default'
import
CodeDefault
from
'./nodes/code/default'
import
TemplateTransformDefault
from
'./nodes/template-transform/default'
import
HttpRequestDefault
from
'./nodes/http/default'
import
ToolDefault
from
'./nodes/tool/default'
import
VariableAssignerDefault
from
'./nodes/variable-assigner/default'
import
EndNodeDefault
from
'./nodes/end/default'
export
const
NodeInitialData
=
{
[
BlockEnum
.
Start
]:
{
type
:
BlockEnum
.
Start
,
title
:
''
,
desc
:
''
,
variables
:
[]
,
...
StartNodeDefault
.
defaultValue
,
},
[
BlockEnum
.
End
]:
{
type
:
BlockEnum
.
End
,
title
:
''
,
desc
:
''
,
outputs
:
{}
,
...
EndNodeDefault
.
defaultValue
,
},
[
BlockEnum
.
DirectAnswer
]:
{
type
:
BlockEnum
.
DirectAnswer
,
title
:
''
,
desc
:
''
,
variables
:
[]
,
...
DirectAnswerDefault
.
defaultValue
,
},
[
BlockEnum
.
LLM
]:
{
type
:
BlockEnum
.
LLM
,
title
:
''
,
desc
:
''
,
variables
:
[],
...
LLMDefault
.
defaultValue
,
},
[
BlockEnum
.
KnowledgeRetrieval
]:
{
type
:
BlockEnum
.
KnowledgeRetrieval
,
...
...
@@ -32,9 +45,10 @@ export const NodeInitialData = {
query_variable_selector
:
[],
dataset_ids
:
[],
retrieval_mode
:
'single'
,
...
KnowledgeRetrievalDefault
.
defaultValue
,
},
[
BlockEnum
.
IfElse
]:
{
targetBranches
:
[
_
targetBranches
:
[
{
id
:
'if-true'
,
name
:
'IS TRUE'
,
...
...
@@ -49,6 +63,7 @@ export const NodeInitialData = {
desc
:
''
,
logical_operator
:
'and'
,
conditions
:
[],
...
IfElseDefault
.
defaultValue
,
},
[
BlockEnum
.
Code
]:
{
type
:
BlockEnum
.
Code
,
...
...
@@ -58,6 +73,7 @@ export const NodeInitialData = {
code_language
:
'python3'
,
code
:
''
,
outputs
:
[],
...
CodeDefault
.
defaultValue
,
},
[
BlockEnum
.
TemplateTransform
]:
{
type
:
BlockEnum
.
TemplateTransform
,
...
...
@@ -65,6 +81,7 @@ export const NodeInitialData = {
desc
:
''
,
variables
:
[],
template
:
''
,
...
TemplateTransformDefault
.
defaultValue
,
},
[
BlockEnum
.
QuestionClassifier
]:
{
type
:
BlockEnum
.
QuestionClassifier
,
...
...
@@ -72,12 +89,14 @@ export const NodeInitialData = {
desc
:
''
,
query_variable_selector
:
[],
topics
:
[],
...
QuestionClassifierDefault
.
defaultValue
,
},
[
BlockEnum
.
HttpRequest
]:
{
type
:
BlockEnum
.
HttpRequest
,
title
:
''
,
desc
:
''
,
variables
:
[],
...
HttpRequestDefault
.
defaultValue
,
},
[
BlockEnum
.
VariableAssigner
]:
{
type
:
BlockEnum
.
VariableAssigner
,
...
...
@@ -85,11 +104,13 @@ export const NodeInitialData = {
desc
:
''
,
variables
:
[],
output_type
:
''
,
...
VariableAssignerDefault
.
defaultValue
,
},
[
BlockEnum
.
Tool
]:
{
type
:
BlockEnum
.
Tool
,
title
:
''
,
desc
:
''
,
...
ToolDefault
.
defaultValue
,
},
}
...
...
web/app/components/workflow/nodes/direct-answer/default.ts
View file @
57e9e229
...
...
@@ -2,7 +2,10 @@ import type { NodeDefault } from '../../types'
import
type
{
DirectAnswerNodeType
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
DirectAnswerNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
variables
:
[],
answer
:
''
,
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/llm/default.ts
View file @
57e9e229
...
...
@@ -2,7 +2,9 @@ import type { NodeDefault } from '../../types'
import
type
{
LLMNodeType
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
LLMNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/llm/node.tsx
View file @
57e9e229
...
...
@@ -9,7 +9,7 @@ import type { NodeProps } from '@/app/components/workflow/types'
const
Node
:
FC
<
NodeProps
<
LLMNodeType
>>
=
({
data
,
})
=>
{
const
{
provider
,
name
:
modelId
}
=
data
.
model
const
{
provider
,
name
:
modelId
}
=
data
.
model
||
{}
const
{
textGenerationModelList
,
}
=
useTextGenerationCurrentProviderAndModelAndModelList
()
...
...
web/app/components/workflow/nodes/llm/panel.tsx
View file @
57e9e229
...
...
@@ -51,8 +51,8 @@ const Panel: FC<NodeProps<LLMNodeType>> = ({
isAdvancedMode=
{
true
}
mode=
{
model
?.
mode
}
provider=
{
model
?.
provider
}
completionParams=
{
model
.
completion_params
}
modelId=
{
model
.
name
}
completionParams=
{
model
?
.
completion_params
}
modelId=
{
model
?
.
name
}
setModel=
{
handleModelChanged
}
onCompletionParamsChange=
{
handleCompletionParamsChange
}
hideDebugWithMultipleModel
...
...
@@ -81,7 +81,7 @@ const Panel: FC<NodeProps<LLMNodeType>> = ({
<
VarReferencePicker
readonly=
{
readOnly
}
isShowNodeName
value=
{
inputs
.
context
.
variable_selector
}
value=
{
inputs
.
context
?.
variable_selector
||
[]
}
onChange=
{
handleContextVarChange
}
/>
...
...
web/app/components/workflow/nodes/start/default.ts
View file @
57e9e229
...
...
@@ -2,7 +2,9 @@ import type { NodeDefault } from '../../types'
import
type
{
StartNodeType
}
from
'./types'
const
nodeDefault
:
NodeDefault
<
StartNodeType
>
=
{
defaultValue
:
{},
defaultValue
:
{
variables
:
[],
},
getAvailablePrevNodes
()
{
return
[]
},
...
...
web/app/components/workflow/nodes/start/node.tsx
View file @
57e9e229
...
...
@@ -10,7 +10,7 @@ const Node: FC<NodeProps<StartNodeType>> = ({
data
,
})
=>
{
const
{
t
}
=
useTranslation
()
const
{
variables
=
[]
}
=
data
const
{
variables
}
=
data
return
(
<
div
className=
'px-3'
>
...
...
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