def answer_exact_match(example, pred, trace=None, frac=1.0):
if isinstance(example.answer, str):
return _answer_match(pred.answer, [example.answer], frac=frac)
elif isinstance(example.answer, list):
return _answer_match(pred.answer, example.answer, frac=frac)
raise ValueError(f"Invalid answer type: {type(example.answer)}")