Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

llama-index-tools-graphql

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-tools-graphql

llama-index tools graphql integration

  • 0.3.0
  • PyPI
  • Socket score

Maintainers
1

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.openai 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.

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