(path: Path)
| 36 | |
| 37 | |
| 38 | def load_jsonl(path: Path) -> List[Dict[str, Any]]: |
| 39 | rows: List[Dict[str, Any]] = [] |
| 40 | with path.open("r", encoding="utf-8") as f: |
| 41 | for line in f: |
| 42 | line = line.strip() |
| 43 | if not line: |
| 44 | continue |
| 45 | payload = json.loads(line) |
| 46 | if isinstance(payload, dict): |
| 47 | rows.append(payload) |
| 48 | return rows |
| 49 | |
| 50 | |
| 51 | def truncate(value: Any, limit: int) -> str: |