@@ -77,12 +77,16 @@ def hand_node(node, update_tool_map):
7777 node .get ('properties' , {}).get ('node_data' , {})['knowledge_id_list' ] = []
7878 if node .get ('type' ) == 'ai-chat-node' :
7979 node_data = node .get ('properties' , {}).get ('node_data' , {})
80+
8081 mcp_tool_ids = node_data .get ('mcp_tool_ids' ) or []
81- node_data ['mcp_tool_ids' ] = [update_tool_map .get (tool_id ,
82- tool_id ) for tool_id in mcp_tool_ids ]
82+ node_data ['mcp_tool_ids' ] = [update_tool_map .get (tool_id , tool_id ) for tool_id in mcp_tool_ids ]
83+
84+ skill_tool_ids = node_data .get ('skill_tool_ids' ) or []
85+ node_data ['skill_tool_ids' ] = [update_tool_map .get (tool_id , tool_id ) for tool_id in skill_tool_ids ]
86+
8387 tool_ids = node_data .get ('tool_ids' ) or []
84- node_data ['tool_ids' ] = [update_tool_map .get (tool_id ,
85- tool_id ) for tool_id in tool_ids ]
88+ node_data ['tool_ids' ] = [update_tool_map .get (tool_id , tool_id ) for tool_id in tool_ids ]
89+
8690 if node .get ('type' ) == 'mcp-node' :
8791 mcp_tool_id = (node .get ('properties' , {}).get ('node_data' , {}).get ('mcp_tool_id' ) or '' )
8892 node .get ('properties' , {}).get ('node_data' , {})['mcp_tool_id' ] = update_tool_map .get (mcp_tool_id ,
@@ -843,12 +847,12 @@ def export(self, with_valid=True):
843847 tool_list = QuerySet (Tool ).filter (
844848 id__in = application .tool_ids + application .mcp_tool_ids + application .skill_tool_ids
845849 ).exclude (scope = ToolScope .SHARED )
846- # 如果是技能工具,则需要将code字段转换为文件内容的base64字符串
847- for tool in tool_list :
848- if tool .tool_type == ToolType .SKILL :
849- skill_file = QuerySet (File ).filter (id = tool .code ).first ()
850- if skill_file :
851- tool .code = base64 .b64encode (skill_file .get_bytes ()).decode ('utf-8' )
850+ # 如果是技能工具,则需要将code字段转换为文件内容的base64字符串
851+ for tool in tool_list :
852+ if tool .tool_type == ToolType .SKILL :
853+ skill_file = QuerySet (File ).filter (id = tool .code ).first ()
854+ if skill_file :
855+ tool .code = base64 .b64encode (skill_file .get_bytes ()).decode ('utf-8' )
852856 application_dict = ApplicationSerializerModel (application ).data
853857
854858 mk_instance = MKInstance (application_dict ,
0 commit comments