def _get_score_type()

in pyrit/score/human_in_the_loop_scorer.py [0:0]


    def _get_score_type(self, score_value: str) -> str:
        """
        Checks score value to make sure it is a valid float scale score or true/false score and returns the score type.

        Parameters:
            score_value (str): The score value to check.

        Returns:
            str: The score type which is either true/false or float_scale.
        """
        if score_value.lower() == "true" or score_value.lower() == "false":
            return "true_false"
        else:
            # This will throw an exception if the score is not a float
            value = float(score_value)
            if value < 0 or value > 1:
                raise ValueError("Score value must be between 0 and 1 for float_scale scores")
        return "float_scale"