Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added JSONReader to file mappings #14419

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions llama-index-core/llama_index/core/readers/file/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def _try_loading_included_file_formats() -> Dict[str, Type[BaseReader]]:
PptxReader,
VideoAudioReader,
) # pants: no-infer-dep

from llama_index.readers import JSONReader
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you may be using a legacy version of llama_index (i.e., v0.9.4x and earlier)?

JSONReader is available in our integration package call llama-index-readers-json which isn't included as a dependency in the umbrella llama-index package. Since we don't include that in that umbrella package, we don't try to import it here.

Copy link
Contributor Author

@denen99 denen99 Jun 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @nerdai , i am using the latest 0.10 version off of main. Maybe i am confused but I see the JSONreader class in the llama-index-core here ? https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/readers/json.py . Is that not what I should be using?

except ImportError:
raise ImportError("`llama-index-readers-file` package not found")

Expand All @@ -87,6 +89,7 @@ def _try_loading_included_file_formats() -> Dict[str, Type[BaseReader]]:
".ipynb": IPYNBReader,
".xls": PandasExcelReader,
".xlsx": PandasExcelReader,
".json": JSONReader,
}
return default_file_reader_cls

Expand Down
Loading