← Lesson
Keep a Single-Agent Baseline
Joeven
Run
Reset
Python loads on first run
def score(run): return { "ok": run["pass"], "cost": run["usd"], "better": None, } def beats(team, base): if not team["pass"] and base["pass"]: return False, "worse quality" if team["usd"] > 2 * base["usd"] and team["pass"] == base["pass"]: return False, "more than 2x cost, same quality" if team["pass"] and not base["pass"]: return True, "quality" if team["pass"] and team["usd"] <= base["usd"]: return True, "cheaper or equal" return False, "no win" base = {"pass": True, "usd": 0.04} fancy = {"pass": True, "usd": 0.20} good = {"pass": True, "usd": 0.03} print(beats(fancy, base)) print(beats(good, base)) print(score(base))
Run to execute this in your browser. Nothing is sent to a server.