From 5ab39ebd3bf623fea99b9c063e258eb4a1431392 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Wed, 28 Feb 2024 20:31:53 +0100 Subject: [PATCH] Run format and lint with project specification. --- .../llama_index/readers/file/rtf/base.py | 9 +++++++-- .../readers/llama-index-readers-file/pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/rtf/base.py b/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/rtf/base.py index d4985bda82c14..772c4734a6a37 100644 --- a/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/rtf/base.py +++ b/llama-index-integrations/readers/llama-index-readers-file/llama_index/readers/file/rtf/base.py @@ -9,7 +9,12 @@ class RTFReader(BaseReader): """RTF (Rich Text Format) Reader. Reads rtf file and convert to Document.""" - def load_data(self, input_file: Union[Path, str], extra_info=Dict[str, Any], **load_kwargs: Any) -> List[Document]: + def load_data( + self, + input_file: Union[Path, str], + extra_info=Dict[str, Any], + **load_kwargs: Any + ) -> List[Document]: """Load data from RTF file. Args: @@ -24,6 +29,6 @@ def load_data(self, input_file: Union[Path, str], extra_info=Dict[str, Any], **l except ImportError: raise ImportError("striprtf is required to read RTF files.") - with open(str(input_file), "r") as f: + with open(str(input_file)) as f: text = rtf_to_text(f.read()) return [Document(text=text.strip())] diff --git a/llama-index-integrations/readers/llama-index-readers-file/pyproject.toml b/llama-index-integrations/readers/llama-index-readers-file/pyproject.toml index dc60fe8138f70..07f703f39bb02 100644 --- a/llama-index-integrations/readers/llama-index-readers-file/pyproject.toml +++ b/llama-index-integrations/readers/llama-index-readers-file/pyproject.toml @@ -30,10 +30,10 @@ PagedCSVReader = "thejessezhang" PandasCSVReader = "ephe-meral" PptxReader = "thejessezhang" PyMuPDFReader = "iamarunbrahma" +RTFReader = "FunkyOz" UnstructuredReader = "thejessezhang" VideoAudioReader = "llama-index" XMLReader = "mmaatouk" -RTFReader = "FunkyOz" [tool.mypy] disallow_untyped_defs = true