Skip to main content

llama-index readers graphql integration

Project description

GraphQL Loader

pip install llama-index-readers-graphql

This loader loads documents via GraphQL queries from a GraphQL endpoint. The user specifies a GraphQL endpoint URL with optional credentials to initialize the reader. By declaring the GraphQL query and optional variables (parameters) the loader can fetch the nested result docs.

Usage

Here's an example usage of the GraphQLReader. You can test out queries directly on the site

import os

from llama_index.readers.graphql import GraphQLReader

uri = "https://countries.trevorblades.com/"
headers = {}
query = """
    query getContinents {
        continents {
            code
            name
        }
    }
"""
reader = GraphQLReader(uri, headers)
documents = reader.query(query, variables={})

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.

It uses the gql GraphQL library for the GraphQL queries.

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_graphql-0.2.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_readers_graphql-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_graphql-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0c93fafc3c49b6fa871b9e92606a9aec94faccc1b4b1fa98a178ae7b57493bc2
MD5 b2471b1a5a65d4c9a5e0bb82a83c7df0
BLAKE2b-256 a49af8669716cd3bf6383f9072b26eaabf7d324540f36180271813c5a5d53e9c

See more details on using hashes here.

File details

Details for the file llama_index_readers_graphql-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_graphql-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80dee4bd96592c93d15ec49243bbe176e6c601a538eadaa6bd15f1c5be6155b8
MD5 8717f2ab840cc418622cc36c4dd06f86
BLAKE2b-256 d981dbb4f334c79a9bfce4bfd4d7e83597397d7d8209ef65ade3b0834fab38c9

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