llama-index-tools-graphql


Namellama-index-tools-graphql JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
Summaryllama-index tools graphql integration
upload_time2024-08-22 03:23:44
maintainerajhofmann
docs_urlNone
authorYour Name
requires_python<4.0,>=3.8.1
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-graphql/examples/graphql.ipynb)

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](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-shopify/examples/shopify.ipynb) for an example of using a tool with a file loader to create even more powerful Agents.

```python
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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-tools-graphql",
    "maintainer": "ajhofmann",
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/91/f0/d8c737dfcf3a1851196a296e642013754b3bb7a2200e7a6d17c3cda1a26c/llama_index_tools_graphql-0.2.0.tar.gz",
    "platform": null,
    "description": "# GraphQL Tool\n\nThis 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\n\n## Usage\n\nThis tool has a more extensive example usage documented in a Jupyter notebook [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-graphql/examples/graphql.ipynb)\n\nHere's an example usage of the GraphQLToolSpec.\n\nThis tool works best when the Agent has access to the GraphQL schema for the server. See [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-shopify/examples/shopify.ipynb) for an example of using a tool with a file loader to create even more powerful Agents.\n\n```python\nfrom llama_index.tools.graphql import GraphQLToolSpec\nfrom llama_index.agent.openai import OpenAIAgent\n\ntool_spec = GraphQLToolSpec(\n    url=\"https://spacex-production.up.railway.app/\",\n    headers={\n        \"content-type\": \"application/json\",\n    },\n)\n\nagent = OpenAIAgent.from_tools(tool_spec.to_tool_list())\n\nagent.chat(\n    \"get the id, model, name and type of the Ships from the graphql endpoint\"\n)\n```\n\n`graphql_request`: Runs a GraphQL query against the configured server\n\nThis loader is designed to be used as a way to load data as a Tool in a Agent.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index tools graphql integration",
    "version": "0.2.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66594553e8dff27266c642a7f631fc725934a80fa8743daf67899335e7378cc9",
                "md5": "61ab38cd4e489443b2ebf63551f41e46",
                "sha256": "47a0fec74764e67ae33ec426e9fc7eb3708ebde3cbd36dd7461404aada8acdf7"
            },
            "downloads": -1,
            "filename": "llama_index_tools_graphql-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "61ab38cd4e489443b2ebf63551f41e46",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 2666,
            "upload_time": "2024-08-22T03:23:42",
            "upload_time_iso_8601": "2024-08-22T03:23:42.922459Z",
            "url": "https://files.pythonhosted.org/packages/66/59/4553e8dff27266c642a7f631fc725934a80fa8743daf67899335e7378cc9/llama_index_tools_graphql-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91f0d8c737dfcf3a1851196a296e642013754b3bb7a2200e7a6d17c3cda1a26c",
                "md5": "8633d425c02413f6955ec59a9957d900",
                "sha256": "5e9dd5ed2642b295671c320d84b4a4107c323ab45cb4794bb23f633bf9c0a2f3"
            },
            "downloads": -1,
            "filename": "llama_index_tools_graphql-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8633d425c02413f6955ec59a9957d900",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 2431,
            "upload_time": "2024-08-22T03:23:44",
            "upload_time_iso_8601": "2024-08-22T03:23:44.154389Z",
            "url": "https://files.pythonhosted.org/packages/91/f0/d8c737dfcf3a1851196a296e642013754b3bb7a2200e7a6d17c3cda1a26c/llama_index_tools_graphql-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 03:23:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-tools-graphql"
}
        
Elapsed time: 0.30181s