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
2386eed7
Commit
2386eed7
authored
Feb 19, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: new block enum
parent
ada558be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
69 deletions
+67
-69
page.tsx
web/app/(commonLayout)/workflow/nodes/page.tsx
+5
-4
panel.tsx
web/app/components/workflow/nodes/llm/panel.tsx
+62
-65
No files found.
web/app/(commonLayout)/workflow/nodes/page.tsx
View file @
2386eed7
...
...
@@ -3,15 +3,16 @@
import
type
{
FC
}
from
'react'
import
{
memo
}
from
'react'
import
Workflow
from
'@/app/components/workflow'
import
{
BlockEnum
}
from
'@/app/components/workflow/types'
const
nodes
=
[
'start'
,
'directAnswer'
,
'llm'
,
'knowledgeRetrieval'
,
'questionClassifier'
,
'questionClassifier'
,
'ifElse'
,
'code'
,
'templateTransform'
,
'http'
,
'tool'
,
BlockEnum
.
Start
,
BlockEnum
.
DirectAnswer
,
BlockEnum
.
LLM
,
BlockEnum
.
KnowledgeRetrieval
,
BlockEnum
.
QuestionClassifier
,
BlockEnum
.
QuestionClassifier
,
BlockEnum
.
IfElse
,
BlockEnum
.
Code
,
BlockEnum
.
TemplateTransform
,
BlockEnum
.
HttpRequest
,
BlockEnum
.
Tool
,
].
map
((
item
,
i
)
=>
({
id
:
`
${
i
+
1
}
`
,
type
:
'custom'
,
position
:
{
x
:
330
,
y
:
30
+
i
*
200
},
data
:
{
type
:
item
},
data
:
{
type
:
item
,
name
:
item
},
}))
const
initialNodes
=
nodes
...
...
web/app/components/workflow/nodes/llm/panel.tsx
View file @
2386eed7
...
...
@@ -29,78 +29,75 @@ const Panel: FC = () => {
// const isChatMode = modelMode === 'chat'
return
(
<
BasePanel
inputsElement=
{
<
div
className=
'mt-2 px-4 space-y-4'
>
<
Field
title=
{
t
(
`${i18nPrefix}.model`
)
}
>
<
ModelParameterModal
popupClassName=
'!w-[387px]'
isAdvancedMode=
{
true
}
mode=
{
model
?.
mode
}
provider=
{
model
?.
provider
}
completionParams=
{
model
.
completion_params
}
modelId=
{
model
.
name
}
setModel=
{
handleModelChanged
}
onCompletionParamsChange=
{
handleCompletionParamsChange
}
hideDebugWithMultipleModel
debugWithMultipleModel=
{
false
}
/>
</
Field
>
<
BasePanel
>
<
div
className=
'mt-2 px-4 space-y-4'
>
<
Field
title=
{
t
(
`${i18nPrefix}.model`
)
}
>
<
ModelParameterModal
popupClassName=
'!w-[387px]'
isAdvancedMode=
{
true
}
mode=
{
model
?.
mode
}
provider=
{
model
?.
provider
}
completionParams=
{
model
.
completion_params
}
modelId=
{
model
.
name
}
setModel=
{
handleModelChanged
}
onCompletionParamsChange=
{
handleCompletionParamsChange
}
hideDebugWithMultipleModel
debugWithMultipleModel=
{
false
}
/>
</
Field
>
<
Field
title=
{
t
(
`${i18nPrefix}.variables`
)
}
operations=
{
<
AddButton
onClick=
{
handleAddVariable
}
/>
}
>
<
VarList
readonly=
{
readOnly
}
list=
{
inputs
.
variables
}
onChange=
{
handleVarListChange
}
/>
</
Field
>
<
Field
title=
{
t
(
`${i18nPrefix}.variables`
)
}
operations=
{
<
AddButton
onClick=
{
handleAddVariable
}
/>
}
>
<
VarList
readonly=
{
readOnly
}
list=
{
inputs
.
variables
}
onChange=
{
handleVarListChange
}
/>
</
Field
>
<
Field
title=
{
t
(
`${i18nPrefix}.context`
)
}
operations=
{
<
Switch
defaultValue=
{
inputs
.
context
.
enabled
}
onChange=
{
toggleContextEnabled
}
size=
'md'
/>
}
>
{
inputs
.
context
.
enabled
?
(
<
div
>
Context
</
div
>
)
:
null
}
</
Field
>
<
Field
title=
{
t
(
`${i18nPrefix}.prompt`
)
}
>
Prompt
</
Field
>
<
Split
/>
<
Field
title=
{
t
(
`${i18nPrefix}.vision`
)
}
inline
>
Vision
</
Field
>
{
/* This version not support function */
}
{
/* <Field
<
Field
title=
{
t
(
`${i18nPrefix}.context`
)
}
operations=
{
<
Switch
defaultValue=
{
inputs
.
context
.
enabled
}
onChange=
{
toggleContextEnabled
}
size=
'md'
/>
}
>
{
inputs
.
context
.
enabled
?
(
<
div
>
Context
</
div
>
)
:
null
}
</
Field
>
<
Field
title=
{
t
(
`${i18nPrefix}.prompt`
)
}
>
Prompt
</
Field
>
<
Split
/>
<
Field
title=
{
t
(
`${i18nPrefix}.vision`
)
}
inline
>
Vision
</
Field
>
{
/* This version not support function */
}
{
/* <Field
title={t(`${i18nPrefix}.fu`)}
inline
>
Functions
</Field> */
}
</
div
>
}
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
/>
</
div
>
</
BasePanel
>
)
}
...
...
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