From 2088a82d6471b3666e1fedbab9e4e4fd67b602c9 Mon Sep 17 00:00:00 2001 From: denen99 Date: Wed, 26 Jun 2024 19:31:06 -0400 Subject: [PATCH 1/2] added JSONReader to file mappings --- llama-index-core/llama_index/core/readers/file/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llama-index-core/llama_index/core/readers/file/base.py b/llama-index-core/llama_index/core/readers/file/base.py index a93394b8fcc33..593a219fac6fd 100644 --- a/llama-index-core/llama_index/core/readers/file/base.py +++ b/llama-index-core/llama_index/core/readers/file/base.py @@ -62,6 +62,7 @@ def _try_loading_included_file_formats() -> Dict[str, Type[BaseReader]]: PDFReader, PptxReader, VideoAudioReader, + JSONReader, ) # pants: no-infer-dep except ImportError: raise ImportError("`llama-index-readers-file` package not found") @@ -87,6 +88,7 @@ def _try_loading_included_file_formats() -> Dict[str, Type[BaseReader]]: ".ipynb": IPYNBReader, ".xls": PandasExcelReader, ".xlsx": PandasExcelReader, + ".json": JSONReader, } return default_file_reader_cls From 6b377831d823fd42eb3a4aaeeaf76e54741a3760 Mon Sep 17 00:00:00 2001 From: denen99 Date: Wed, 26 Jun 2024 20:08:05 -0400 Subject: [PATCH 2/2] fixed import in JSONReader --- llama-index-core/llama_index/core/readers/file/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llama-index-core/llama_index/core/readers/file/base.py b/llama-index-core/llama_index/core/readers/file/base.py index 593a219fac6fd..476fc0c5b303c 100644 --- a/llama-index-core/llama_index/core/readers/file/base.py +++ b/llama-index-core/llama_index/core/readers/file/base.py @@ -62,8 +62,9 @@ def _try_loading_included_file_formats() -> Dict[str, Type[BaseReader]]: PDFReader, PptxReader, VideoAudioReader, - JSONReader, ) # pants: no-infer-dep + + from llama_index.readers import JSONReader except ImportError: raise ImportError("`llama-index-readers-file` package not found")