def post_to_raw_text(
        self,
        post: Post,
        content_formatter: Callable[[Attachment], str] = lambda x: x.content,
        if_format_message: bool = True,
        if_format_send_to: bool = True,
        ignored_types: Optional[List[AttachmentType]] = None,
    ) -> str:
        """
        Convert a Post object to raw text in the format of LLM output.
        """
        if ignored_types is None:
            ignored_types = []
        ignored_types.append(AttachmentType.shared_memory_entry)

        structured_llm: Dict[str, str] = {}
        for attachment in post.attachment_list:
            if ignored_types is not None and attachment.type in ignored_types:
                continue
            if attachment.type.value not in structured_llm:
                structured_llm[attachment.type.value] = content_formatter(attachment)
            else:
                # append the content of the same type of attachment
                structured_llm[attachment.type.value] += f"\n{content_formatter(attachment)}"
        if if_format_send_to:
            structured_llm["send_to"] = post.send_to
        if if_format_message:
            structured_llm["message"] = post.message
        structured_llm_text = json.dumps({"response": structured_llm})
        return structured_llm_text

        Convert a Post object to raw text in the format of LLM output.
        
taskweaver/role/translator.py