|
23 | 23 | LLMS_FILE = ROOT / "llms.txt" |
24 | 24 |
|
25 | 25 | REQUIRED_FIELDS = ["title", "slug", "use_case", "workflow", "tags", "prerequisites", "run", "test"] |
26 | | -EXCLUDED_FILES = {"_harness.py", "types.py", "registry.py", "__init__.py"} |
| 26 | +EXCLUDED_FILES = {"_harness.py", "example_types.py", "registry.py", "__init__.py"} |
27 | 27 |
|
28 | 28 |
|
29 | 29 | def parse_example(path: Path) -> dict[str, Any]: |
@@ -64,8 +64,9 @@ def validate_example(metadata: dict[str, Any], file_name: str, seen_slugs: set[s |
64 | 64 | raise ValueError(f"{path}: duplicate slug") |
65 | 65 | seen_slugs.add(slug) |
66 | 66 |
|
67 | | - if f"examples/{file_name}" not in metadata["run"]: |
68 | | - raise ValueError(f"{path}: run command must reference the file") |
| 67 | + module_name = file_name.replace(".py", "") |
| 68 | + if f"examples.{module_name}" not in metadata["run"]: |
| 69 | + raise ValueError(f"{path}: run command must reference 'examples.{module_name}'") |
69 | 70 |
|
70 | 71 |
|
71 | 72 | def ensure_llms_references(examples: list[dict[str, Any]]) -> None: |
@@ -180,7 +181,7 @@ def generate_registry(examples: list[dict[str, Any]]) -> str: |
180 | 181 |
|
181 | 182 | from typing import Any, Callable, cast |
182 | 183 |
|
183 | | -from .types import ExampleResult |
| 184 | +from .example_types import ExampleResult |
184 | 185 | {chr(10).join(imports)} |
185 | 186 |
|
186 | 187 | ExampleRegistryEntry = dict[str, Any] |
|
0 commit comments