(records: list[dict[str, Any]], output_path: str)
| 254 | |
| 255 | |
| 256 | def write_jsonl(records: list[dict[str, Any]], output_path: str) -> None: |
| 257 | ensure_parent(output_path) |
| 258 | path = Path(output_path).expanduser().resolve() |
| 259 | path.write_text( |
| 260 | "\n".join(json.dumps(record, ensure_ascii=False) for record in records) + "\n", |
| 261 | encoding="utf-8", |
| 262 | ) |
| 263 | |
| 264 | |
| 265 | def write_full_text_markdown(records: list[dict[str, Any]], output_path: str, title: str) -> None: |