def get_role_rounds(self, role: RoleName, include_failure_rounds: bool = False) -> List[Round]:
        """Get all the rounds of the given role in the memory.
        TODO: better do cache here to avoid recreating the round list (new object) every time.

        Args:
            role: the role of the memory.
            include_failure_rounds: whether to include the failure rounds.
        """
        rounds_from_role: List[Round] = []
        for round in self.conversation.rounds:
            if round.state == "failed" and not include_failure_rounds:
                continue
            new_round = Round.create(
                user_query=round.user_query,
                id=round.id,
                state=round.state,
            )
            for post in round.post_list:
                if post.send_from == role or post.send_to == role:
                    new_round.add_post(copy.deepcopy(post))
            rounds_from_role.append(new_round)
        # Remove the temporal parts from the text of the posts of rounds
        for round in rounds_from_role[:-1]:
            for post in round.post_list:
                post.message = PromptUtil.remove_parts(
                    post.message,
                    delimiter=PromptUtil.DELIMITER_TEMPORAL,
                )
        # Remove the delimiters from the text of the posts of the last round
        for post in rounds_from_role[-1].post_list:
            post.message = PromptUtil.remove_all_delimiters(post.message)

        return rounds_from_role
Get all the rounds of the given role in the memory.
        TODO: better do cache here to avoid recreating the round list (new object) every time.

        Args:
            role: the role of the memory.
            include_failure_rounds: whether to include the failure rounds.
        
taskweaver/memory/memory.py