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