mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-23 09:46:53 +08:00
Feat/workflow phase2 (#4687)
This commit is contained in:
0
api/core/workflow/nodes/loop/__init__.py
Normal file
0
api/core/workflow/nodes/loop/__init__.py
Normal file
13
api/core/workflow/nodes/loop/entities.py
Normal file
13
api/core/workflow/nodes/loop/entities.py
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
from core.workflow.entities.base_node_data_entities import BaseIterationNodeData, BaseIterationState
|
||||
|
||||
|
||||
class LoopNodeData(BaseIterationNodeData):
|
||||
"""
|
||||
Loop Node Data.
|
||||
"""
|
||||
|
||||
class LoopState(BaseIterationState):
|
||||
"""
|
||||
Loop State.
|
||||
"""
|
||||
20
api/core/workflow/nodes/loop/loop_node.py
Normal file
20
api/core/workflow/nodes/loop/loop_node.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from core.workflow.entities.node_entities import NodeRunResult, NodeType
|
||||
from core.workflow.entities.variable_pool import VariablePool
|
||||
from core.workflow.nodes.base_node import BaseIterationNode
|
||||
from core.workflow.nodes.loop.entities import LoopNodeData, LoopState
|
||||
|
||||
|
||||
class LoopNode(BaseIterationNode):
|
||||
"""
|
||||
Loop Node.
|
||||
"""
|
||||
_node_data_cls = LoopNodeData
|
||||
_node_type = NodeType.LOOP
|
||||
|
||||
def _run(self, variable_pool: VariablePool) -> LoopState:
|
||||
return super()._run(variable_pool)
|
||||
|
||||
def _get_next_iteration(self, variable_loop: VariablePool) -> NodeRunResult | str:
|
||||
"""
|
||||
Get next iteration start node id based on the graph.
|
||||
"""
|
||||
Reference in New Issue
Block a user