mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:06:51 +08:00
fix: ToolEntity data validation failed during workflow synchronization (#35696)
Co-authored-by: DESKTOP-ETT0IAR\MINIO <eldoradoel@163.com>
This commit is contained in:
parent
195ff4711d
commit
f01e099729
@ -3,6 +3,7 @@ import logging
|
||||
from core.tools.entities.tool_entities import ToolProviderType
|
||||
from core.tools.tool_manager import ToolManager
|
||||
from core.tools.utils.configuration import ToolParameterConfigurationManager
|
||||
from core.workflow.human_input_adapter import adapt_node_config_for_graph
|
||||
from events.app_event import app_draft_workflow_was_synced
|
||||
from graphon.nodes import BuiltinNodeTypes
|
||||
from graphon.nodes.tool.entities import ToolEntity
|
||||
@ -19,7 +20,8 @@ def handle(sender, **kwargs):
|
||||
for node_data in synced_draft_workflow.graph_dict.get("nodes", []):
|
||||
if node_data.get("data", {}).get("type") == BuiltinNodeTypes.TOOL:
|
||||
try:
|
||||
tool_entity = ToolEntity.model_validate(node_data["data"])
|
||||
adapted_node_data = adapt_node_config_for_graph(node_data)
|
||||
tool_entity = ToolEntity.model_validate(adapted_node_data["data"])
|
||||
provider_type = ToolProviderType(tool_entity.provider_type.value)
|
||||
tool_runtime = ToolManager.get_tool_runtime(
|
||||
provider_type=provider_type,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user