langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Fixed multi input prompt for MapReduceChain

Open imeckr opened this issue 2 years ago • 3 comments

Fixed multi input prompt for MapReduceChain

Added kwargs support for inner chains of MapReduceChain via from_params method Currently the from_method method of intialising MapReduceChain chain doesn't work if prompt has multiple inputs. It happens because it uses StuffDocumentsChain and MapReduceDocumentsChain underneath, both of them require specifying document_variable_name if prompt of their llm_chain has more than one input.

With this PR, I have added support for passing their respective kwargs via the from_params method.

Fixes https://github.com/hwchase17/langchain/issues/4752

Who can review?

@dev2049 @hwchase17 @agola11

imeckr avatar May 19 '23 11:05 imeckr

@dev2049 @hwchase17 @agola11 Can anyone of you review this ?

imeckr avatar May 22 '23 07:05 imeckr

could we add either an example to the map reduce notebook or an integration test where this is used

dev2049 avatar May 22 '23 18:05 dev2049

@dev2049 Let me know if this example works.

imeckr avatar May 26 '23 19:05 imeckr