def __post_init__()

in yourbench/utils/question_models.py [0:0]


    def __post_init__(self) -> None:
        self.question = str(self.question).strip()
        self.self_answer = str(self.self_answer).strip()
        self.estimated_difficulty = force_int_in_range(self.estimated_difficulty, 1, 10)
        self.self_assessed_question_type = str(self.self_assessed_question_type).strip()
        self.thought_process = str(self.thought_process)
        self.citations = validate_list(self.citations)
        self.question_mode = str(self.question_mode).strip().lower()

        if self.question_mode == "multi-choice":
            self.choices = validate_list(self.choices)
            if len(self.choices) != 4:
                raise ValueError("Multi-choice questions must have exactly 4 choices.")
        else:
            self.choices = []

        if self.chunk_id and self.source_chunk_ids:
            raise ValueError("Cannot have both chunk_id and source_chunk_ids.")
        if not self.chunk_id and not self.source_chunk_ids:
            raise ValueError("Must have either chunk_id or source_chunk_ids.")