|
|
import json |
|
|
from rzero import Challenger, Solver, Metrics |
|
|
|
|
|
|
|
|
with open("tokens.json", "r") as f: |
|
|
tokens = json.load(f) |
|
|
|
|
|
|
|
|
challenger = Challenger() |
|
|
solver = Solver() |
|
|
metrics = Metrics() |
|
|
|
|
|
|
|
|
certification_log = [] |
|
|
|
|
|
for token in tokens: |
|
|
prompt = token["prompt"] |
|
|
candidate = token["candidate"] |
|
|
level = token["level"] |
|
|
|
|
|
|
|
|
challenge = challenger.pose(prompt) |
|
|
response = solver.respond(challenge) |
|
|
|
|
|
|
|
|
score = metrics.evaluate(response, level) |
|
|
|
|
|
|
|
|
certification_log.append({ |
|
|
"candidate": candidate, |
|
|
"level": level, |
|
|
"prompt": prompt, |
|
|
"response": response, |
|
|
"score": score, |
|
|
"certified": score >= 0.85 |
|
|
}) |
|
|
|
|
|
|
|
|
with open("certification_results.json", "w") as f: |
|
|
json.dump(certification_log, f, indent=2) |
|
|
|
|
|
print("Certification complete. Results saved to certification_results.json.") |
|
|
|