MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / _parse_dify_node

Function _parse_dify_node

masfactory/compatibility/dify/parse.py:28–37  ·  view source on GitHub ↗
(raw: dict[str, Any], *, index: int)

Source from the content-addressed store, hash-verified

26
27
28def _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
40def _extract_loop_subgraphs(

Callers 1

Calls 2

ExternalNodeClass · 0.90

Tested by

no test coverage detected