Skip to content

docs: add missing imports in Box and Cohere reranker retriever examples - #5794

Open
SpiliosDmk (SpiliosDimakopoulos) wants to merge 1 commit into
langchain-ai:mainfrom
SpiliosDimakopoulos:fix/missing-retriever-imports
Open

docs: add missing imports in Box and Cohere reranker retriever examples#5794
SpiliosDmk (SpiliosDimakopoulos) wants to merge 1 commit into
langchain-ai:mainfrom
SpiliosDimakopoulos:fix/missing-retriever-imports

Conversation

@SpiliosDimakopoulos

Copy link
Copy Markdown
Contributor

What

Two retriever integration examples call classes that are never
imported in the snippet, so copying them as-is raises NameError.

  • src/oss/python/integrations/retrievers/box.mdx
    The LangGraph agent example calls ChatOpenAI(...) without
    importing it. Added: from langchain_openai import ChatOpenAI

  • src/oss/python/integrations/retrievers/cohere-reranker.mdx
    The QA pipeline example builds a chain with RunnablePassthrough()
    and StrOutputParser(), neither of which is imported. Added:
    from langchain_core.output_parsers import StrOutputParser
    from langchain_core.runnables import RunnablePassthrough

Why

Both symbols are used but never defined/imported anywhere else on
the page, so running the snippet as written fails immediately.
Same bug class as #1619 ("add missing import").

Type of change

  • Documentation fix (broken code example)

4-line, docs-only change, no functional impact outside the code samples.

Two retriever integration examples call classes that are never
imported in the snippet, so copying them as-is raises NameError.

- retrievers/box.mdx: the LangGraph agent example calls
  ChatOpenAI(...) without importing it. Added
  'from langchain_openai import ChatOpenAI'.
- retrievers/cohere-reranker.mdx: the QA pipeline example builds
  a chain using RunnablePassthrough() and StrOutputParser() without
  importing either. Added
  'from langchain_core.output_parsers import StrOutputParser' and
  'from langchain_core.runnables import RunnablePassthrough'.

Same class of fix as PR langchain-ai#1619 (add missing import).
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for opening a docs PR, SpiliosDmk (@SpiliosDimakopoulos)! When it's ready for review, please add the relevant reviewers:

  • @mdrxy (Python integrations)

@github-actions github-actions Bot added integration For docs updates for LangChain integrations langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects external User is not a member of langchain-ai labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external User is not a member of langchain-ai integration For docs updates for LangChain integrations langchain For docs changes to LangChain oss python For content related to the Python version of LangChain projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant