Skip to main content

llama-index readers json integration

Project description

LlamaIndex Readers Integration: Json

Overview

JSON Reader reads JSON documents with options to help extract relationships between nodes. It provides functionalities to control the depth of JSON traversal, collapse long JSON fragments, and clean JSON structures.

Installation

You can install JSON Reader via pip:

pip install llama-index-readers-json

Usage

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.
    levels_back="<Levels Back>",
    # The maximum number of characters a JSON fragment would be collapsed in the output. Default is None.
    collapse_length="<Collapse Length>",
    # If True, ensures that the output is ASCII-encoded. Default is False.
    ensure_ascii="<Ensure ASCII>",
    # If True, indicates that the file is in JSONL (JSON Lines) format. Default is False.
    is_jsonl="<Is JSONL>",
    # If True, removes lines containing only formatting from the output. Default is True.
    clean_json="<Clean JSON>",
)

# Load data from JSON file
documents = reader.load_data(input_file="<Input File>", extra_info={})

This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_json-0.3.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

llama_index_readers_json-0.3.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_json-0.3.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_json-0.3.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0

File hashes

Hashes for llama_index_readers_json-0.3.0.tar.gz
Algorithm Hash digest
SHA256 992f2710af0b575c15874c15ed6f04ba32c7ed070f6a01c8e0fe5c4f46c7009e
MD5 14e734b475917ed1659cfdb9018e73d7
BLAKE2b-256 b15604d80a07c15c256a9d6bf69f9cbfdea1acc8579a411829db8b7f35de6252

See more details on using hashes here.

File details

Details for the file llama_index_readers_json-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_json-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bb03482a92e2519189ad5589373b3f1ba1b7ddabbfcaa74864449e1116f3a76
MD5 57a7b17dd5a7244ad2d481adcf495836
BLAKE2b-256 a079dba4b6cfc49cbfb6220d9c19f215c4ec0d6e275c1921b8616243c05e6dbd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page