INNER CODE UNIT · Python

check_yaml

llm-d/llm-d · scripts/guide.py:505

def check_yaml(guide: Any) -> Findings:
    """Validate a parsed guide.yaml against the well-lit-path schema."""
    f = Findings()

    if not isinstance(guide, dict):
        f.error(f"top level: must be a map, got {type(guide).__name__}")
        return f

    for k in sorted(TOP_REQUIRED):
        if k not in guide:
            f.error(f"top level: missing required key {k!r}")
    for k in guide:
        if k not in TOP_REQUIRED | TOP_OPTIONAL:
            f.error(
                f"top level: unknown key {k!r} "
                f"(allowed: {sorted(TOP_REQUIRED | TOP_OPTIONAL)})"
            )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…