def _format_file_block(
        self, block_content: dict, block: dict, block_type: str
    ) -> Tuple[str, List[NotionFileEntity]]:
        """Format file blocks and return content and file entities."""
        file_entity = self._create_file_entity_from_block(block_content, block["id"])
        files = [file_entity]
        caption = self._extract_rich_text_plain(block_content.get("caption", []))

        if block_type == "image":
            content = f"![{file_entity.name}]({file_entity.url})"
        else:
            content = f"[{file_entity.name}]({file_entity.url})"

        if caption:
            content += f"\n*{caption}*"

        return content, files
Format file blocks and return content and file entities.
backend/airweave/platform/sources/notion.py