langchain icon indicating copy to clipboard operation
langchain copied to clipboard

GraphQL example notebook not working

Open cgrotz opened this issue 1 year ago • 2 comments

System Info

Colab standard Python 3 backend

Who can help?

@O-Roma

Information

  • [X] The official example notebooks/scripts
  • [ ] My own modified scripts

Related Components

  • [ ] LLMs/Chat Models
  • [ ] Embedding Models
  • [ ] Prompts / Prompt Templates / Prompt Selectors
  • [ ] Output Parsers
  • [ ] Document Loaders
  • [ ] Vector Stores / Retrievers
  • [ ] Memory
  • [ ] Agents / Agent Executors
  • [X] Tools / Toolkits
  • [ ] Chains
  • [ ] Callbacks/Tracing
  • [ ] Async

Reproduction

  1. Open GraphQL example notebook in colab
  2. Add langchain and openai to the pip install statement
  3. add environment variable for OPENAI_API_KEY
  4. Run the notebook

Got the following error

ValidationError: 3 validation errors for GraphQLAPIWrapper
gql_client
  field required (type=value_error.missing)
gql_function
  field required (type=value_error.missing)
__root__
  Could not import gql python package. Please install it with `pip install gql`. (type=value_error)

Expected behavior

The example should probably work.

cgrotz avatar May 18 '23 21:05 cgrotz

gql isn't a core dependency so you have to install it separately

dev2049 avatar May 19 '23 00:05 dev2049

gql is installed via pip in the notebook along httpx

cgrotz avatar May 19 '23 06:05 cgrotz

Hi, @cgrotz! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, the issue you reported was about the GraphQL example notebook not working due to a validation error and a missing gql python package. There was some discussion in the comments, with dev2049 suggesting installing gql separately, but you mentioned that gql is installed via pip in the notebook along with httpx.

However, it seems that the issue has been resolved. You mentioned that gql is installed via pip in the notebook along with httpx, so the missing gql package should not be a problem anymore.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your contribution to the LangChain repository!

dosubot[bot] avatar Sep 12 '23 16:09 dosubot[bot]

I think the issue can be closed now.

cgrotz avatar Sep 12 '23 17:09 cgrotz