MCPcopy Create free account
hub / github.com/THUDM/AgentBench / load_yaml

Function load_yaml

scripts/validate_lite_configs.py:25–35  ·  view source on GitHub ↗
(path: pathlib.Path)

Source from the content-addressed store, hash-verified

23
24
25def load_yaml(path: pathlib.Path) -> Dict[str, Any]:
26 try:
27 with path.open("r", encoding="utf-8") as f:
28 data = yaml.safe_load(f)
29 except Exception as e:
30 raise RuntimeError(f"Failed to parse YAML: {path}: {e}")
31 if data is None:
32 return {}
33 if not isinstance(data, dict):
34 raise RuntimeError(f"Expected mapping at top-level in {path}, got {type(data)}")
35 return data
36
37
38def main() -> int:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected