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
a192ae93
Commit
a192ae93
authored
Mar 08, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: remove useless file
parent
7a07d8c2
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
0 additions
and
423 deletions
+0
-423
page.tsx
web/app/(commonLayout)/workflow/nodes/page.tsx
+0
-85
mock.ts
web/app/components/workflow/nodes/code/mock.ts
+0
-27
mock.ts
web/app/components/workflow/nodes/direct-answer/mock.ts
+0
-15
mock.ts
web/app/components/workflow/nodes/end/mock.ts
+0
-19
mock.ts
web/app/components/workflow/nodes/http/mock.ts
+0
-35
mock.ts
web/app/components/workflow/nodes/if-else/mock.ts
+0
-24
mock.ts
...app/components/workflow/nodes/knowledge-retrieval/mock.ts
+0
-20
mock.ts
web/app/components/workflow/nodes/llm/mock.ts
+0
-61
mock.ts
...app/components/workflow/nodes/question-classifier/mock.ts
+0
-34
mock.ts
web/app/components/workflow/nodes/start/mock.ts
+0
-44
mock.ts
web/app/components/workflow/nodes/template-transform/mock.ts
+0
-19
mock.ts
web/app/components/workflow/nodes/tool/mock.ts
+0
-27
mock.ts
web/app/components/workflow/nodes/variable-assigner/mock.ts
+0
-13
No files found.
web/app/(commonLayout)/workflow/nodes/page.tsx
deleted
100644 → 0
View file @
7a07d8c2
'use client'
import
type
{
FC
}
from
'react'
import
{
memo
}
from
'react'
import
Workflow
from
'@/app/components/workflow'
import
{
BlockEnum
}
from
'@/app/components/workflow/types'
import
{
mockData
as
StartNodeMock
}
from
'@/app/components/workflow/nodes/start/mock'
import
{
mockData
as
DirectAnswerNodeMock
}
from
'@/app/components/workflow/nodes/direct-answer/mock'
import
{
mockData
as
LLMNodeMock
}
from
'@/app/components/workflow/nodes/llm/mock'
import
{
mockData
as
KnowledgeRetrievalNodeMock
}
from
'@/app/components/workflow/nodes/knowledge-retrieval/mock'
import
{
mockData
as
QuestionClassifierNodeMock
}
from
'@/app/components/workflow/nodes/question-classifier/mock'
import
{
mockData
as
IfElseNodeMock
}
from
'@/app/components/workflow/nodes/if-else/mock'
import
{
mockData
as
CodeNodeMock
}
from
'@/app/components/workflow/nodes/code/mock'
import
{
mockData
as
TemplateTransformNodeMock
}
from
'@/app/components/workflow/nodes/template-transform/mock'
import
{
mockData
as
HttpRequestNodeMock
}
from
'@/app/components/workflow/nodes/http/mock'
import
{
mockData
as
ToolNodeMock
}
from
'@/app/components/workflow/nodes/tool/mock'
import
{
mockData
as
VariableAssignerNodeMock
}
from
'@/app/components/workflow/nodes/variable-assigner/mock'
import
{
mockData
as
EndNodeMock
}
from
'@/app/components/workflow/nodes/end/mock'
const
allMockData
=
{
[
BlockEnum
.
Start
]:
StartNodeMock
,
[
BlockEnum
.
DirectAnswer
]:
DirectAnswerNodeMock
,
[
BlockEnum
.
LLM
]:
LLMNodeMock
,
[
BlockEnum
.
KnowledgeRetrieval
]:
KnowledgeRetrievalNodeMock
,
[
BlockEnum
.
QuestionClassifier
]:
QuestionClassifierNodeMock
,
[
BlockEnum
.
IfElse
]:
IfElseNodeMock
,
[
BlockEnum
.
Code
]:
CodeNodeMock
,
[
BlockEnum
.
TemplateTransform
]:
TemplateTransformNodeMock
,
[
BlockEnum
.
HttpRequest
]:
HttpRequestNodeMock
,
[
BlockEnum
.
Tool
]:
ToolNodeMock
,
[
BlockEnum
.
VariableAssigner
]:
VariableAssignerNodeMock
,
[
BlockEnum
.
End
]:
EndNodeMock
,
}
const
nodes
=
[
BlockEnum
.
Code
/* 7 */
,
BlockEnum
.
KnowledgeRetrieval
/* 4 */
,
BlockEnum
.
Start
/* 1 */
,
BlockEnum
.
DirectAnswer
/* 2 */
,
BlockEnum
.
LLM
/* 3 */
,
BlockEnum
.
QuestionClassifier
/* 5 */
,
BlockEnum
.
IfElse
/* 6 */
,
BlockEnum
.
TemplateTransform
/* 8 */
,
BlockEnum
.
HttpRequest
/* 9 */
,
BlockEnum
.
Tool
/* 10 */
,
BlockEnum
.
VariableAssigner
/* 11 */
,
BlockEnum
.
End
/* 12 */
,
].
map
((
item
,
i
)
=>
{
const
payload
=
allMockData
[
item
]
return
({
id
:
`
${
i
+
1
}
`
,
type
:
'custom'
,
position
:
{
x
:
330
,
y
:
30
+
i
*
300
},
data
:
{
selected
:
i
===
0
,
// for test: always select the first node
name
:
item
,
...
payload
,
},
})
})
const
initialNodes
=
nodes
const
initialEdges
=
[
{
id
:
'1'
,
source
:
'1'
,
target
:
'2'
,
type
:
'custom'
,
},
{
id
:
'2'
,
source
:
'2'
,
target
:
'3'
,
type
:
'custom'
,
},
{
id
:
'3'
,
source
:
'2'
,
target
:
'4'
,
type
:
'custom'
,
},
]
const
Page
:
FC
=
()
=>
{
return
(
<
div
className=
'min-w-[720px] w-full h-full overflow-x-auto'
>
<
Workflow
nodes=
{
initialNodes
}
edges=
{
initialEdges
}
/>
</
div
>
)
}
export
default
memo
(
Page
)
web/app/components/workflow/nodes/code/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
{
CodeLanguage
}
from
'./types'
import
type
{
CodeNodeType
}
from
'./types'
export
const
mockData
:
CodeNodeType
=
{
title
:
'Code'
,
desc
:
''
,
type
:
BlockEnum
.
Code
,
variables
:
[
{
variable
:
'name'
,
value_selector
:
[
'aaa'
,
'name'
],
},
{
variable
:
'age'
,
value_selector
:
[
'bbb'
,
'b'
,
'c'
],
},
],
code_language
:
CodeLanguage
.
python3
,
code
:
'print("hello world")'
,
outputs
:
[
{
variable
:
'output'
,
variable_type
:
'string'
,
},
],
}
web/app/components/workflow/nodes/direct-answer/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
type
{
DirectAnswerNodeType
}
from
'./types'
export
const
mockData
:
DirectAnswerNodeType
=
{
title
:
'Direct answer'
,
desc
:
'Test'
,
type
:
BlockEnum
.
DirectAnswer
,
variables
:
[
{
variable
:
'age'
,
value_selector
:
[
'bbb'
,
'b'
,
'c'
],
},
],
answer
:
'Sorry, I cannot answer this question.'
,
}
web/app/components/workflow/nodes/end/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
{
EndVarType
}
from
'./types'
import
type
{
EndNodeType
}
from
'./types'
export
const
mockData
:
EndNodeType
=
{
title
:
'End'
,
desc
:
'Test'
,
type
:
BlockEnum
.
End
,
outputs
:
{
type
:
EndVarType
.
structured
,
plain_text_selector
:
[
'aaa'
,
'name'
],
structured_variables
:
[
{
variable
:
'test'
,
value_selector
:
[
'aaa'
,
'name'
],
},
],
},
}
web/app/components/workflow/nodes/http/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
{
APIType
,
AuthorizationType
,
BodyType
,
Method
}
from
'./types'
import
type
{
HttpNodeType
}
from
'./types'
export
const
mockData
:
HttpNodeType
=
{
title
:
'HTTP Request'
,
desc
:
'Test'
,
type
:
BlockEnum
.
HttpRequest
,
variables
:
[
{
variable
:
'name'
,
value_selector
:
[
'aaa'
,
'name'
],
},
{
variable
:
'age'
,
value_selector
:
[
'bbb'
,
'b'
,
'c'
],
},
],
method
:
Method
.
get
,
url
:
'https://api.dify.com/xx'
,
headers
:
'Content-Type: application/json
\
nAccept: */*'
,
params
:
''
,
body
:
{
type
:
BodyType
.
none
,
data
:
''
,
},
authorization
:
{
type
:
AuthorizationType
.
apiKey
,
config
:
{
type
:
APIType
.
custom
,
api_key
:
'abc'
,
header
:
'x-Authorization'
,
},
},
}
web/app/components/workflow/nodes/if-else/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
type
{
IfElseNodeType
}
from
'./types'
import
{
ComparisonOperator
,
LogicalOperator
}
from
'./types'
export
const
mockData
:
IfElseNodeType
=
{
title
:
'If Else'
,
desc
:
'Test'
,
type
:
BlockEnum
.
IfElse
,
logical_operator
:
LogicalOperator
.
and
,
conditions
:
[
{
id
:
'1'
,
variable_selector
:
[
'aaa'
,
'name'
],
comparison_operator
:
ComparisonOperator
.
contains
,
value
:
'22'
,
},
{
id
:
'2'
,
variable_selector
:
[
'bbb'
,
'b'
,
'c'
],
comparison_operator
:
ComparisonOperator
.
equal
,
value
:
'b'
,
},
],
}
web/app/components/workflow/nodes/knowledge-retrieval/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
type
{
KnowledgeRetrievalNodeType
}
from
'./types'
import
{
RETRIEVE_TYPE
}
from
'@/types/app'
export
const
mockData
:
KnowledgeRetrievalNodeType
=
{
type
:
BlockEnum
.
KnowledgeRetrieval
,
desc
:
'xxx'
,
title
:
'Knowledge Retrieval'
,
query_variable_selector
:
[
'aaa'
,
'name'
],
dataset_ids
:
[
'744a0635-2496-4a87-8e6d-fae410f610be'
],
retrieval_mode
:
RETRIEVE_TYPE
.
oneWay
,
multiple_retrieval_config
:
{
top_k
:
10
,
score_threshold
:
null
,
reranking_model
:
{
provider
:
''
,
model
:
''
,
},
},
}
web/app/components/workflow/nodes/llm/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
,
PromptRole
}
from
'../../types'
import
type
{
LLMNodeType
}
from
'./types'
import
{
Resolution
}
from
'@/types/app'
export
const
mockData
:
LLMNodeType
=
{
title
:
'LLM'
,
desc
:
'Test'
,
type
:
BlockEnum
.
LLM
,
model
:
{
provider
:
'openai'
,
name
:
'gpt-4'
,
mode
:
'chat'
,
completion_params
:
{
temperature
:
0.7
,
},
},
variables
:
[
{
variable
:
'name'
,
value_selector
:
[
'aaa'
,
'name'
],
},
{
variable
:
'age'
,
value_selector
:
[
'bbb'
,
'b'
,
'c'
],
},
{
variable
:
'a1'
,
value_selector
:
[
'aaa'
,
'name'
],
},
{
variable
:
'a2'
,
value_selector
:
[
'aaa'
,
'name'
],
},
],
prompt
:
[
{
role
:
PromptRole
.
system
,
text
:
''
,
},
],
memory
:
{
role_prefix
:
{
user
:
'user: '
,
assistant
:
'assistant: '
,
},
window
:
{
enabled
:
false
,
size
:
0
,
},
},
context
:
{
enabled
:
false
,
variable_selector
:
[
'aaa'
,
'name'
],
},
vision
:
{
enabled
:
true
,
configs
:
{
detail
:
Resolution
.
low
,
},
},
}
web/app/components/workflow/nodes/question-classifier/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
type
{
QuestionClassifierNodeType
}
from
'./types'
export
const
mockData
:
QuestionClassifierNodeType
=
{
title
:
'Question Classifier'
,
desc
:
'Test'
,
type
:
BlockEnum
.
QuestionClassifier
,
query_variable_selector
:
[
'aaa'
,
'name'
],
model
:
{
provider
:
'openai'
,
name
:
'gpt-4'
,
mode
:
'chat'
,
completion_params
:
{
temperature
:
0.7
,
},
},
classes
:
[
{
id
:
'1'
,
name
:
'topic 1'
,
},
{
id
:
'2'
,
name
:
'topic 2'
,
},
],
instruction
:
'You are an entity extraction model that accepts an input'
,
memory
:
{
window
:
{
enabled
:
false
,
size
:
0
,
},
},
}
web/app/components/workflow/nodes/start/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
type
{
StartNodeType
}
from
'./types'
import
{
BlockEnum
,
InputVarType
}
from
'@/app/components/workflow/types'
export
const
mockData
:
StartNodeType
=
{
title
:
'Start'
,
desc
:
'Test'
,
type
:
BlockEnum
.
Start
,
variables
:
[
{
type
:
InputVarType
.
textInput
,
label
:
'Test'
,
variable
:
'a'
,
max_length
:
10
,
default
:
'test'
,
required
:
true
,
hint
:
'Test'
,
},
{
type
:
InputVarType
.
paragraph
,
label
:
'Test'
,
variable
:
'para'
,
default
:
'test'
,
required
:
true
,
hint
:
'Test'
,
},
{
type
:
InputVarType
.
select
,
label
:
'Test'
,
variable
:
'sel'
,
default
:
'test'
,
required
:
false
,
hint
:
'Test'
,
options
:
[
'op1'
,
'op2'
],
},
{
type
:
InputVarType
.
number
,
label
:
'Test'
,
variable
:
'num'
,
default
:
'1'
,
required
:
true
,
hint
:
'Test'
,
},
],
}
web/app/components/workflow/nodes/template-transform/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
type
{
TemplateTransformNodeType
}
from
'./types'
export
const
mockData
:
TemplateTransformNodeType
=
{
title
:
'Template Transform'
,
desc
:
'Test'
,
type
:
BlockEnum
.
TemplateTransform
,
variables
:
[
{
variable
:
'name'
,
value_selector
:
[
'aaa'
,
'name'
],
},
{
variable
:
'age'
,
value_selector
:
[
'bbb'
,
'b'
,
'c'
],
},
],
template
:
'print("hello world")'
,
}
web/app/components/workflow/nodes/tool/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
type
{
ToolNodeType
}
from
'./types'
import
{
VarType
}
from
'./types'
export
const
mockData
:
ToolNodeType
=
{
title
:
'Tool'
,
desc
:
'Test'
,
type
:
BlockEnum
.
Tool
,
provider_id
:
'test'
,
provider_type
:
'builtin'
,
provider_name
:
'test'
,
tool_name
:
'test'
,
tool_label
:
'test'
,
tool_inputs
:
[
{
variable
:
'size'
,
variable_type
:
VarType
.
selector
,
value_selector
:
[
'aaa'
,
'name'
],
},
{
variable
:
'quality'
,
variable_type
:
VarType
.
static
,
value
:
'HD'
,
},
],
tool_parameters
:
{},
}
web/app/components/workflow/nodes/variable-assigner/mock.ts
deleted
100644 → 0
View file @
7a07d8c2
import
{
BlockEnum
}
from
'../../types'
import
type
{
VariableAssignerNodeType
}
from
'./types'
export
const
mockData
:
VariableAssignerNodeType
=
{
title
:
'Variable Assigner'
,
desc
:
'Test'
,
type
:
BlockEnum
.
VariableAssigner
,
output_type
:
'string'
,
variables
:
[
[
'aaa'
,
'name'
],
[
'bbb'
,
'b'
,
'c'
],
],
}
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