New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

llama-index-readers-json

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llama-index-readers-json

llama-index readers json integration

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
1

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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc