fix: resolve type error in node_factory by using type guard for node_type_str

This commit is contained in:
-LAN- 2025-08-29 16:16:58 +08:00
parent d7d456349d
commit f2bc4f5d87
No known key found for this signature in database
GPG Key ID: 6BA0D108DED011FF
1 changed files with 2 additions and 2 deletions

View File

@ -50,8 +50,8 @@ class DifyNodeFactory(NodeFactory):
raise ValueError(f"Node {node_id} missing data information")
node_type_str = node_data.get("type")
if not node_type_str:
raise ValueError(f"Node {node_id} missing type information")
if not is_str(node_type_str):
raise ValueError(f"Node {node_id} missing or invalid type information")
try:
node_type = NodeType(node_type_str)