mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
refactor(workflow): move agent node back to core workflow (#33431)
This commit is contained in:
@ -36,6 +36,7 @@ from core.rag.entities.event import (
|
||||
)
|
||||
from core.repositories.factory import DifyCoreRepositoryFactory
|
||||
from core.repositories.sqlalchemy_workflow_node_execution_repository import SQLAlchemyWorkflowNodeExecutionRepository
|
||||
from core.workflow.node_resolution import LATEST_VERSION, get_workflow_node_type_classes_mapping
|
||||
from core.workflow.workflow_entry import WorkflowEntry
|
||||
from dify_graph.entities.workflow_node_execution import (
|
||||
WorkflowNodeExecution,
|
||||
@ -48,7 +49,6 @@ from dify_graph.graph_events.base import GraphNodeEventBase
|
||||
from dify_graph.node_events.base import NodeRunResult
|
||||
from dify_graph.nodes.base.node import Node
|
||||
from dify_graph.nodes.http_request import HTTP_REQUEST_CONFIG_FILTER_KEY, build_http_request_config
|
||||
from dify_graph.nodes.node_mapping import LATEST_VERSION, NODE_TYPE_CLASSES_MAPPING
|
||||
from dify_graph.repositories.workflow_node_execution_repository import OrderConfig
|
||||
from dify_graph.runtime import VariablePool
|
||||
from dify_graph.system_variable import SystemVariable
|
||||
@ -381,7 +381,7 @@ class RagPipelineService:
|
||||
"""
|
||||
# return default block config
|
||||
default_block_configs: list[dict[str, Any]] = []
|
||||
for node_type, node_class_mapping in NODE_TYPE_CLASSES_MAPPING.items():
|
||||
for node_type, node_class_mapping in get_workflow_node_type_classes_mapping().items():
|
||||
node_class = node_class_mapping[LATEST_VERSION]
|
||||
filters = None
|
||||
if node_type is NodeType.HTTP_REQUEST:
|
||||
@ -410,12 +410,13 @@ class RagPipelineService:
|
||||
:return:
|
||||
"""
|
||||
node_type_enum = NodeType(node_type)
|
||||
node_mapping = get_workflow_node_type_classes_mapping()
|
||||
|
||||
# return default block config
|
||||
if node_type_enum not in NODE_TYPE_CLASSES_MAPPING:
|
||||
if node_type_enum not in node_mapping:
|
||||
return None
|
||||
|
||||
node_class = NODE_TYPE_CLASSES_MAPPING[node_type_enum][LATEST_VERSION]
|
||||
node_class = node_mapping[node_type_enum][LATEST_VERSION]
|
||||
final_filters = dict(filters) if filters else {}
|
||||
if node_type_enum is NodeType.HTTP_REQUEST and HTTP_REQUEST_CONFIG_FILTER_KEY not in final_filters:
|
||||
final_filters[HTTP_REQUEST_CONFIG_FILTER_KEY] = build_http_request_config(
|
||||
|
||||
@ -14,6 +14,7 @@ from core.app.apps.workflow.app_config_manager import WorkflowAppConfigManager
|
||||
from core.app.entities.app_invoke_entities import InvokeFrom, UserFrom, build_dify_run_context
|
||||
from core.repositories import DifyCoreRepositoryFactory
|
||||
from core.repositories.human_input_repository import HumanInputFormRepositoryImpl
|
||||
from core.workflow.node_resolution import LATEST_VERSION, get_workflow_node_type_classes_mapping
|
||||
from core.workflow.workflow_entry import WorkflowEntry
|
||||
from dify_graph.entities import GraphInitParams, WorkflowNodeExecution
|
||||
from dify_graph.entities.graph_config import NodeConfigDict
|
||||
@ -34,7 +35,6 @@ from dify_graph.nodes.human_input.entities import (
|
||||
)
|
||||
from dify_graph.nodes.human_input.enums import HumanInputFormKind
|
||||
from dify_graph.nodes.human_input.human_input_node import HumanInputNode
|
||||
from dify_graph.nodes.node_mapping import LATEST_VERSION, NODE_TYPE_CLASSES_MAPPING
|
||||
from dify_graph.nodes.start.entities import StartNodeData
|
||||
from dify_graph.repositories.human_input_form_repository import FormCreateParams
|
||||
from dify_graph.runtime import GraphRuntimeState, VariablePool
|
||||
@ -619,7 +619,7 @@ class WorkflowService:
|
||||
"""
|
||||
# return default block config
|
||||
default_block_configs: list[Mapping[str, object]] = []
|
||||
for node_type, node_class_mapping in NODE_TYPE_CLASSES_MAPPING.items():
|
||||
for node_type, node_class_mapping in get_workflow_node_type_classes_mapping().items():
|
||||
node_class = node_class_mapping[LATEST_VERSION]
|
||||
filters = None
|
||||
if node_type is NodeType.HTTP_REQUEST:
|
||||
@ -650,12 +650,13 @@ class WorkflowService:
|
||||
:return:
|
||||
"""
|
||||
node_type_enum = NodeType(node_type)
|
||||
node_mapping = get_workflow_node_type_classes_mapping()
|
||||
|
||||
# return default block config
|
||||
if node_type_enum not in NODE_TYPE_CLASSES_MAPPING:
|
||||
if node_type_enum not in node_mapping:
|
||||
return {}
|
||||
|
||||
node_class = NODE_TYPE_CLASSES_MAPPING[node_type_enum][LATEST_VERSION]
|
||||
node_class = node_mapping[node_type_enum][LATEST_VERSION]
|
||||
resolved_filters = dict(filters) if filters else {}
|
||||
if node_type_enum is NodeType.HTTP_REQUEST and HTTP_REQUEST_CONFIG_FILTER_KEY not in resolved_filters:
|
||||
resolved_filters[HTTP_REQUEST_CONFIG_FILTER_KEY] = build_http_request_config(
|
||||
|
||||
Reference in New Issue
Block a user