MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / _load_graph_dict

Function _load_graph_dict

workflow/subgraph_loader.py:46–60  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

44
45
46def _load_graph_dict(path: Path) -> Dict[str, Any]:
47 data = read_yaml(path)
48 if not isinstance(data, dict):
49 raise ConfigError("subgraph YAML root must be a mapping", path=str(path))
50
51 graph_block = data.get("graph")
52 if graph_block is None:
53 graph_block = data
54
55 if not isinstance(graph_block, dict):
56 raise ConfigError("subgraph graph section must be a mapping", path=f"{path}.graph")
57
58 vars_block = data.get("vars") if isinstance(data.get("vars"), dict) else {}
59
60 return {"graph": graph_block, "vars": vars_block}
61
62
63def load_subgraph_config(file_path: str, *, parent_source: str | None = None) -> Tuple[Dict[str, Any], Dict[str, Any], str]:

Callers 1

load_subgraph_configFunction · 0.85

Calls 3

read_yamlFunction · 0.90
ConfigErrorClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected