Open justinzyw opened 1 month ago
The extra_info
parameter is indeed supported by the JSONReader.load_data()
method. The issue might be due to incorrect usage or a different part of your code. Based on the provided code and documentation, the extra_info
parameter should work as expected.
Here is the corrected code snippet:
from llama_index.readers.json import JSONReader
# Initialize JSONReader
reader = JSONReader(
levels_back="<Levels Back>",
collapse_length="<Collapse Length>",
ensure_ascii="<Ensure ASCII>",
is_jsonl="<Is JSONL>",
clean_json="<Clean JSON>",
)
# Load data from JSON file
documents = reader.load_data(input_file="<Input File>", extra_info={})
Ensure that the parameters <Levels Back>
, <Collapse Length>
, <Ensure ASCII>
, <Is JSONL>
, <Clean JSON>
, and <Input File>
are correctly set according to your requirements. The extra_info
parameter should be a dictionary, as shown in the example. If the issue persists, double-check that the JSONReader
class and its load_data
method are correctly imported and used as per the latest documentation [1][2].
To continue talking to Dosu, mention @dosu.
Question Validation
Question
it seems a bug. to me. I tried the sample (as below) in https://llamahub.ai/l/readers/llama-index-readers-json. however, it throw an error saying that JSONReader.load_data() is not able to handle parm extra_info
` from llama_index.readers.json import JSONReader
Initialize JSONReader
reader = JSONReader(
The number of levels to go back in the JSON tree. Set to 0 to traverse all levels. Default is None.
)
Load data from JSON file
documents = reader.load_data(input_file="", extra_info={}) `