import json, time, autoevals, importlib.metadata as md
from autoevals import ExactMatch, Levenshtein, ValidJSON
cases=json.load(open("cases.json")); t=time.perf_counter(); out=[]
for c in cases:
    r={"id":c["id"],"ExactMatch":ExactMatch()(c["output"],c["expected"]).score,
       "Levenshtein":round(Levenshtein()(c["output"],c["expected"]).score,4),
       "ValidJSON":ValidJSON()(c["output"]).score}
    out.append(r); print(json.dumps(r))
print(json.dumps({"autoevals":md.version("autoevals"),"seconds":round(time.perf_counter()-t,4)}))
