Evaluate agent trajectories against an expected trace order.
Full problem description visible. Upgrade to unlock the editor, test cases, and solution.
Implement compare_traces(expected, actual) that compares two lists of trace steps.
Each step is a dict: {"step": int, "tool": str, "args": str}.
Compare step-by-step in order. Steps with the same index must match exactly.
If the lists differ in length, extra or missing steps are mismatches.
Return {"match": bool, "mismatches": [{"step": int, "expected": dict|null, "actual": dict|null}]}.
Each mismatch entry identifies the step index and shows what was expected vs what
was actually produced.
₹999/monthLimited period launch pricing.
Get the full problem statement, test cases, interactive editor, solution explanation, and visual diagram.
def compare_traces(expected, actual):
mismatches = []Compare traces step by step
Already have Pro access? Sign in