JSON Reader

Parameters and methods of JSONReader, which reads JSON files into documents.

JSONReader reads data from JSON files.

Parameters

ParameterTypeDefaultDescription
chunking_strategyOptional[ChunkingStrategy]FixedSizeChunking()Strategy used to chunk documents

JSONReader also accepts the base Reader constructor parameters.

Methods

read()

Reads a JSON file and returns a list of documents.

ParameterTypeDefaultDescription
pathUnion[Path, IO[Any]]RequiredPath to the JSON file or a file-like object
nameOptional[str]NoneName override for the resulting documents

async_read()

The async variant of read(). It accepts the same parameters.