Args:
            text (str): The output text to parse.
        Returns:
            Dict: The parsed output.
        """
        parsed = text.strip().rsplit("\n", maxsplit=1)
        if len(parsed) == 1:
            reasoning = ""
            verdict = parsed[0]
        else:
            reasoning, verdict = parsed
        score = 1 if verdict.upper() == "Y" else (0 if verdict.upper() == "N" else None)
        return {
            "reasoning": reasoning.strip(),
            "value": verdict,
            "score": score,
        }
CRITERIA_TYPE = Union[
    Mapping[str, str],
    Criteria,
    ConstitutionalPrinciple,
]
[docs]def resolve_criteria(
    criteria: Optional[Union[CRITERIA_TYPE, str]],
) -> Dict[str, str]:
    """Resolve the criteria to evaluate.
    Parameters
    ----------
    criteria : CRITERIA_TYPE
        The criteria to evaluate the runs against. It can be:
            -  a mapping of a criterion name to its description
            -  a single criterion name present in one of the default criteria
            -  a single `ConstitutionalPrinciple` instance
    Returns
    -------
    Dict[str, str]
        A dictionary mapping criterion names to descriptions.
    Examples
    --------
    >>> criterion = "relevance"
    >>> CriteriaEvalChain.resolve_criteria(criteria)
    {'relevance': 'Is the submission referring to a real quote from the text?'}
    """  # noqa: E501
    if criteria is None:
        return {
            "helpfulness": _SUPPORTED_CRITERIA[Criteria.HELPFULNESS],
        }
    if isinstance(criteria, Criteria):