Skip to main content

llama-index tools graphql integration

Project description

GraphQL Tool

This tool provides agents the ability to easily execute GraphQL queries against a server. The tool can be initialized with the server url and any required headers and thereafter perform queries against the server

Usage

This tool has a more extensive example usage documented in a Jupyter notebook here

Here's an example usage of the GraphQLToolSpec.

This tool works best when the Agent has access to the GraphQL schema for the server. See here for an example of using a tool with a file loader to create even more powerful Agents.

from llama_index.tools.graphql import GraphQLToolSpec
from llama_index.agent import OpenAIAgent

tool_spec = GraphQLToolSpec(
    url="https://spacex-production.up.railway.app/",
    headers={
        "content-type": "application/json",
    },
)

agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())

agent.chat(
    "get the id, model, name and type of the Ships from the graphql endpoint"
)

graphql_request: Runs a GraphQL query against the configured server

This loader is designed to be used as a way to load data as a Tool in a Agent. See here for examples.

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

flying_delta_tools_graphql-0.1.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file flying_delta_tools_graphql-0.1.0.tar.gz.

File metadata

File hashes

Hashes for flying_delta_tools_graphql-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e7f2426db4c3e25a9ec30282bd1f38332403a96236746f576812c610bcd4d71
MD5 74e1855272a8b1322e75940aaccd7a2c
BLAKE2b-256 5f583a730872635c2d2b1a3b688a9902bbbcd880482576a2303cba7a3d602fcc

See more details on using hashes here.

File details

Details for the file flying_delta_tools_graphql-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flying_delta_tools_graphql-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 087295abff6c650f105dcc076597544e6194eb621e03e23e8dcd9b0a940446fe
MD5 3a3ad533c7dac4ed792fa965defd4427
BLAKE2b-256 e3be23fca25af43365ecc06956e9772fbe4d1f03238adcc271992d665cbcbbae

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