async def convert(self, local_path: str, **kwargs: Any) -> Union[None, DocumentConverterResult]:
        """Convert a PDF file to markdown using Mistral OCR when available.

        Args:
            local_path: Path to the PDF file
            **kwargs: Additional arguments passed to converters

        Returns:
            AsyncDocumentConverterResult containing the markdown text
        """
        extension = kwargs.get("file_extension", "")
        if extension.lower() != ".pdf":
            return None

        # Try Mistral OCR first if available
        if self.mistral_client:
            try:
                md_content, title = await self._convert_with_mistral(local_path)
                return DocumentConverterResult(title=title, text_content=md_content)
            except Exception as e:
                logger.error(f"Error converting PDF with Mistral OCR: {str(e)}")
                logger.info("Falling back to PyPDF2")

        # Fall back to PyPDF2
        try:
            md_content, title = await self._convert_with_pypdf(local_path)
            return DocumentConverterResult(title=title, text_content=md_content)
        except ImportError:
            return DocumentConverterResult(
                title=None, text_content="PDF conversion requires Mistral API key or PyPDF2."
            )
        except Exception as e:
            logger.error(f"Error converting PDF with PyPDF2: {str(e)}")
            return None
Convert a PDF file to markdown using Mistral OCR when available.

        Args:
            local_path: Path to the PDF file
            **kwargs: Additional arguments passed to converters

        Returns:
            AsyncDocumentConverterResult containing the markdown text
        
backend/airweave/platform/file_handling/conversion/converters/pdf_converter.py