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
Built Distribution
File details
Details for the file llama_index_readers_graphql-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_graphql-0.3.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f0a4fa7bd5e9285bd57cc8a4f30b07217053454ab21a250f8aabdf4e8f23b3 |
|
MD5 | 9f7c55091349d581bc2fb4ff95286d7e |
|
BLAKE2b-256 | f7877c2179f3e3f306581e4d73c9a07ca98be15ca797a30281f284eafc298e08 |
File details
Details for the file llama_index_readers_graphql-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_graphql-0.3.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 928390f058ec40998dd9efe336c29c0711525a047315924370361df2ddfb4b22 |
|
MD5 | 7f27417069418e2c21cc0119c354cb48 |
|
BLAKE2b-256 | 4d4fc7307bc7df7f3fd8f2ed29480134c5b500f92eeb39a91613501da9221fb1 |