From 39d14472fc7af7d833c17069bd357dcba90e97ab Mon Sep 17 00:00:00 2001 From: rong-xyz Date: Wed, 23 Apr 2025 12:44:49 +0000 Subject: [PATCH] add converters --- packages/markitup/src/markitup/_markitup.py | 4 ++-- packages/markitup/src/markitup/converters/_audio_converter.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/markitup/src/markitup/_markitup.py b/packages/markitup/src/markitup/_markitup.py index de70acb..d3e1b17 100644 --- a/packages/markitup/src/markitup/_markitup.py +++ b/packages/markitup/src/markitup/_markitup.py @@ -55,13 +55,13 @@ class MarkItUp: for plugin_name, converter in plugins.items(): self.converters[plugin_name] = converter - def convert(self, stream: BinaryIO, file_name: str) -> Dict[DocumentConverterResult, StreamInfo]: + def convert(self, stream: BinaryIO, file_name: str, **kwargs) -> Dict[DocumentConverterResult, StreamInfo]: stream_info: StreamInfo = self._get_stream_info(stream, file_name) # Deal with unsupported file types try: if stream_info.category in self.converters.keys(): converter = self.converters[stream_info.category](config=self.config) - return converter.convert(stream, stream_info), stream_info + return converter.convert(stream, stream_info, **kwargs), stream_info else: match stream_info.category: case "ppt": diff --git a/packages/markitup/src/markitup/converters/_audio_converter.py b/packages/markitup/src/markitup/converters/_audio_converter.py index 19759ea..38b5292 100644 --- a/packages/markitup/src/markitup/converters/_audio_converter.py +++ b/packages/markitup/src/markitup/converters/_audio_converter.py @@ -20,7 +20,7 @@ class AudioConverter(DocumentConverter): file_stream: BinaryIO, stream_info: StreamInfo, ** kwargs: Any, # Options to pass to the converter - ) -> Tuple[DocumentConverterResult, StreamInfo]: + ) -> DocumentConverterResult: md_content = "" # Transcribe