| from pathlib import Path | |
| import json | |
| import sys | |
| p = Path(sys.argv[1]) | |
| with open(p) as f: | |
| for i, line in enumerate(f, 1): | |
| row = json.loads(line) | |
| for field in ['id', 'scores', 'provider', 'prompt_template']: | |
| if field not in row: | |
| raise SystemExit(f'missing {field} at line {i}') | |
| print('cache schema ok') | |