Search code examples
pythonlangchain

cannot import class ReduceDocumentsChain


I am trying to import a library called ReduceDocumentsChain, I found out how to import MapReduceDocumentsChain but still no luck about the first one.

from langchain.chains.combine_documents.map_reduce import MapReduceDocumentsChain

I am following this tutorial:

https://python.langchain.com/docs/use_cases/summarization

Anyone has any idea?

Thank you


Solution

  • Using a clean conda environment, installing it through conda install langchain -c conda-forge allows me to from langchain.chains import ReduceDocumentsChain, MapReduceDocumentsChain without any issues. (this installed langchain v. 0.0.276)