Skip to content

NativeLCEL example in GenAI tutorial needs update for langchain 1.x #136

@rblumer4

Description

@rblumer4

In section 6.2 of the GenAI tutorial, there is a ContextualCompressorRetriever example.
That example uses code with langchain.retriever in it:

from langchain.retrievers import ContextualCompressionRetriever
from langchain.retrievers.document_compressors import LLMChainExtractor
from langchain_openai import OpenAI

llm = OpenAI(temperature=0)
compressor = LLMChainExtractor.from_llm(llm)
compression_retriever = ContextualCompressionRetriever(
    base_compressor=compressor, base_retriever=retriever
)

For use with langchain 1.x, that needs to be updated.
At a minium, it needs to be updated to use a different package name: langchain_classic.retrievers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions