(raw: dict[str, Any], *, index: int)
| 26 | |
| 27 | |
| 28 | def _parse_dify_node(raw: dict[str, Any], *, index: int) -> ExternalNode: |
| 29 | nid = raw.get("id") |
| 30 | if nid is None: |
| 31 | raise CompatibilityImportError(f"Dify node at index {index} is missing `id`.") |
| 32 | data = raw.get("data") |
| 33 | if not isinstance(data, dict): |
| 34 | data = {} |
| 35 | kind = str(data.get("type") or raw.get("type") or "") |
| 36 | label = str(data.get("title") or kind or nid) |
| 37 | return ExternalNode(id=str(nid), kind=kind, label=label, raw=dict(raw)) |
| 38 | |
| 39 | |
| 40 | def _extract_loop_subgraphs( |
no test coverage detected