AgentTypefrom langchain.utilities import GraphQLAPIWrapperllm = OpenAI(temperature=0)tools = load_tools(    ["graphql"],    graphql_endpoint="https://swapi-graphql.netlify.app/.netlify/functions/index",)agent = initialize_agent(    tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)Now, we can use the Agent to run queries against the Star Wars GraphQL API. Let's ask the Agent to list all the Star Wars films and their release dates.graphql_fields = """allFilms {    films {      title      director      releaseDate      speciesConnection {        species {          name          classification          homeworld {            name          }        }      }    }  }"""suffix = "Search for the titles of all the stawars films stored in the graphql database that has this schema "agent.run(suffix + graphql_fields)            > Entering new AgentExecutor chain...     I need to query the graphql database to get the titles of all the star wars films    Action: query_graphql    Action Input: query { allFilms { films { title } } }    Observation: "{\n  \"allFilms\": {\n    \"films\": [\n      {\n        \"title\": \"A New Hope\"\n      },\n      {\n        \"title\": \"The Empire Strikes Back\"\n      },\n      {\n        \"title\": \"Return of the Jedi\"\n      },\n      {\n        \"title\": \"The Phantom Menace\"\n      },\n      {\n        \"title\": \"Attack of the Clones\"\n      },\n      {\n        \"title\": \"Revenge of the Sith\"\n      }\n    ]\n  }\n}"    Thought: I now know the titles of all the star wars films    Final Answer: The titles of all the star wars films are: A New Hope, The Empire Strikes Back, Return of the Jedi, The Phantom Menace, Attack of the Clones, and Revenge of the Sith.        > Finished chain.    'The titles of all the star wars films are: A New Hope, The Empire Strikes Back, Return of the Jedi, The Phantom Menace, Attack of the Clones, and Revenge of the Sith.'PreviousGradioNextHuggingFace Hub
GraphQL is a query language for APIs and a runtime for executing those queries against your data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
GraphQL is a query language for APIs and a runtime for executing those queries against your data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools. ->: AgentTypefrom langchain.utilities import GraphQLAPIWrapperllm = OpenAI(temperature=0)tools = load_tools(    ["graphql"],    graphql_endpoint="https://swapi-graphql.netlify.app/.netlify/functions/index",)agent = initialize_agent(    tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)Now, we can use the Agent to run queries against the Star Wars GraphQL API. Let's ask the Agent to list all the Star Wars films and their release dates.graphql_fields = """allFilms {    films {      title      director      releaseDate      speciesConnection {        species {          name          classification          homeworld {            name          }        }      }    }  }"""suffix = "Search for the titles of all the stawars films stored in the graphql database that has this schema "agent.run(suffix + graphql_fields)            > Entering new AgentExecutor chain...     I need to query the graphql database to get the titles of all the star wars films    Action: query_graphql    Action Input: query { allFilms { films { title } } }    Observation: "{\n  \"allFilms\": {\n    \"films\": [\n      {\n        \"title\": \"A New Hope\"\n      },\n      {\n        \"title\": \"The Empire Strikes Back\"\n      },\n      {\n        \"title\": \"Return of the Jedi\"\n      },\n      {\n        \"title\": \"The Phantom Menace\"\n      },\n      {\n        \"title\": \"Attack of the Clones\"\n      },\n      {\n        \"title\": \"Revenge of the Sith\"\n      }\n    ]\n  }\n}"    Thought: I now know the titles of all the star wars films    Final Answer: The titles of all the star wars films are: A New Hope, The Empire Strikes Back, Return of the Jedi, The Phantom Menace, Attack of the Clones, and Revenge of the Sith.        > Finished chain.    'The titles of all the star wars films are: A New Hope, The Empire Strikes Back, Return of the Jedi, The Phantom Menace, Attack of the Clones, and Revenge of the Sith.'PreviousGradioNextHuggingFace Hub