File size: 349 Bytes
fc329a3
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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')